Garayed.com  

Go Back   Garayed.com > Linux
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-2007, 06:41 PM
Andy
 
Posts: n/a
Default apache cgi-scripts calling mail function, pstree ppid question

Hi folks
I've given myself a nice little exercise to help renovate
some very rusty basic C- skills.

Scenario:
one machine running apache with perl/cgi scripts and php
scripts calling the mail function. (qmail)
some of these scripts are being abused by spammers.

Goal: To play with qmail code so the X-headers show the uid
of the calling script's owner and the name of the script itself.
The plan is to traverse the pstree using
/proc/(pidno)/status to get ppids and prog names.
I realise I may have to move a way back up the tree to the
apache process and then back down thru that process to find
other processes it is running (including the calling script)...

....However: I have noticed when running pstree, I see

---httpd--mailer.cgi

and I see lots of
---qmail-inject --- qmail-queue

and so on, but I never see the tree showing the
mailer.cgi script or even its apache process as the parent
of the qmail-inject (or sendmail) progs.

What is the mechanism by which a php or perl script calls
the mail function without appearing as the mail function's
parent?

It is possible that someone could save me a lot of wasted
time and effort here. I like the challenge, but I'd like a
chance of at least partial success.

If a run a snapshot of the process table at the time the
mail is being inject, will I ever see any link between the
injction process and the "calling" script?


Thanks
ppl

Andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:19 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.