Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    May 2006
    Posts
    272
    cPanel/Enkompass Access Level

    Root Administrator

    Default Possible to track down an exploited formmail script?

    Sometime this afternoon exim crashed briefly due to getting slammed with over a thousand spam messages at once. It would appear that someone has found an exploitable formmail script (or other php script) and used it to send spam.

    Is there any way for me to track down where the security breach happened and what script on the server was exploited?

    I'm running:
    WHM 10.8.0 cPanel 10.8.2-R119
    RedHat Enterprise 3 i686 - WHM X v3.1.0
    PHP 4.4.2
    mod_security 1.9.3
    Mailscanner 2.38

    Thanks for any advice!

  2. #2
    Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    675

    Default

    Yes, as long as you have exim extended logging enabled. Check your /var/log/exim_mainlog and see what messages went out. Your mail queue will also probably be full of messages backed up that bounced, etc.

    Once you have this you just get the ID of an email and grep it in the log.
    Upload Guardian 2.0 - Sign up for our early beta
    ServerProgress - Server security, consulting and assistance

  3. #3
    Member
    Join Date
    May 2006
    Posts
    272
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Thank you for the response. I'm not extremely comman-line savvy, so I'm currently studying http://www.pegasus.rutgers.edu/~elflord/unix/grep.html to see if I can teach myself what you mean.

  4. #4
    Member
    Join Date
    Mar 2002
    Posts
    150

    Default

    You can find formmail using this:


    find /home/*/public_html/cgi-bin -name '*orm*ail.pl' > list.txt

  5. #5
    Member
    Join Date
    May 2006
    Posts
    272
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Thanks,

    I did find TONS of these all at the date/time of my exim crash in the /var/logs/exim_mainlog (X's replace my hostname and customer account name):

    2006-06-06 13:46:41 1FngZd-00051a-0A <= nobody@xxxxxx.xxxxxxxxxxxx.net U=nobody P=local S=8220

    2006-06-06 13:46:41 cwd=/home/xxxxxxx/public_html/resources/product_images 3 args: /usr/sbin/sendmail -t -i

    So now at least I can tell which customer account on the box got exploited.

    This customer has a type of photo gallery script (not a common one) and it of course has a built-in form for support mail etc... and from what I can tell the spammer is using that to exploit.

    Now the million dollar question - is there anything I can do to secure this problem? (outside of shutting down the customer's site, which I wish not to do as they're an innocent victim here).

  6. #6
    Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    675

    Default

    Review the mail scripts in the directory here:
    /home/xxxxxxx/public_html/resources/product_images

    write mod_security rules for it or have the programmer modify their script.
    Upload Guardian 2.0 - Sign up for our early beta
    ServerProgress - Server security, consulting and assistance

Similar Threads & Tags
Similar threads

  1. how can i install formmail.log to track spam?
    By meeti in forum New User Questions
    Replies: 1
    Last Post: 05-16-2008, 06:11 PM
  2. cpanel formmail being exploited
    By forlinuxsupport in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-14-2008, 05:47 AM
  3. How to find which script has been exploited by spammer?
    By Jeff75 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-09-2006, 04:18 AM
  4. How to track down spam script?
    By celliott in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-07-2006, 10:07 AM
  5. PHP FormMail Exploited
    By metal_cd in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-18-2005, 01:24 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube