Skip to main content

Find scripts responsible for sending out spam

Comments

6 comments

  • dmacomber
    In my case I had to edit /home/"TheSite"/public_html/php.ini The next question after deleting the malicious script is to find out how it got there and what to do when it keeps coming back.
    0
  • CraftyPanda
    In my case I had to edit /home/"TheSite"/public_html/php.ini The next question after deleting the malicious script is to find out how it got there and what to do when it keeps coming back.

    Hi Dmacomber, So just to be clear, do you create a blank php.ini file in the clients public html folder with only the lines mail.add_x_header = On mail.log = /var/log/phpmail.log ?
    0
  • cPanelMichael
    Hello, Individual php.ini files are only acceptable if you are using suPHP. In those cases, the global php.ini still works unless you already have an individual php.ini in the account. Since you don't already have one, it's not going to resolve your issue. You can try using a command like this one to track down the source of SPAM:
    awk '/cwd=\/home\// {print $3}' /var/log/exim_mainlog|sort|uniq -c|sort -n
    Thank you.
    0
  • dmacomber
    CrazyPanda, Again, in my case, here is my /home/domain/public_html/php.ini file
    ..... [/home/.../public_html]# cat php.ini register_globals = Off extension=pdo.so extension=pdo_mysql.so mail.add_x_header = On mail.log = /var/log/phpmail.log
    0
  • CraftyPanda
    Hello, Individual php.ini files are only acceptable if you are using suPHP. In those cases, the global php.ini still works unless you already have an individual php.ini in the account. Since you don't already have one, it's not going to resolve your issue. You can try using a command like this one to track down the source of SPAM:
    awk '/cwd=\/home\// {print $3}' /var/log/exim_mainlog|sort|uniq -c|sort -n
    Thank you.

    Hi Michael, Thank you for this information. So i ran the command and its listed various account paths, one of which was the accounts sending out spam, i deleted the folder and the spam seems to have stopped, so thank you for that. Please can yuo tell me what this command is actually outputting? Suspicious file paths? scripts that are sending mail right now? Thanks again Andy
    0
  • cPanelMichael
    The command checks /var/log/exim_mainlog for the paths of scripts in the /home directory that are sending emails, and then sorts them from highest to lowest, based on the number of emails found in the log from that path. Thank you.
    0

Please sign in to leave a comment.