sudo apt-get install hping3
What is hping3?
hping3 is a network tool able toย sendย custom TCP/IP packets and display target replies like the ping program does with ICMP replies. hping3 handles fragmentation, arbitrary packets body, and size and can be used in order to transfer files encapsulated under supported protocols. Using hping3 you are able to perform at least the following stuff:
– Test firewall rules
– Advanced port scanning
– Test net performance usingย different protocols, packet size, TOS (type of service), and fragmentation.
– Path MTU discovery
– Transferring files between even really fascist firewall rules.
– Traceroute-like under different protocols.
– Firewalk-like usage.
– Remote OS fingerprinting.
– TCP/IP stack auditing.
– A lot of others.
Standard scan
First, we will see how to do a standard scan using hping3. For this, you need to type the following command in your terminal. This standard scan will send SYN packets to your target IP address
sudo hping3 -S 192.168.149.1

In the place of -S you could add
-L โsetack set TCP ack
-F โfin set FIN flag
-S โsynset SYN flag
-R โrst set RST flag
-P โpush set PUSH flag
-A โack set ACK flag
-U โurg set URG flag
-X โXmas set X unused flag (0x40)
-Y โymas set Y unused flag (0x80)
Port Scan
Every website must have open ports, so any open ports can be scanned by the hping3 tool to check vulnerability, but only the specified port can be scanned.
sudo hping3 -S 192.168.149.1 -p 80

-p for specifying the port
-S is SYN, (You could enter any protocol you want as I mentioned in the Standard scan)
Number of Packets
With this hping3 tool, we can control the packets that can be sent to an IP address.
sudo hping3 -S 192.168.149.1 -p 80 -c 5

-S SYN flag
-p Specify the port
-c No of packets to send
Send TCP Packets
If you want to send TCPย packetsย to your target then run the following command in your terminal.
sudo hping3 192.168.149.1
Raw IP
Now, Letโs send raw IP through the network with the below commands
sudo hping3 -0 192.168.149.1
Other commands
#ICMP
sudo hping3 -1 192.168.149.1
#UDP
sudo hping3 -2 192.168.149.1
#Between port scan
sudo hping3 -8 1-30 -A 192.168.149.1
#Listen
sudo hping3 -9 192.169.149.1
#Verbose
sudo hping3 -2 192.169.149.1 -V
#sequesnce number
sudo hping3 192.168.1.103 -Q -p 139
#Firewall
sudo hping3 -S 72.14.207.99 -p 80 --tcp-timestamp
#Subnet
sudo hping3 -1 10.0.1.x --rand-dest โI eth0
#HTTP
sudo hping3 -9 HTTP -I eth0
#SYN Flood
sudo hping3 -S 192.168.1.1 -a 192.168.1.254 -p 22 --flood
I hope this post was very helpful to you and I want to share this post with your friends too, you can ask me through the command section if you have any doubts about this post.