Nan fen Sushosin; sa k ap vini apre a?

Nan fen Sushosin; sa k ap vini apre a?

PHP Suhosin

Pandan plizyè lane, Mwen zele te itilize Suhosin ak nenpòt aplikasyon nan PHP5 sou Apache2 oswa PHP-FPM Nginx webservers pou defann kont piki SQL ak lòt atak entènèt komen. An reyalite, PHP5 te tèlman dezas, tou de an tèm de sekirite debaz li yo, ak fonksyon li yo ak modil ke mwen pa janm ka vin ansent lè l sèvi avèk li san yo pa nenpòt ki redisyon enpòtan ke Sushos bay.

Kòm PHP5 se depresye ak pwogram eritaj mwen yo tout ale, Mwen kite ak plizyè aplikasyon nan PHP7 e pa gen okenn plak Sushosin ki disponib.

Atravè, li toujou teknikman posib ajoute Suhosin nan PHP 7.0 E 7.1 (pre-alfa - pa pou pwodiksyon), li jis yo di ke pwojè a depi lontan te ale ak PHP7 deja pwouve ke li ka gen pwoblèm tankou li te predesesè li. Kòm mwen panse sou yon nouvo adisyon nan WAF la ak sekirite debaz nan PHP7, se kèk nan solisyon m te vini avèk yo:

Twoublan move oswa fonksyon nesesè

Gen anpil fonksyon ki riske bati andedan PHP a ki potansyèlman danjere epi yo ta dwe andikape andedan 'php.ini' pa default. Ou ka jwenn dosye a konfigirasyon lè l sèvi avèk lòd ki anba a ak enfim fonksyon yo atravè via oswa nano.

php -i | grep "php.ini"

TANPRI SONJE: Si w ap kouri divès kalite vèsyon nan PHP ansanm oswa pwogram lan enstale kòm yon pati nan yon lòt aplikasyon twazyèm-pati, Lè sa a, chans yo wo ke ou gen plizyè 'php.ini' enstale epi li pa klè ki youn chaje pa webserver la. Asire w ke w ap koreksyon vèsyon ki kòrèk la (php).

Ajoute liy ki anba a nan fen 'php.ini' dosye, asire w ou sove dosye a, e rekòmanse webserver la. Ou ka aprann sou chak nan fonksyon PHP sa yo nan adrès sa. Kòm yon aksyon mezire, ou ka vle ajoute yo youn pa youn pou asire w ke li pa afekte negatif aplikasyon ou yo.

disable_functions = popen, eval, leak, exec, shell_exec, curl_exec, curl_multi_exec, parse_ini_file, mysql_connect, system, phpinfo, escapeshellarg, escapeshellcmd, passthru, symlink, show_source, mail, sendmail, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, pfsockopen, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid

Enskri enskri Globals ak Base64

Enskri Global se yon fonksyon pa PHP ki pèmèt etalaj opinyon nan URL la yo dwe konvèti varyab andedan kòd ou. Se poutèt sa, nenpòt ki kòd potansyèlman vilnerab ka eksplwate pa yon atakè ki ka pase etalaj move lè l sèvi avèk HTTP GET oswa demann POST.

Enskri Globals ka fasilman andikape pa ajoute liy ki anba a nan fen 'php.ini'. Pa bliye rekòmanse webserver la pou egzekite chanjman yo.

register_globals = Off

Jis tankou Enskri Globals, Baze64 se yon lòt souvan karakteristik nesesè ki louvri pòt la nan pòt move-pòt yo. Ou ka enfim Baz pou tout tan pa ajoute liy ki anba a nan fen 'php.ini'.

base64_decode = Off
Post Disclaimer

The views, information, or opinions expressed are solely those of the author and do not necessarily represent those of his employer or the organizations with which he is affiliated.

The information contained in this post is for general information purposes only. The information is provided by Farhad Mofidi and while he strives to keep the information current and accurate, he does not make any representations or warranties of any kind, express or implied, regarding the completeness, accuracy, reliability, suitability or availability of the website. Farhad makes no representations or warranties. or any information, products or related graphics contained in any Post for any purpose.

Also, AI may be employed as a tool to provide suggestions and improve some of the contents or sentences. The ideas, thoughts, opinions, and final products are original and human-made by the author.

 

Leave a Reply

Your email address will not be published. Required fields are marked *