MiniHping is a lightweight packet crafting and sending utility written in C#.
It provides functionality similar to hping, but implemented for .NET environments, focusing on ICMP echo requests (ping) and basic packet manipulation.
- Send ICMPv4 echo requests (ping) with customizable options
- Capture and parse ICMP replies
- Adjustable packet size, count, and interval
- Modular design:
PacketSender.cs→ handles raw packet sendingPacketReceiver.cs→ listens for responsesNetworkManager.cs→ network-level configurationHpingService.cs→ core service integrating sender/receiverOptions.cs→ command-line arguments and optionsProgram.cs→ entry point with CLI parsing
dotnet builddotnet run -- --mode icmp --dst 8.8.8.8 --count 4dotnet run -- --mode tcp --dst 8.8.8.8 --port 80 --syn --count 3🚀 Starting ICMP packet transmission...
Press Ctrl+C to stop
📤 ICMP 8.8.8.8: id=1 seq=1 ttl=64
📤 ICMP 8.8.8.8: id=2 seq=2 ttl=64
📤 ICMP 8.8.8.8: id=3 seq=3 ttl=64
📤 ICMP 8.8.8.8: id=4 seq=4 ttl=64
📊 --- 8.8.8.8 hping statistics ---
📤 4 packets transmitted
📥 0 packets received
📉 100.0% packet loss
⏱️ Total time: 6.0s| Option | Description |
|---|---|
-m, --mode |
Protocol mode: tcp, icmp (default: tcp) |
--dst |
Target host or IP address (required) |
-i, --iface |
Network interface index (0, 1, 2, …) |
-c, --count |
Number of packets to send (-1 = unlimited, default) |
-p, --port |
Target port (TCP mode only, default: 80) |
-S, --syn |
Set TCP SYN flag (TCP mode only) |
-t, --interval |
Interval between packets in milliseconds (default: 1000) |
-v, --verbose |
Verbose output |
MiniHping/
├── HpingService.cs # Core service logic
├── NetworkManager.cs # Network setup
├── Options.cs # Command-line options
├── PacketReceiver.cs # ICMP response handler
├── PacketSender.cs # Packet sending logic
├── Program.cs # Entry point
└── MiniHping.csproj # Project file- .NET 8.0 SDK
- Windows or Linux with raw socket support
- Administrator/root privileges may be required