Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default How do you tell who is sending mail when it's sent from nobody

    I have some spams sent from my server but the sender only says nobody. Anyone know how to track the email to the user who sent it?

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2008
    Location
    Detroit, MI
    Posts
    27
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by DWHS.net View Post
    I have some spams sent from my server but the sender only says nobody. Anyone know how to track the email to the user who sent it?
    Make sure you have WHM -> Server Config -> Tweak Settings -> Mail -> "Track the origin of messages sent though the mail server by adding the X-Source headers (exim 4.34+ required)" enabled. That may help track down the source.

    You may also want to add a line to your Exim Advanced Config. This goes in the first box :

    log_selector = +arguments +subject

    That will place the subject in the mail log (making it easier to search for the spam in your logs), and the arguments will let you know how it is being generated (sendmail, php script, etc,).

    Hope this helps!
    Last edited by acenetgeorge; 07-09-2009 at 07:37 AM.

  3. #3
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Quote Originally Posted by DWHS.net View Post
    I have some spams sent from my server but the sender only says nobody. Anyone know how to track the email to the user who sent it?
    It is not very easy to track and though you could add the items
    acenetgeorge listed above, you are still limited as long as the
    mail is being sent from script as the generic user "nobody".

    You should already be running SuExec for Apache. If not, I would enable it!

    This topic is also one one of the biggest reasons to convert your PHP from
    norm Apache module (DSO) to SuPHP as all PHP scripts will then be
    executed by the account owner instead of the generic user nobody and
    if anyone tries to send any spam, it will show up in a heartbeat which
    account sent the mail and what script and is much easier to track!

    Using SuPHP for your PHP also gives you many other important advantages
    in terms of added security that go beyond just email tracking so it is
    definitely something you should strongly consider.

    Meanwhile, if you set sending limits in "Tweak Settings" and either use
    the "SMTP Tweak" or much better install Chirpy's CSF Firewall and setup
    the SMTP_BLOCK portion in that script, that will also help control spam
    from being sent from your server as well.

    Right now, without the expanded logging trails or having SuExec or SuPHP
    running or a good security solution, the only thing you can really do to
    track the current mail already sent is to take a close look at the domain
    logs in /usr/local/apache/domlogs, the main apache logs in /usr/local/apache/logs,
    your maillog in /var/log, and the files in your /tmp folder to determine which site
    is getting calls to execute a mail script around the same time the mails are
    being injected into the mail server. Bulk sending a lot of messages often
    shows up as repeated web calls to some script on an account on your server.

    Now once you make the changes both acenetgeorge and I have suggested,
    it will be much easier to track where the spam is coming from and if you do
    all that I said, will also be much more difficult for anyone to send spam in
    the first place but if they do, will definitely get caught.
    Last edited by Spiral; 07-09-2009 at 07:19 PM.

  4. #4
    cPanel Verified Vendor This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Sep 2007
    Posts
    96

    Default

    If you don't have log_selector = all and you don't see a file path for these mails. You really should just do a clamscan of all your public_html's.


    for i in /home/*/www ; do clamscan -ri -l /some/log "$i" ; done

    Or search the forums here there are also malware grep search scripts etc.

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default

    Quote Originally Posted by Spiral View Post
    It is not very easy to track and though you could add the items
    acenetgeorge listed above, you are still limited as long as the
    mail is being sent from script as the generic user "nobody".

    You should already be running SuExec for Apache. If not, I would enable it!

    This topic is also one one of the biggest reasons to convert your PHP from
    norm Apache module (DSO) to SuPHP as all PHP scripts will then be
    executed by the account owner instead of the generic user nobody and
    if anyone tries to send any spam, it will show up in a heartbeat which
    account sent the mail and what script and is much easier to track!

    Using SuPHP for your PHP also gives you many other important advantages
    in terms of added security that go beyond just email tracking so it is
    definitely something you should strongly consider.

    Meanwhile, if you set sending limits in "Tweak Settings" and either use
    the "SMTP Tweak" or much better install Chirpy's CSF Firewall and setup
    the SMTP_BLOCK portion in that script, that will also help control spam
    from being sent from your server as well.

    Right now, without the expanded logging trails or having SuExec or SuPHP
    running or a good security solution, the only thing you can really do to
    track the current mail already sent is to take a close look at the domain
    logs in /usr/local/apache/domlogs, the main apache logs in /usr/local/apache/logs,
    your maillog in /var/log, and the files in your /tmp folder to determine which site
    is getting calls to execute a mail script around the same time the mails are
    being injected into the mail server. Bulk sending a lot of messages often
    shows up as repeated web calls to some script on an account on your server.

    Now once you make the changes both acenetgeorge and I have suggested,
    it will be much easier to track where the spam is coming from and if you do
    all that I said, will also be much more difficult for anyone to send spam in
    the first place but if they do, will definitely get caught.
    Oh cool so if I use SuPHP it will show the user when email is sent through php through servers mail system. Rather then just "nobody".

  6. #6
    Member
    Join Date
    May 2009
    Posts
    6

    Default

    Edit /etc/exim.conf

    log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +dnslist_defer +incoming_interface +incoming_port +lost_incoming_connection +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn \

    If exim_mainlog shows the spams originating from /tmp of the server and check the file in /tmp of the server. wner of the file will be seen as nobody:nobody. Take down the time of creation of file. This time is what we need to find out who uploaded the script. You will need to convert this time into the time format of /usr/local/apache/logs/error_log & then in the format of the domlogs located at /usr/local/apache/domlogs/*



    for file in /usr/local/apache/domlogs/*; do cat $file |grep “example”; done; ( you cannot do direct grep for the query here as it will give error that the arguement list is too long )

    Supportpro.com

Similar Threads & Tags
Similar threads

  1. Mail server keeps sending mail with cpanel account prefix
    By webmonkey in forum E-mail Discussions
    Replies: 2
    Last Post: 09-06-2010, 03:38 PM
  2. ConfigServer Mail Queues PENDING QUEUE not sending E-Mail
    By Techno in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-16-2008, 10:47 PM
  3. Replies: 7
    Last Post: 11-01-2006, 01:15 AM
  4. Pop Email Not Receiving Mail or Sending Mail
    By demine0 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-14-2006, 10:53 AM
  5. Stop Spam Assasin sending you mail for each mail it stopps
    By Hedloff in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-05-2005, 08:08 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube