📄 ip-packet-shell.pl
字号:
#!/usr/bin/perl# IP-Packet -- The ultimative Packet Generator written in Perl## The Shell Version###################################################################### Last Update 31.03.2002 @ Easterhegg 2002 =)## Programmed by Bastian Ballmann [ bytebeater@crazydj.de ]# http://www.crazydj.de## Perl is phun!!! =)## This code is licensed under the GPL###[ Configuration Part ]### # We shall load a config fileif($load eq "y"){ print "Reading $configfile\n"; %config = config::readcfg("h",$configfile);$config{'flag'} = lc($config{'flag'});}# Manual configurationelse{###[ General Configuration ]###print "Give me a network device: ";$device = <STDIN>;chomp($device);$config{'device'} = $device;print "Tell me the protocol (tcp/udp/icmp): ";$protocol = <STDIN>;chomp $protocol;lc($protocol);$config{'protocol'} = $protocol;###[ Configuring IP ]###print "Tell me the source ip: ";$spoof = <STDIN>;chomp($spoof);$config{'spoof'} = $spoof;print "Tell me the destination ip: ";$target = <STDIN>;chomp($target);$config{'target'} = $target;print "Give me the fragmentation offset: ";$frag = <STDIN>;chomp $frag;$config{'frag'} = $frag;print "Time to live: ";$ttl = <STDIN>;chomp $ttl;$config{'ttl'} = $ttl;###[ Configuring ICMP ]###if($config{'protocol'} eq "icmp"){print "Tell me the ICMP-type: ";$icmp_type = <STDIN>;chomp $icmp_type;$config{'icmp-type'} = $icmp_type;print "Tell me the ICMP-code: ";$icmp_code = <STDIN>;chomp $icmp_code;$config{'icmp-code'} = $icmp_code;print "Give me the gateway: ";$gateway = <STDIN>;chomp $gateway;$config{'gateway'} = $gateway;print "Give me the MTU value: ";$mtu = <STDIN>;chomp $mtu;$config{'mtu'} = $mtu;}###[ Configuring TCP / UDP ]###else{print "Source port: ";$sport = <STDIN>;chomp($sport);$config{'src_port'} = $sport;print "Destination port: ";$tport = <STDIN>;chomp($tport);$config{'dst_port'} = $tport;###[ Configuring TCP only options ]### if($config{'protocol'} eq "tcp") { print "Tell me the Sequence number: "; $seqnum = <STDIN>; chomp($seqnum); $config{'seq'} = $seqnum; print "Tell me the Acknowledgement number: "; $acknum = <STDIN>; chomp($acknum); $config{'ack_seq'} = $acknum; print "Tell me the window size: "; $winsize = <STDIN>; chomp($winsize); $config{'win'} = $winsize; print "Give me the flags (0 == off, 1 == on).\n"; print "SYN: "; $syn = <STDIN>; chomp $syn; $config{'syn'} = $syn; print "ACK: "; $ack = <STDIN>; chomp $ack; $config{'ack'} = $ack; print "PSH: "; $psh = <STDIN>; chomp $psh; $config{'psh'} = $psh; print "RST: "; $rst = <STDIN>; chomp $rst; $config{'rst'} = $rst; print "FIN: "; $fin = <STDIN>; chomp $fin; $config{'fin'} = $fin; print "URG: "; $urg = <STDIN>; chomp $urg; $config{'urg'} = $urg; }}print "How much packets shall I send? ";$number = <STDIN>;chomp $number;$config{'number'} = $number;}# Print the configurationwhile(($key,$value) = each %config){print "$key -- $value\n";}# Send the packetsprint "Run packet! Run!!! =)\n\n";&run();print "\nAll done.\nHave phun! ;-D\n";1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -