Hping2.

Slides:



Advertisements
Similar presentations
Overview The TCP/IP Stack. The Link Layer (L2). The Network Layer (L3). The Transport Layer (L4). Port scanning & OS/App detection techniques. Evasion.
Advertisements

Network and Application Attacks Contributed by- Chandra Prakash Suryawanshi CISSP, CEH, SANS-GSEC, CISA, ISO 27001LI, BS 25999LA, ERM (ISB) June 2006.
COEN 252 Computer Forensics Using TCPDump / Windump for package analysis.
NMAP Scanning Options. EC-Council NMAP  Nmap is the most popular scanning tool used on the Internet.  Cretead by Fyodar ( it.
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning.
1 The Attack and Defense of Computers Dr. 許 富 皓. 2 Port Scanning.
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning Last updated
Penetration Testing-Wk5 Last Week nmap – scan hosts – footprint find open ports running services determine OS.
Hacking Exposed 7 Network Security Secrets & Solutions Chapter 2 Scanning 1.
CSCI 4550/8556 Computer Networks Comer, Chapter 23: An Error Reporting Mechanism (ICMP)
Tcpdump Traceroute Ping. A packet tracing tool  Works on various host platforms  Captures packets going through a certain network interface  Shows.
CPSC 441 Tutorial - Network Tools 1 Network Tools CPSC 441 – Computer Communications Tutorial.
Scanning February 23, 2010 MIS 4600 – MBA © Abdou Illia.
TCP/IP Network and Firewall. IP Packet Protocol  1 ICMP packet  6 TCP packet  17 UDP packet.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Internet Control Message Protocol (ICMP) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
ECE Prof. John A. Copeland fax Office: Klaus 3362.
CIS 193A – Lesson12 Monitoring Tools. CIS 193A – Lesson12 Focus Question What are the common ways of specifying network packets used in tcpdump, wireshark,
CPSC 441 TUTORIAL – MARCH 7, 2012 TA: MARYAM ELAHI NETWORK TOOLS.
Linux Networking Commands
Port Scanning.
1 ICMP : Internet Control Message Protocol Computer Network System Sirak Kaewjamnong.
CCNA Introduction to Networking 5.0 Rick Graziani Cabrillo College
Björn Landfeldt School of Information Technologies NETS 3303 ICMP and applications.
CS 6401 Internet Protocol Outline Introduction to Internet Protocol Header and address formats ICMP Tools.
Internet Control Message Protocol ICMP. ICMP has two major purposes: –To report erroneous conditions –To diagnose network problems ICMP has two major.
Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Control Message Protocol ICMP author -- J. Postel, September The purpose.
Guide to TCP/IP, Third Edition
Network Administration
SCSC 555 Frank Li.  Port scanning  Port-scanning tools  Ping sweeps 2.
Problem Statement Map of OSU Routers Gopi Krishna Tummala Rupam Kundu Graduate Students The Ohio State University.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Internet Control Message Protocol (ICMP) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
ICMP : Internet Control Message Protocol. Introduction ICMP is often considered part of the IP layer. It communicates error messages and other conditions.
1 IP: putting it all together Part 2 G53ACC Chris Greenhalgh.
POSTECH DP&NM Lab. Internet Traffic Monitoring and Analysis: Methods and Applications (1) 4. Active Monitoring Techniques.
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 ICMP: A helper protocol to IP The Internet Control Message Protocol (ICMP) is the protocol used for error.
1 Internet Control Message Protocol (ICMP) Used to send error and control messages. It is a necessary part of the TCP/IP suite. It is above the IP module.
Chapter 2 Scanning Last modified Determining If The System Is Alive.
ICMP (Internet Control Message Protocol) w.lilakiatsakun.
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
Scanning & Enumeration Lab 3 Once attacker knows who to attack, and knows some of what is there (e.g. DNS servers, mail servers, etc.) the next step is.
1 An Error Reporting Mechanism (ICMP). 2 IP Semantics IP is best-effort Datagrams can be –Lost –Delayed –Duplicated –Delivered out of order –Corrupted.
1 Chapter 23 Internetworking Part 3 (Control Messages, Error Handling, ICMP)
IP Telephone Lab 1 Connectivity Test IP Telephone Lab 2 Outline Ping & ICMP Fast Ping (fping) & AutoStatus One-Way Ping.
1 Figure 3-13: Internet Protocol (IP) IP Addresses and Security  IP address spoofing: Sending a message with a false IP address (Figure 3-17)  Gives.
Hands-On Ethical Hacking and Network Defense
Scanning.
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 ICMP The PING Tool Traceroute program IGMP.
or call for office visit,
TCP/IP Illustrated, Volume 1: The Protocols Chapter 6. ICMP: Internet Control Message Protocol ( 월 ) 김 철 환
1 Chapter 23 Internetworking Part 3 (Control Messages, Error Handling, ICMP)
Hands-On Ethical Hacking and Network Defense
Port Scanning James Tate II
COMP2322 Lab 6 TCP Steven Lee Mar 29, 2017.
Network Commands 2 Linux Ubuntu A.S.
or call for office visit, or call Kathy Cheek,
Network Tools and Utilities
or call for office visit,
COMPUTER NETWORKS CS610 Lecture-33 Hammad Khalid Khan.
Port Scanning (based on nmap tool)
8 Network Layer Part V Computer Networks Tutun Juhana
Part1: Ipconfig ping command Tracert command Getmac command
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol
Internet Control Message Protocol
Internet Control Message Protocol
32 bit destination IP address
TCP/IP Protocol Suite 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP message format Know.
Presentation transcript:

Hping2

What is Hping? Command-line oriented TCP/IP packet generator. can create IP packets containing TCP, UDP or ICMP payloads allows to manipulate header fields, flags. has a traceroute mode. can send files between a covert channel.

Functions of Hping2 Advanced Port scanning (via TCP scans, ICMP scan, UDP scan) Firewall Testing Test net performance using different protocols, packet size, TOS (type of service) and fragmentation Path MTU Discovery Advanced traceroute Remote OS fingerprinting

Hping as Packet Crafter can generate customized packets for various protocol types- raw IP,TCP, ICMP, UDP. provide options to set header fields and flags.

Crafting TCP Packets Crafting TCP packets is the default behavior of hping. specify the TCP flags, a destination port and a target IP address. TCP Flags: -F, -S, -R, -P, -A, -U hping2 [–<flag>] <ipaddress/hostname of target> [-p <portno>]

Crafting TCP Packets- Example -S (SYN) Packet An open port is indicated by a SA return packet, closed ports by RA packets. The attacker computer is 192.168.0.105 and the target is 192.168.0.100 [root@localhost hping2-rc3]# hping2 -S 192.168.0.100 HPING 192.168.0.100 (eth0 192.168.0.100): S set, 40 headers + 0 data bytes len=46 ip=192.168.0.100 ttl=128 id=18414 sport=0 flags=RA seq=0 win=0 rtt=149.9 ms len=46 ip=192.168.0.100 ttl=128 id=18416 sport=0 flags=RA seq=1 win=0 rtt=0.5 ms len=46 ip=192.168.0.100 ttl=128 id=18417 sport=0 flags=RA seq=2 win=0 rtt=0.4 ms len=46 ip=192.168.0.100 ttl=128 id=18418 sport=0 flags=RA seq=3 win=0 rtt=0.5 ms len=46 ip=192.168.0.100 ttl=128 id=18420 sport=0 flags=RA seq=4 win=0 rtt=1.6 ms --- 192.168.0.100 hping statistic --- 5 packets tramitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0.4/30.6/149.9 ms [root@localhost hping2-rc3]#

SYN Scan (Port Scanning) -S (SYN) Packet [root@localhost hping2-rc3]# hping2 -S 192.168.0.100 -p 135 HPING 192.168.0.100 (eth0 192.168.0.100): S set, 40 headers + 0 data bytes len=46 ip=192.168.0.100 ttl=128 DF id=28733 sport=135 flags=SA seq=0 win=16616 rtt=122.8 ms len=46 ip=192.168.0.100 ttl=128 DF id=28734 sport=135 flags=SA seq=1 win=16616 rtt=11.7 ms len=46 ip=192.168.0.100 ttl=128 DF id=28737 sport=135 flags=SA seq=2 win=16616 rtt=1.4 ms len=46 ip=192.168.0.100 ttl=128 DF id=28738 sport=135 flags=SA seq=3 win=16616 rtt=1.5 ms --- 192.168.0.100 hping statistic --- 4 packets tramitted, 4 packets received, 0% packet loss round-trip min/avg/max = 1.4/34.3/122.8 ms [root@localhost hping2-rc3]#

RST Scan(Port scanning) -R (RST) Packet RST packets are used to probe for active host. If you send out a RST scan you would get: no response -indicates that the host is alive ICMP host unreachable message - indicate that the host does not exist. Some IDS systems will not log RST packets/scans.

RST Scan (Port Scanning) [root@localhost hping2-rc3]# hping2 -R 192.168.0.100 HPING 192.168.0.100 (eth0 192.168.0.100): R set, 40 headers + 0 data bytes --- 192.168.0.100 hping statistic --- 6 packets tramitted, 0 packets received, 100% packet loss round-trip min/avg/max = 0.0/0.0/0.0 ms [root@localhost hping2-rc3]#

FIN Scan -F (FIN) Packet The FIN packet is used to close an established connection. It is also used to conduct a FIN Scan. When a closed port receives a FIN packet, it should respond with a RST packet while an open port should do nothing (ignore the packet).

FIN Scan (Port Scanning) [root@localhost hping2-rc3]# hping2 -F 192.168.0.100 HPING 192.168.0.100 (eth0 192.168.0.100): F set, 40 headers + 0 data bytes len=46 ip=192.168.0.100 ttl=128 id=20173 sport=0 flags=RA seq=0 win=0 rtt=34.2 ms len=46 ip=192.168.0.100 ttl=128 id=20174 sport=0 flags=RA seq=1 win=0 rtt=0.8 ms len=46 ip=192.168.0.100 ttl=128 id=20175 sport=0 flags=RA seq=2 win=0 rtt=0.5 ms len=46 ip=192.168.0.100 ttl=128 id=20176 sport=0 flags=RA seq=3 win=0 rtt=0.5 ms --- 192.168.0.100 hping statistic --- 4 packets tramitted, 4 packets received, 0% packet loss round-trip min/avg/max = 0.5/9.0/34.2 ms [root@localhost hping2-rc3]#

More in Port Scanning Spoofed Port Scanning: source IP address can be spoofed using –a option hping2 –a<spoofedIPaddress> [flags] <targetIPaddress/hostname> [-p<portno>] Incremental Port Scanning: incremental port scanning is done with + or ++ sign. hping2 –S tragethost –p + <portno> // destination port will be increased for each reply received. hping2 –S targethost –p++ <portno> // destination port will be increased for each packet sent.

Crafting ICMP Packets send ICMP packets using the -1 (one) mode. hping2 -1 <IPADDRESS> [root@localhost hping2-rc3]# hping2 -1 192.168.0.100 HPING 192.168.0.100 (eth0 192.168.0.100): icmp mode set, 28 headers + 0 data bytes len=46 ip=192.168.0.100 ttl=128 id=27118 icmp_seq=0 rtt=14.9 ms len=46 ip=192.168.0.100 ttl=128 id=27119 icmp_seq=1 rtt=0.5 ms len=46 ip=192.168.0.100 ttl=128 id=27120 icmp_seq=2 rtt=0.5 ms len=46 ip=192.168.0.100 ttl=128 id=27121 icmp_seq=3 rtt=1.5 ms len=46 ip=192.168.0.100 ttl=128 id=27122 icmp_seq=4 rtt=0.9 ms --- 192.168.0.100 hping statistic --- 5 packets tramitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0.5/3.7/14.9 ms [root@localhost hping2-rc3]#

Crafting UDP Packets send UDP packets using the -2 (two) mode. hping2 -2 ipaddress An open port ignores UDP packet, closed ports respond by ICMP Port Unreachable packets. [root@localhost hping2-rc3]# hping2 -2 192.168.0.100 HPING 192.168.0.100 (eth0 192.168.0.100): udp mode set, 28 headers + 0 data bytes ICMP Port Unreachable from ip=192.168.0.100 name=UNKNOWN --- 192.168.0.100 hping statistic --- 5 packets tramitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0.0/0.0/0.0 ms [root@localhost hping2-rc3]# TCPDUMP OUTPUT: