Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling All Programmers!!

Status
Not open for further replies.

FinnMan

Technical User
Feb 20, 2001
75
0
0
US
Before I dive into the technical request, allow me to give a brief intro. My name is Jon. I work for a "MAJOR" ISP as a Network Security Engineer. When I say major I mean we do hosting (as well as other things) on a global basis. It has recently come to our attention that one of facilities computer systems was compromised. The ramifications of this compromise could have been detrimental to a lot of US businesses were we not able to contain the situation. We suspect problems originated in China. This situation has spawned an immediate audit of one of our Class A networks. Most of this audit is in progress as I type. A part of this audit inlcudes a webserver audit. I'm talking about hundreds and hundreds of webservers. Now for the Perl part :)

The absolute best utility I've found for webserver audits is a program called T Unfortunately, this program only accepts scanning one host address at a time. What I'm attempting to undertake is some perl that will read from a host list and feed the info to T & cosolidate T output. My PERL knowledge is not sufficent but the small projects I've done tell me that undoubtedly perl is the way to go. Essentially I need this:

1. Launch t2. Pull an IP from a list, pass it to t with required parameters.
3. When t ends, run it again passing it a new IP.
4. Consolidate each output from t (an html file is it's output).

I've been able to work steps 1 & 2 with out difficulty. But being a novice, I'm choking up on steps 3 & 4. How do I determine, using perl, when the original session has ended?

Any and all assistance would be greatly appreciated.
Best Regards
JLK
 
that's a pretty ominous opening paragraph...

well, try opening a pipe. if you can pass all the needed arguments in a single call to the program, that would be simplest; otherwise, you'll need to open a bi-directional pipe. here's what the simpler will look like:[tt]
open PIPE, "prog arg1 arg2 |" or die "pipe failed: $!";
while (<PIPE>)
{
#now the output will come in a line at a time
#you can process it into your html, or save it in a log
#or whatever. the loop will end when the program has
#finished, so if this is inside the 'foreach (@servers)'
#loop, it'll call the program for each server, then
#continue in this until the program is finished
}[/tt]

if you do need to send the program input data after it's already open, you'll need to do a bi-directional. ask again if this is what you need. &quot;If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito.&quot;
 
I think that's what I needed. I'm going to chomp on this for a few hours and see what it does for me. If that doesn't work I'll post my full code and let everyone see where I'm falling off at...

Thx a bunch!

JLK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top