<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sirjan Singh</title>
    <description>The latest articles on DEV Community by Sirjan Singh (@noanya).</description>
    <link>https://dev.to/noanya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1191277%2F9999d449-afe6-405e-848e-3037729bb74f.jpeg</url>
      <title>DEV Community: Sirjan Singh</title>
      <link>https://dev.to/noanya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/noanya"/>
    <language>en</language>
    <item>
      <title>How to check your servers, Docker images and logs for PHP2Shell</title>
      <dc:creator>Sirjan Singh</dc:creator>
      <pubDate>Sun, 25 Oct 2026 22:14:27 +0000</pubDate>
      <link>https://dev.to/noanya/how-to-check-your-servers-docker-images-and-logs-for-php2shell-2c5d</link>
      <guid>https://dev.to/noanya/how-to-check-your-servers-docker-images-and-logs-for-php2shell-2c5d</guid>
      <description>&lt;p&gt;PHP shipped emergency fixes for PHP2Shell (CVE-2026-109618 and CVE-2026-109619) on October 21. Both are rated CVSS 9.2, both allow remote code execution without logging in, and they affect PHP 5.4 through 8.5. Public exploits are already out.&lt;/p&gt;

&lt;p&gt;The fix is simple: upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35. The hard part is answering three questions quickly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which of my machines are on an affected version?&lt;/li&gt;
&lt;li&gt;Which of my Docker images are?&lt;/li&gt;
&lt;li&gt;Has anyone already tried it against me?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I wrote a small tool, php2shell-check, that answers all three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipx &lt;span class="nb"&gt;install &lt;/span&gt;php2shell-check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's one Python file with no dependencies, so you can also just download &lt;code&gt;php2shell_check.py&lt;/code&gt; and run it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which machines?
&lt;/h2&gt;

&lt;p&gt;On a server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php2shell-check check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a whole fleet, without SSH or network access, feed it an inventory file of &lt;code&gt;host version&lt;/code&gt; lines (straight from Ansible facts or a CMDB export):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php2shell-check check &lt;span class="nt"&gt;--inventory&lt;/span&gt; hosts.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit code 0 means not affected, 1 means affected, 2 means it couldn't tell. There's &lt;code&gt;--json&lt;/code&gt; and &lt;code&gt;--sarif&lt;/code&gt; too, so it drops into CI and GitHub code scanning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which images?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php2shell-check scan-docker            &lt;span class="c"&gt;# Dockerfiles and compose files here&lt;/span&gt;
php2shell-check scan-docker &lt;span class="nt"&gt;--running&lt;/span&gt;  &lt;span class="c"&gt;# plus running containers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A pinned tag like &lt;code&gt;php:8.3.10&lt;/code&gt; is judged exactly. A floating tag like &lt;code&gt;php:8.4&lt;/code&gt; is flagged as ambiguous, because what it resolves to depends on when you last pulled. An end-of-life tag like &lt;code&gt;php:8.1&lt;/code&gt; is flagged as affected outright, since 7.4, 8.0 and 8.1 get no official release.&lt;/p&gt;

&lt;h2&gt;
  
  
  Did anyone try?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php2shell-check scan-logs /var/log/modsec_audit.log /var/log/apache2/error.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It looks for indicators published by Splunk, Abstract Security, Bitdefender and others, and each match says which source it came from. One honest caveat: plain access logs rarely record request bodies, so a clean access-log scan isn't an all-clear. The strongest signals need a WAF or ModSecurity log. And it flags attempts, not confirmed compromise.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it won't do
&lt;/h2&gt;

&lt;p&gt;It has no remote scan mode. Some PHP2Shell checkers probe a URL; I left that out on purpose, so you can't point it at a server you don't own, and running it is never itself an attack. If you want to check a server, run it on that server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php2shell-check harden
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;prints the upgrade commands for your OS. &lt;code&gt;harden --apply&lt;/code&gt; can also write a drop-in ini that disables &lt;code&gt;session.upload_progress&lt;/code&gt;, which blocks the known path but is only a partial mitigation. Patching is the real fix.&lt;/p&gt;

&lt;p&gt;Code, MIT licensed: &lt;a href="https://github.com/SirjanSingh/shiny-php" rel="noopener noreferrer"&gt;https://github.com/SirjanSingh/shiny-php&lt;/a&gt;&lt;br&gt;
PyPI: &lt;a href="https://pypi.org/project/php2shell-check/" rel="noopener noreferrer"&gt;https://pypi.org/project/php2shell-check/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the log indicators give you false positives, open an issue. That's the part I most want to get right.&lt;/p&gt;

</description>
      <category>php</category>
      <category>security</category>
      <category>python</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
