LinuxCommandLibrary

impacket-ping

Ping hosts using Windows protocols

TLDR

View documentation for the original command

$ tldr ping.py
copy

SYNOPSIS

impacket-ping [-h] [-ip ip address] [-timeout timeout] [-count number of pings] [-src SOURCE] destination

PARAMETERS

-h
    Display help message and exit.

-ip ip address
    Set the source IP address for the ICMP Echo Request. Defaults to the system's IP address if not specified.

-timeout timeout
    Set the timeout in seconds for receiving a response. Defaults to a reasonable value (e.g., 2 seconds).

-count number of pings
    Specify the number of ICMP Echo Requests to send. Defaults to 4 if not specified.

-src SOURCE
    Specify the source address.

destination
    The target host or IP address to ping.

DESCRIPTION

impacket-ping is a Python script leveraging the Impacket library to send ICMP (Internet Control Message Protocol) Echo Request packets, effectively performing a ping. Unlike the standard ping utility that relies on system calls and underlying OS networking functions, impacket-ping creates and manipulates packets at a lower level using the Impacket library's network protocol implementation.

This offers more control over packet construction and allows for customization of fields like source IP address, sequence numbers, and timestamps. It can be useful for network diagnostics, troubleshooting, and security testing, especially in environments where granular packet manipulation is needed.

impacket-ping is platform-independent, as it's written in Python and relies on the Impacket library, reducing dependence on OS-specific ping implementations. It's also useful in scenarios where traditional ping might be blocked or filtered.

PACKET CRAFTING CAPABILITIES

One of the primary advantages of impacket-ping is its ability to finely control the ICMP packets being sent. While the basic functionality mimics the standard ping, Impacket opens up the possibility to add custom data to the packet, alter TTL values, or perform other manipulations that the standard ping utility might not readily allow. This makes it useful for probing network behavior and testing firewalls.

USAGE SCENARIOS

impacket-ping can be used in a variety of scenarios. These include:

  • Network Troubleshooting: Diagnosing network connectivity issues where standard ping might be insufficient.
  • Security Auditing: Testing firewall rules and intrusion detection systems.
  • Education: Demonstrating the inner workings of ICMP and network protocols.
  • Circumventing restrictions: Avoiding basic ping detection mechanism.

SEE ALSO

ping(8), hping3(8), tcpdump(1)

Copied to clipboard