9. PHP, LAMP and LEMP Step by Step
9.8 Secure PHP Settings
PHP chalu zala – aata php.ini madhe kahi mahatvache badal. File cha path php --ini ne kalto (Amazon Linux: /etc/php.ini, Ubuntu: /etc/php/8.x/fpm/php.ini kiwa /etc/php/8.x/apache2/php.ini).
| Setting | Secure value | Why |
|---|---|---|
expose_php |
Off |
Hides the X-Powered-By: PHP/8.x header |
display_errors |
Off |
Errors with paths and SQL must not reach visitors |
log_errors |
On |
Errors go to the log instead |
allow_url_include |
Off |
Blocks remote file inclusion |
upload_max_filesize / post_max_size |
As small as the app needs | Limits abuse of uploads |
session.cookie_httponly |
1 |
JavaScript cannot read the session cookie (limits XSS damage) |
session.cookie_secure |
1 (with HTTPS) |
Cookie only sent over HTTPS |
php --ini | grep "Loaded Configuration"
sudo sed -i 's/^expose_php = On/expose_php = Off/' /etc/php.ini # Amazon Linux
sudo sed -i 's/^display_errors = On/display_errors = Off/' /etc/php.ini
sudo service php-fpm restart # Ubuntu: php8.3-fpm
curl -I http://localhost/index.php | grep -i x-powered-by # should print nothing
Why this matters for security
Verbose PHP errors are a gift for attackers: a single SQL error message can reveal the table name and query structure, making SQL injection much easier (error-based SQLi). Production servers log errors; they never display them.
Ravindra Bagale's Tip
display_errors = On was left on in development and went to production as it was – this happens in many projects. Keep this line in your deploy checklist: "display_errors Off, expose_php Off, info.php deleted". Very simple, but very important.
Ravindra Bagale's Tip – मराठी
Development मध्ये display_errors = On ठेवलं आणि production ला तसंच गेलं – बऱ्याच projects मध्ये असं होतं. Deploy checklist मध्ये ही line ठेवाच: "display_errors Off, expose_php Off, info.php deleted". एकदम simple, पण खूप महत्त्वाचं.
Ravindra Bagale's Tip – हिंदी
Development में display_errors = On रखा और production में वैसे ही चला गया – बहुत से projects में ऐसा होता है. Deploy checklist में यह line ज़रूर रखो: "display_errors Off, expose_php Off, info.php deleted". बहुत आसान, पर बहुत ज़रूरी.
Practice task
Apply the settings from the table on one server, restart PHP-FPM, and confirm with curl -I that the X-Powered-By header is gone.
Thodkyaat sangaycha tar
- Dynamic = server runs code (PHP) and queries a database for each request.
- Apache runs PHP via
mod_phpor PHP-FPM; Nginx always via PHP-FPM (FastCGI socket). - LAMP = Linux + Apache + MySQL/MariaDB + PHP; LEMP = same with Nginx.
- Amazon Linux:
yum,httpd,mariadb105-server,php-fpm. Ubuntu:apt,apache2,mysql-server,libapache2-mod-phporphp-fpm. - 502 = PHP-FPM not running or wrong socket. Delete
info.phpafter testing. - Prepared statements stop SQL injection;
htmlspecialchars()stops XSS;display_errors Offin production.
Samjla ka? Stack tayar – aata database khol shikuya. Aata pudhe jaauya MySQL kade!
Extended teaching notes
Why this lesson matters
Use this lesson to strengthen systems you own: understand the risk, practise safely in a lab, then write and apply the fix.
Apply the fix across stacks
Same class of bug, same idea in every language.
Java / Spring Boot
Parameterise queries, encode output, CSRF tokens, limited Actuator, dependency scanning.
ASP.NET Core
EF Core / parameterised SQL, Razor encoding, HTTPS, Data Protection.
Node.js / Express
helmet, parameterised SQL, npm audit, avoid eval and shell concat.
Python / Django / Flask / FastAPI
ORM, autoescape, pip-audit, Bandit; never shell=True with user input.
PHP / Laravel
PDO/Eloquent, Blade escaping, composer audit.
Go / Ruby
database/sql placeholders / ActiveRecord; html/template / ERB escaping; govulncheck / Brakeman.
nginx / Apache / Tomcat
Hide versions, TLS, security headers, least-open ports.
MySQL / PostgreSQL / MongoDB / Redis
Private networks, auth on, least-privilege users, no 0.0.0.0/0.
AWS / Azure / GCP
Roles not long-lived keys, private data stores, cloud audit logs on.
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.
Real incident: PHP2Shell – two critical PHP flaws let attackers run commands on web servers without a login, and governments took websites offline (Oct 2026)
1. What happened
PHP is the language that builds web pages on the server. WordPress, Drupal, Joomla and many control panels run on it. In this lesson you set PHP up and made its settings safe.
- On 21 October 2026, the PHP team released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. These fix two critical flaws: CVE-2026-109618 and CVE-2026-109619. Together they are called "PHP2Shell".
- Both flaws allow remote code execution (RCE) without a login. That means a stranger on the internet can make your server run their commands. Each flaw has a CVSS v4.0 score of 9.2.
- PHP says every PHP install that serves web pages is at risk: PHP-FPM, Apache with
mod_php, php-cgi, FrankenPHP and LiteSpeed. The risk is highest formod_php, where one request can start the attack before any of your PHP code runs. - Researchers from Calif, Wiz and OpenAI found the flaws with the help of AI tools. Details leaked on social media on 20 October, so the PHP team had to rush its warning.
- Amazon saw an attack attempt on its trap servers (honeypots) on 17 October, four days before the public warning. After the fix came out, Amazon said PHP2Shell is now "being broadly exploited in the wild".
- Many sites went offline as a safety step. Finland shut its government public web services for a while. The Dutch cyber security agency took its own website offline. Wikimedia took some systems down. The UK NCSC said: patch now, or take the system offline until you can. India's CERT-In also issued a critical warning.
- PHP 8.1 and older no longer get fixes from the PHP project. You need a fix from your Linux vendor, or a move to a supported version.
2. How the hack happened (public reporting only – high-level)
- Attackers scan the internet for servers that run PHP. They do not need to pick a victim. Any public PHP page is enough.
- They send one specially shaped form request to any PHP page. No login is needed. Datadog showed that even a page that only prints one short reply is enough.
- The request makes PHP stop in the middle of its work (for example, it runs out of memory). Some of PHP's own data is left half-ready.
- PHP then cleans up after the failed request, or the next request on the same worker uses old leftover data. PHP trusts this broken data.
- The attacker's command then runs as the web server user (like
apacheorwww-data). From there they can read files, read database passwords from config files, or leave a hidden backdoor. - Your login page, your input checks and your firewall rules inside the app do not help, because all this happens before your code runs.
3. How to stop it / defend (this lesson: secure PHP settings)
- Patch first. It is the only full fix. Check the version with
php -v. Update with your package manager (sudo dnf update 'php*'on Amazon Linux,sudo apt update && sudo apt upgradeon Ubuntu). Then restart every worker:sudo service php-fpm restart(Ubuntu:php8.3-fpm), andsudo service httpd restart(Ubuntu:apache2) if you use Apache. - Check the PHP that serves the web, not only the command line. The web server can use a different PHP. Open a test page with
phpinfo()on your own lab server, read the version, then delete the test page. - If you cannot patch today, take the site offline, as the NCSC advised. As a short-term extra step only, the PHP team lists
php.inisettings that block some attack paths:session.upload_progress.enabled = 0, a smallpost_max_size(8M if you have no uploads, 32M if you do) andupload_max_filesizesmaller thanpost_max_size. Put them inphp.inior the FPM pool file, not inini_set()or.user.ini, and restart. These settings do not make you safe. - Hiding errors does not stop this bug.
display_errors = Offis still right for production, but the PHP team says hiding errors withdisplay_errors,error_reportingor@does not help here. - Limit the damage. Run PHP as its own low-power user. Give the website's database user only the rights it needs. Keep secrets out of files the web user can read when you can.
- A WAF in front helps for a few days. Cloudflare added rules, but its CTO called them a "STOPGAP only".
4. How to take care so it won't happen again (checklist)
- [ ] Make a list of every place PHP runs: servers, containers, control panels and products that hide PHP inside.
- [ ] Patch internet-facing servers in hours, not weeks, when a critical flaw is out.
- [ ] After patching, restart every worker and rebuild container images.
- [ ] Look at logs from 17 October onwards: very large form requests, "Allowed memory size ... exhausted ... in Unknown on line 0" errors, and any shell started by the web server user.
- [ ] Move off PHP 8.1 and older. Plan upgrades before support ends.
- [ ] Keep production
php.inisafe:display_errors Off,expose_php Off, small upload limits, settings that apps cannot override.
Source: PHP security advisory "Critical remote code execution vulnerabilities, update now" on php.net, 21 October 2026; Amazon AWS Security Blog, CJ Moses, "Amazon Threat Intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot", 21 October 2026; BleepingComputer, Sergiu Gatlan, "PHP ships emergency patches for critical PHP2Shell flaws", 21 October 2026; Datadog Security Labs, "PHP2Shell - Critical vulnerabilities in PHP", 21 October 2026; BBC News, "Websites taken down worldwide as critical PHP cyber-security update issued", 21 October 2026; Reuters (via CNBC), "Government websites go dark as software flaw sparks security scramble", 21 October 2026; Business Today, 22 October 2026 (CERT-In note).
1. काय झालं
PHP ही server वर web pages बनवणारी language आहे. WordPress, Drupal, Joomla आणि बरेच control panels त्यावर चालतात. या lesson मध्ये तुम्ही PHP setup केलं आणि त्याचे settings safe केले.
- 21 ऑक्टोबर 2026 ला PHP team ने PHP 8.5.12, 8.4.27, 8.3.36 आणि 8.2.35 release केले. यांनी दोन critical flaws fix केले: CVE-2026-109618 आणि CVE-2026-109619. दोघांना मिळून "PHP2Shell" म्हणतात.
- दोन्ही flaws मुळे login शिवाय remote code execution (RCE) शक्य होतं. म्हणजे internet वरचा कोणताही अनोळखी माणूस तुमच्या server कडून त्याचे commands चालवून घेऊ शकतो. प्रत्येक flaw चा CVSS v4.0 score 9.2 आहे.
- PHP म्हणतं की web pages serve करणारा प्रत्येक PHP install धोक्यात आहे: PHP-FPM,
mod_phpसोबत Apache, php-cgi, FrankenPHP आणि LiteSpeed. धोकाmod_phpसाठी सगळ्यात जास्त आहे, जिथे एकच request तुमचा कोणताही PHP code चालायच्या आधीच attack सुरू करू शकते. - Calif, Wiz आणि OpenAI च्या researchers नी AI tools च्या मदतीने हे flaws शोधले. Details 20 ऑक्टोबरला social media वर leak झाले, म्हणून PHP team ला घाईने warning द्यावी लागली.
- Amazon ला त्याच्या trap servers (honeypots) वर 17 ऑक्टोबरला, म्हणजे public warning च्या चार दिवस आधीच, एक attack चा प्रयत्न दिसला. Fix आल्यानंतर Amazon ने सांगितलं की PHP2Shell आता "being broadly exploited in the wild" – म्हणजे मोठ्या प्रमाणावर वापरला जात आहे.
- Safety म्हणून बऱ्याच sites offline गेल्या. Finland ने सरकारी public web services काही काळ बंद केल्या. Dutch cyber security agency ने स्वतःची website offline केली. Wikimedia ने काही systems बंद केल्या. UK च्या NCSC ने सांगितलं: आत्ताच patch करा, नाहीतर patch होईपर्यंत system offline ठेवा. भारताच्या CERT-In ने पण critical warning दिली.
- PHP 8.1 आणि जुने versions ना आता PHP project कडून fixes मिळत नाहीत. तुम्हाला तुमच्या Linux vendor कडून fix लागेल, किंवा supported version वर जावं लागेल.
2. Hack कसा झाला (फक्त public reporting – high-level)
- Attackers PHP चालणाऱ्या servers साठी संपूर्ण internet scan करतात. त्यांना victim निवडायची गरज नाही. कोणतंही public PHP page पुरेसं आहे.
- ते कोणत्याही PHP page ला एक खास बनवलेली form request पाठवतात. Login लागत नाही. Datadog ने दाखवलं की फक्त एक छोटं उत्तर print करणारं page पण पुरेसं आहे.
- ही request PHP ला काम अर्ध्यात थांबवायला भाग पाडते (उदाहरणार्थ, memory संपते). PHP चा स्वतःचा काही data अर्धवट तयार राहतो.
- मग PHP failed request नंतर साफसफाई (cleanup) करतं, किंवा त्याच worker वरची पुढची request जुना उरलेला data वापरते. PHP या बिघडलेल्या data वर विश्वास ठेवतं.
- मग attacker चा command web server user म्हणून (जसं
apacheकिंवाwww-data) चालतो. तिथून ते files वाचू शकतात, config files मधले database passwords वाचू शकतात, किंवा एक लपलेला backdoor ठेवू शकतात. - तुमचं login page, तुमचे input checks आणि app मधले firewall rules काहीच मदत करत नाहीत, कारण हे सगळं तुमचा code चालायच्या आधीच होतं.
3. कसं थांबवायचं / बचाव (हा lesson: secure PHP settings)
- आधी patch करा. हाच एकमेव पूर्ण fix आहे.
php -vने version check करा. Package manager ने update करा (Amazon Linux वरsudo dnf update 'php*', Ubuntu वरsudo apt update && sudo apt upgrade). मग प्रत्येक worker restart करा:sudo service php-fpm restart(Ubuntu:php8.3-fpm), आणि Apache वापरत असाल तरsudo service httpd restart(Ubuntu:apache2). - फक्त command line चं नाही, web serve करणारं PHP check करा. Web server वेगळं PHP वापरू शकतो. तुमच्या स्वतःच्या lab server वर
phpinfo()असलेलं test page उघडा, version वाचा, आणि मग test page delete करा. - आज patch करता येत नसेल तर, NCSC ने सांगितल्याप्रमाणे site offline करा. फक्त थोड्या काळासाठी extra step म्हणून, PHP team ने काही
php.inisettings दिले आहेत जे काही attack paths block करतात:session.upload_progress.enabled = 0, लहानpost_max_size(uploads नसतील तर 8M, असतील तर 32M) आणिpost_max_sizeपेक्षा लहानupload_max_filesize. हेphp.iniकिंवा FPM pool file मध्ये टाका,ini_set()किंवा.user.iniमध्ये नाही, आणि restart करा. हे settings तुम्हाला safe बनवत नाहीत. - Errors लपवल्याने हा bug थांबत नाही. Production साठी
display_errors = Offअजूनही बरोबरच आहे, पण PHP team म्हणते कीdisplay_errors,error_reportingकिंवा@ने errors लपवून इथे काही फायदा होत नाही. - नुकसान कमी ठेवा. PHP ला त्याच्या स्वतःच्या कमी-power user म्हणून चालवा. Website च्या database user ला फक्त गरजेचे rights द्या. शक्य असेल तेव्हा secrets web user ला वाचता येणाऱ्या files मध्ये ठेवू नका.
- समोर WAF असेल तर काही दिवस मदत होते. Cloudflare ने rules add केले, पण त्याच्या CTO ने त्यांना "STOPGAP only" म्हटलं – म्हणजे फक्त तात्पुरता उपाय.
4. पुन्हा असं होऊ नये म्हणून काय काळजी घ्यायची (checklist)
- [ ] PHP कुठे कुठे चालतं याची list बनवा: servers, containers, control panels आणि आत PHP लपवलेली products.
- [ ] Critical flaw आला की internet-facing servers आठवड्यांत नाही, तासांत patch करा.
- [ ] Patch केल्यानंतर प्रत्येक worker restart करा आणि container images पुन्हा build करा.
- [ ] 17 ऑक्टोबरपासूनचे logs बघा: खूप मोठ्या form requests, "Allowed memory size ... exhausted ... in Unknown on line 0" errors, आणि web server user ने सुरू केलेला कोणताही shell.
- [ ] PHP 8.1 आणि जुन्या versions वरून पुढे जा. Support संपायच्या आधी upgrades plan करा.
- [ ] Production
php.inisafe ठेवा:display_errors Off,expose_php Off, लहान upload limits, apps बदलू शकणार नाहीत असे settings.
स्रोत: php.net वरची PHP security advisory "Critical remote code execution vulnerabilities, update now", 21 ऑक्टोबर 2026; Amazon AWS Security Blog, CJ Moses, "Amazon Threat Intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot", 21 ऑक्टोबर 2026; BleepingComputer, Sergiu Gatlan, "PHP ships emergency patches for critical PHP2Shell flaws", 21 ऑक्टोबर 2026; Datadog Security Labs, "PHP2Shell - Critical vulnerabilities in PHP", 21 ऑक्टोबर 2026; BBC News, "Websites taken down worldwide as critical PHP cyber-security update issued", 21 ऑक्टोबर 2026; Reuters (CNBC द्वारे), "Government websites go dark as software flaw sparks security scramble", 21 ऑक्टोबर 2026; Business Today, 22 ऑक्टोबर 2026 (CERT-In note).
1. क्या हुआ
PHP वह language है जो server पर web pages बनाती है. WordPress, Drupal, Joomla और कई control panels इसी पर चलते हैं. इस lesson में आपने PHP setup किया और उसकी settings safe कीं.
- 21 अक्टूबर 2026 को PHP team ने PHP 8.5.12, 8.4.27, 8.3.36 और 8.2.35 release किए. इन्होंने दो critical flaws fix किए: CVE-2026-109618 और CVE-2026-109619. दोनों को मिलाकर "PHP2Shell" कहते हैं.
- दोनों flaws से बिना login के remote code execution (RCE) संभव होता है. यानी internet पर कोई भी अनजान व्यक्ति आपके server से अपने commands चलवा सकता है. हर flaw का CVSS v4.0 score 9.2 है.
- PHP कहता है कि web pages serve करने वाला हर PHP install खतरे में है: PHP-FPM,
mod_phpके साथ Apache, php-cgi, FrankenPHP और LiteSpeed. खतराmod_phpके लिए सबसे ज़्यादा है, जहाँ एक ही request आपका कोई भी PHP code चलने से पहले ही attack शुरू कर सकती है. - Calif, Wiz और OpenAI के researchers ने AI tools की मदद से ये flaws ढूँढे. Details 20 अक्टूबर को social media पर leak हो गईं, इसलिए PHP team को जल्दी में warning देनी पड़ी.
- Amazon को अपने trap servers (honeypots) पर 17 अक्टूबर को, यानी public warning से चार दिन पहले, एक attack की कोशिश दिखी. Fix आने के बाद Amazon ने कहा कि PHP2Shell अब "being broadly exploited in the wild" – यानी बड़े पैमाने पर इस्तेमाल हो रहा है.
- Safety के लिए कई sites offline हो गईं. Finland ने सरकारी public web services कुछ समय के लिए बंद कीं. Dutch cyber security agency ने अपनी ही website offline कर दी. Wikimedia ने कुछ systems बंद किए. UK के NCSC ने कहा: अभी patch करें, या patch होने तक system offline रखें. भारत के CERT-In ने भी critical warning जारी की.
- PHP 8.1 और पुराने versions को अब PHP project से fixes नहीं मिलते. आपको अपने Linux vendor से fix चाहिए, या supported version पर जाना होगा.
2. Hack कैसे हुआ (सिर्फ़ public reporting – high-level)
- Attackers PHP चलाने वाले servers के लिए पूरा internet scan करते हैं. उन्हें victim चुनने की ज़रूरत नहीं. कोई भी public PHP page काफ़ी है.
- वे किसी भी PHP page पर एक खास तरह से बनी form request भेजते हैं. Login की ज़रूरत नहीं. Datadog ने दिखाया कि सिर्फ़ एक छोटा जवाब print करने वाला page भी काफ़ी है.
- यह request PHP को काम बीच में रोकने पर मजबूर करती है (जैसे memory खत्म हो जाती है). PHP का अपना कुछ data आधा-अधूरा रह जाता है.
- फिर PHP failed request के बाद सफ़ाई (cleanup) करता है, या उसी worker पर अगली request पुराना बचा हुआ data इस्तेमाल करती है. PHP इस बिगड़े हुए data पर भरोसा करता है.
- फिर attacker का command web server user के रूप में (जैसे
apacheयाwww-data) चलता है. वहाँ से वे files पढ़ सकते हैं, config files से database passwords पढ़ सकते हैं, या एक छिपा हुआ backdoor छोड़ सकते हैं. - आपका login page, आपके input checks और app के अंदर के firewall rules कोई मदद नहीं करते, क्योंकि यह सब आपका code चलने से पहले होता है.
3. कैसे रोकें / बचाव (यह lesson: secure PHP settings)
- पहले patch करें. यही एकमात्र पूरा fix है.
php -vसे version check करें. Package manager से update करें (Amazon Linux परsudo dnf update 'php*', Ubuntu परsudo apt update && sudo apt upgrade). फिर हर worker restart करें:sudo service php-fpm restart(Ubuntu:php8.3-fpm), और Apache इस्तेमाल करते हैं तोsudo service httpd restart(Ubuntu:apache2). - सिर्फ़ command line वाला नहीं, web serve करने वाला PHP check करें. Web server अलग PHP इस्तेमाल कर सकता है. अपने खुद के lab server पर
phpinfo()वाला test page खोलें, version पढ़ें, फिर test page delete करें. - अगर आज patch नहीं कर सकते, तो NCSC की सलाह की तरह site offline करें. सिर्फ़ थोड़े समय के extra step के रूप में, PHP team ने कुछ
php.inisettings बताई हैं जो कुछ attack paths block करती हैं:session.upload_progress.enabled = 0, छोटाpost_max_size(uploads नहीं हैं तो 8M, हैं तो 32M) औरpost_max_sizeसे छोटाupload_max_filesize. इन्हेंphp.iniया FPM pool file में डालें,ini_set()या.user.iniमें नहीं, और restart करें. ये settings आपको safe नहीं बनातीं. - Errors छिपाने से यह bug नहीं रुकता. Production के लिए
display_errors = Offअब भी सही है, लेकिन PHP team कहती है किdisplay_errors,error_reportingया@से errors छिपाने से यहाँ कोई फ़ायदा नहीं. - नुकसान कम रखें. PHP को उसके अपने कम-power user के रूप में चलाएँ. Website के database user को सिर्फ़ ज़रूरी rights दें. जहाँ हो सके, secrets को उन files में न रखें जिन्हें web user पढ़ सकता है.
- सामने WAF हो तो कुछ दिन मदद मिलती है. Cloudflare ने rules जोड़े, लेकिन उसके CTO ने उन्हें "STOPGAP only" कहा – यानी सिर्फ़ अस्थायी उपाय.
4. दोबारा ऐसा न हो, इसके लिए क्या ध्यान रखें (checklist)
- [ ] PHP कहाँ-कहाँ चलता है इसकी list बनाएँ: servers, containers, control panels और ऐसे products जिनके अंदर PHP छिपा है.
- [ ] Critical flaw आने पर internet-facing servers हफ़्तों में नहीं, घंटों में patch करें.
- [ ] Patch करने के बाद हर worker restart करें और container images दोबारा build करें.
- [ ] 17 अक्टूबर से के logs देखें: बहुत बड़ी form requests, "Allowed memory size ... exhausted ... in Unknown on line 0" errors, और web server user द्वारा शुरू किया गया कोई भी shell.
- [ ] PHP 8.1 और पुराने versions से आगे बढ़ें. Support खत्म होने से पहले upgrades plan करें.
- [ ] Production
php.inisafe रखें:display_errors Off,expose_php Off, छोटी upload limits, ऐसी settings जिन्हें apps बदल न सकें.
स्रोत: php.net पर PHP security advisory "Critical remote code execution vulnerabilities, update now", 21 अक्टूबर 2026; Amazon AWS Security Blog, CJ Moses, "Amazon Threat Intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot", 21 अक्टूबर 2026; BleepingComputer, Sergiu Gatlan, "PHP ships emergency patches for critical PHP2Shell flaws", 21 अक्टूबर 2026; Datadog Security Labs, "PHP2Shell - Critical vulnerabilities in PHP", 21 अक्टूबर 2026; BBC News, "Websites taken down worldwide as critical PHP cyber-security update issued", 21 अक्टूबर 2026; Reuters (CNBC के ज़रिए), "Government websites go dark as software flaw sparks security scramble", 21 अक्टूबर 2026; Business Today, 22 अक्टूबर 2026 (CERT-In note).
Check if you're safe: Is My Website Hacked? · Website Security Checklist