And why don't you have 'root' access? And why do you want to do such a
thing when `netstat` works on both *NIX and Windows (XP and 2000 it does;
don't know about 98, ME, or the various versions of NT)?
I replied wrongly, again - sorry :-(
My question for the OP is this - what are you trying to acomplish? If you
want to keep tabs on the users to see if they're running some they
shouldn't be running, then `nmap` would be the simple solution.
If you want to monitor traffic to/from the user's box, then ethereal may
fit the bill.
It seems to me that there are tools available out there to perform such
tasks.
I love using Perl, but I don't like to re-invent the wheel if I don't have
to
HOWEVER, if you are trying to audit by stealth using Perl, then you may
want to look over IO::Socket. I don't think it will do *exactly* what you
want to do, but it may give you a solid starting place. It's not an easy
task to scan for open ports *without* connecting to them - at least
programmatically (meaning, write code to do it). You have to play around
with the TCP header information in such a way that the client will let you
know a port is open, but have it *not* register on the client as having a
connection.
If you're interested in a good book on the subject, try Skoudis's "Counter
Hack", which gives an in depth discussion on various techniques on doing
what you propose.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL.
http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
A citizen of America will cross the ocean to fight for democracy,
but won't cross the street to vote in a national election. --
Bill Vaughan