2

I have a task on which I have spent a lot of time. I am not fluent in Linux, but I can manage basic things.

The task is to gather different types of ICMP packets. I can harvest them by tcpdump (which I prefer) or Wireshark.

I am able get the ICMP types of echo reply and echo request using ping, and time exceeded using tracepath or traceroute. Now, what I am trying to get is unreachable or timestamp or something else. I need two more types, however I don't know a way to produce.

I have tried pinging a nonexistent host or wrong port, and using tracepath the same way, but I am not getting anything.

Can someone advise me or tell me what commands I can use, and in which way, to obtain two more types of ICMP packets?

2

You can generate some of the ICMP unreachable variants with qualifiers to iptables ... -j REJECT on a separate target host. (Or a VM.) The possible qualifiers are icmp-net-unreachable, icmp-host-unreachable, icmp-port-unreachable, icmp-proto-unreachable, icmp-net-prohibited, icmp-host-prohibited, icmp-admin-prohibited, and tcp-reset.

For example:

iptables -j REJECT --reject-with icmp-admin-prohibited
2

icmpush does what you need.

From man icmpush:

icmpush is a tool that builds ICMP packets fully customized from command line.

It supports the following ICMP error types: Redirect, Source Quench, Time Exceeded, Destination Unreach and Parameter Problem.

And the following ICMP information types: Address Mask Request, Timestamp, Information Request, Echo Request, Router Solicitation and Router Advertisement.

icmpush is licensed as GPLv2, is available packaged for debian (and probaly most other distros), and source code is available at http://www.securityfocus.com/data/tools/icmpush22.tar.gz

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.