Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: my first packet sniffer in perl

by jwkrahn (Abbot)
on Jun 29, 2009 at 14:56 UTC ( [id://775703]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # extract the source IP addr into dotted quad form
    my($source) = sprintf("%d.%d.%d.%d",
    ...
            ord( substr($packet, $dst_ip+3, 1) ));
    #the above part is directly taken from "hacking linux exposed" (sorry 
    +but couldn't figure out this part)
    
  2. or download this
    use Socket;
    # extract the source IP addr into dotted quad form
    ...
    # extract the destination IP addr into dotted quad form
    my $destination = inet_ntoa substr $packet, $dst_ip, 4;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://775703]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-23 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found