<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Control WebPanel Wiki &#187; Track Infected scripts</title>
	<atom:link href="https://wiki.centos-webpanel.com/tag/track-infected-scripts/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Track SPAM infected scripts</title>
		<link>https://wiki.centos-webpanel.com/track-spam-infected-scripts</link>
		<comments>https://wiki.centos-webpanel.com/track-spam-infected-scripts#comments</comments>
		<pubDate>Fri, 03 Jul 2015 23:59:06 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Track Infected scripts]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=343</guid>
		<description><![CDATA[All this tools can help you to track spam and infected scripts but experienced admin assistance is always needed. Check this for tracking setup by using headers Using maldet (Malware scanner) Update Maldet maldet -u Scan public_html folder of infected user account maldet -a /home/USERNAME/public_html Using ClamAV (Clam Antivirus) clamscan -r /home/USERNAME/public_html &#124; grep FOUND [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>All this tools can help you to track spam and infected scripts but experienced admin assistance is always needed.</p>
<p><a href="/tracking-php-script-spam" title="Track Spam in PHP by using headers" target="_blank"><br />
Check this for tracking setup by using headers</a></p>
<p><strong>Using maldet (Malware scanner)</strong></p>
<p>Update Maldet</p>
<pre>maldet -u </pre>
<p>Scan public_html folder of infected user account</p>
<pre>maldet -a /home/USERNAME/public_html</pre>
<p><strong>Using ClamAV (Clam Antivirus)</strong></p>
<pre>clamscan -r /home/USERNAME/public_html | grep FOUND</pre>
<p>If you have noticed that spamming started today then you can search files modified in eg. last two days</p>
<pre>find /home/USERNAME/public_html -ctime -2 -name "*.php"</pre>
<p><strong>Injected encoded upload code</strong><br />
Mostly hackers inject encoded part of php code in your website files so that they could always spam from your account/server.<br />
Check for encoded part of code mostly added as a first line in each file</p>
<pre>grep -nr strtoupper /home/USERNAME/public_html |grep eval</pre>
<p>or</p>
<pre>for i in `find /home/USERNAME/public_html/ -name "*.php"`;do head -n 1 $i|grep "eval" &#038;& echo $i;done</pre>
<p>Get only filenames</p>
<pre>grep -nr strtoupper /home/USERNAME/public_html|grep eval|awk -F: {'print $1'}</pre>
<p>Don't forget that you can also check apache logs in folder<br />
/usr/local/apache/logs/</p>
<p><strong>How to remove hackers symlink files</strong></p>
<pre>find /home/USERNAME/public_html -name "*.php" -type l -exec unlink {} \;</pre>
<p><strong>Find all files modified between 2015-12-19 - 2015-12-20</strong></p>
<pre>find . -name "*.php" -newermt 2015-12-19 ! -newermt 2015-12-20 -type f</pre>
<div class="st-alert st-alert- ">Don't forget to install mod security with automatic update of rules within you CWP to prevent any further hacking of your sites.</div>
<p>Other useful scripts for spam tracking</p>
<pre>
find . -type f -name '*.php' -print | xargs grep -i x29
find . -type f -name '*.php' -print | xargs grep -i x29|awk -F: {'print $1'}
find . -type f -name '*.php' -print | xargs grep -E '[0-9a-zA-Z/]{80}'
find . -type f -name '*.php' -print | xargs grep -E '[0-9a-zA-Z/]{80}'|awk -F: {'print $1'}</pre>
<p><strong>PHP Mail Log</strong> (sent from php scripts)</p>
<pre>/usr/local/apache/logs/phpmail.log</pre>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/track-spam-infected-scripts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
