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.
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)
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
Now, Let’s send raw IP through the network with the below commands
sudo hping3 -0 192.168.149.1
#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 18.104.22.168 #Verbose sudo hping3 -2 22.214.171.124 -V #sequesnce number sudo hping3 192.168.1.103 -Q -p 139 #Firewall sudo hping3 -S 126.96.36.199 -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.