{"id":16,"date":"2019-09-17T16:57:05","date_gmt":"2019-09-17T16:57:05","guid":{"rendered":"https:\/\/www.resellerslot.com\/blog\/2019\/09\/17\/how-to-diagnoseinvestigate-php-spam-sender-user-in-linux-cpanel\/"},"modified":"2019-09-17T23:31:51","modified_gmt":"2019-09-17T23:31:51","slug":"find-php-spam-sender-linux-cpanel","status":"publish","type":"post","link":"https:\/\/www.resellerslot.com\/blog\/find-php-spam-sender-linux-cpanel\/","title":{"rendered":"How to diagnose\/investigate php spam sender user in Linux \/ cpanel?"},"content":{"rendered":"<p><img decoding=\"async\" style=\"font-size: 1rem;\" src=\"https:\/\/www.resellerslot.com\/upload\/services\/thumbs\/88303_how-to-diagnose-investigate-php-spam-sender-user-in-linux-cpanel.jpg\" alt=\"How to diagnose\/investigate php spam sender user in Linux \/ cpanel?\"><\/p>\n<p><!-- Favicon --><\/p>\n<p><!-- this styles only adds some repairs on idevices  --><\/p>\n<p><!-- Google fonts - witch you want to use - (rest you can just remove) --><\/p>\n<p><!-- responsive devices styles --><\/p>\n<p><!-- jquery jcarousel --><\/p>\n<p><!-- REVOLUTION SLIDER --><\/p>\n<div class=\"site_wrapper\">\n<div class=\"container\">\n<div class=\"content_left\">\n<div class=\"blog_post\">\n<div class=\"blog_postcontent\">\n<div class=\"post_info_content\" style=\"margin: 10px 0px;\">\n<p>Spamming is one of the main cause of spread malware and virus on others system or website via emails. All those spammers who have to attack or spam collect email addresses from chat rooms, websites, customer lists, newsgroups, and so on. Spammers most use spamming for sold out some viruses, illegal or banned products and many other things or may also use for marketing of some product. Spammers can use your hosting and email server to send such type of emails to their targeted audience or anyone. In this article we will properly guide you how to diagnose\/investigate php spam sender user in Linux \/ cpanel?<\/p>\n<p>To investigate spamming first of all you have to check how many emails are in queue, If you are found that a lot of emails are in queues (over one hundred views), it may because of spamming. Here are some steps to check the queued emails on your WHM Account.<\/p>\n<p><strong>Step:- 1<\/strong> First of all you have to Login in to your WHM account<\/p>\n<p><strong>Step:- 2<\/strong> Click on Email icon from menu:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" title=\"\" src=\"https:\/\/www.resellerslot.com\/images\/whm_email.jpg\" alt=\"\" border=\"0px\"><\/p>\n<p>To check the emails in Queue you have to click on Mail Queue Manager icon to check emails in Queue<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" title=\"\" src=\"https:\/\/www.resellerslot.com\/images\/whm_email_queue.jpg\" alt=\"\" border=\"0px\"><\/p>\n<p><strong>Step:- 3<\/strong> You can view maximum 100 emails at a time, High numbers of emails indicates the auto responding (Spamming). So you can delete all emails through here.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" title=\"\" src=\"https:\/\/www.resellerslot.com\/images\/whm_email_queue_manage.jpg\" alt=\"\" border=\"0px\"><\/p>\n<p style=\"text-align: center;\"><strong>Note:<\/strong> If you will click on Delete all some legale and good queued emails for you and your clients will also delete.<\/p>\n<p>Now we will tell you how to investigate or find exact spammer script location on your WHM via SSH in following directory:<\/p>\n<p><span style=\"font-weight: bold;\">\/var\/log\/exim_mainlog<\/span><\/p>\n<p>You just need to follow some given steps below to find the exact location of spammer script on your Server.<\/p>\n<p><strong>Step:- 1<\/strong> First of all you have to Login in to your server via SSH<\/p>\n<p><strong>Step:- 2<\/strong> To investigate or find the exact locations of all script&#8217;s running on your server, you have to write following script on you SSH<\/p>\n<p style=\"text-align: center; background: black;\"><span style=\"color: #ffffff;\">grep cwd \/var\/log\/exim_mainlog | grep -v \/var\/spool | awk -F&#8221;cwd=&#8221; &#8216;{print $2}&#8217; | awk &#8216;{print $1}&#8217; | sort | uniq -c | sort -n<\/span><\/p>\n<p>In response of your script (command) SSH will return you following things:<\/p>\n<p style=\"text-align: center; background: black;\"><span style=\"color: #ffffff;\">15 \/home\/userna5\/public_html\/about-us <\/span><\/p>\n<p>25 \/home\/userna5\/public_html<\/p>\n<p>7866 \/home\/userna5\/public_html\/data<\/p>\n<p><strong>Step:- 3<\/strong> In above we found that <span style=\"font-weight: bold;\">\/home\/userna5\/public_html\/data<\/span>. This is the exact location to investigate all user data. To investigate this you have to enter following command:<\/p>\n<p style=\"text-align: center; background: black; color: white;\">ls -lahtr \/userna5\/public_html\/data<\/p>\n<p>In case of this we got following from SSH<\/p>\n<p style=\"text-align: center; background: black; color: white;\">drwxr-xr-x 17 userna5 userna5 6.0K Dec 15 09:25 ..\/<\/p>\n<p>-rw-r&#8211;r&#8211; 1 userna5 userna5 7.9K Dec 15 09:26 mailer.php<\/p>\n<p>drwxr-xr-x 2 userna5 userna5 6.0K Dec 15 09:27 .\/<\/p>\n<p>Here we found the exact name of the script running on our server which is mailer.php in this case.<\/p>\n<p><strong>Step:- 4<\/strong> You can also investigate the exact IPs accessing this script on your server through Apache access log. You have to right following command<\/p>\n<p style=\"text-align: center; background: black; color: white;\">grep &#8220;mailer.php&#8221; \/home\/userna5\/access-logs\/example.com | awk &#8216;{print $1}&#8217; | sort -n | uniq -c | sort -n<\/p>\n<p>After this command we will get the list of IPs<\/p>\n<p style=\"text-align: center; background: black; color: white;\">2 192.168.1.1<\/p>\n<p>2 192.168.1.2<\/p>\n<p>2 192.168.1.3<\/p>\n<p>7860 2 192.168.10.10<\/p>\n<p>Here IP with 7860 indicate the IP of spammer who belongs to mailer.php or spam script. you can block or delete this IP to stop more spamming through your server or for further access by running following command<\/p>\n<p style=\"text-align: center; background: black; color: white;\">apf -d 192.168.10.10 &#8220;Spamming from script in \/home\/userna5\/public_html\/data&#8221;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spamming is one of the main cause of spread malware and virus on others system or website via emails. All those spammers who have to attack or spam collect email addresses from chat rooms, websites, customer lists, newsgroups, and so on. Spammers most use spamming for sold out some viruses, illegal or banned products and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-hosting"],"_links":{"self":[{"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":3,"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions\/148"}],"wp:attachment":[{"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.resellerslot.com\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}