sending icmp packets with raw::ip

L

lucas

okay, i'm having trouble mimiking proper icmp packets, so here with hping2 i
send a proper packet:
hping2 -1 -C 11 -K 0 nexuss -c 1

and from tcpdump:
17:36:47.213148 IP (tos 0x0, ttl 64, id 15954, offset 0, flags [none],
length: 56) 192.168.0.2 > 192.168.0.1: icmp 36: time exceeded in-transit

and my perl code to do the same:
my $a = new Net::RawIP ({icmp =>{}});
$a->set({
ip => { saddr => $saddr, daddr => $daddr, protocol => 1, tos => 0,
id => $$},
icmp => {type => $type, code => $code, id => $$, sequence => $seq}
});
$a->send(1,1);

taken from tcpdump:
17:42:13.741040 IP (tos 0x0, ttl 64, id 8408, offset 0, flags [DF], length:
28) 192.168.0.2 > 192.168.0.1: [|icmp]

i figure that tcpdump isn't recognizing it becuase i missed an option in the
packet somewhere. can anybody help me with this?

thx,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top