[원문: http://tools.kali.org/information-gathering/hping3]


정의

hping is a command-line oriented TCP/IP packet assembler/analyzer. The interface is inspired to the ping(8) unix command, but hping isn’t only able to send ICMP echo requests. It supports TCP, UDP, ICMP and RAW-IP protocols, has a traceroute mode, the ability to send files between a covered channel, and many other features.


While hping was mainly used as a security tool in the past, it can be used in many ways by people that don’t care about security to test networks and hosts. A subset of the stuff you can do using hping:


-Firewall testing

-Advanced port scanning

-Network testing, using different protocols, TOS, fragmentation

-Manual path MTU discovery

-Advanced traceroute, under all the supported protocols

-Remote OS fingerprinting

-Remote uptime guessing

-TCP/IP stacks auditing

-hping can also be useful to students that are learning TCP/IP.

 간략하게 hping3은 command-line으로 인터페이스는 ping으로부터 영감을 받았다. 그러나 hping3은 ping의 ICMP echo 뿐만 아니라 UDP/TCP패킷 전송이 가능하다. 또한, hping3은 fragmentation, packet body/size를 다룰 수 있으며, 지원되는 프로토콜 아래 파일 전송을 하기 위해 사용되어진다.

(fragmentation 소개: http://kkn1220.tistory.com/76 참고)

지원 목록

-방화벽 테스트

-포트 스캐닝

-protocols, TOS, fragmentation을 이용한 네트워크 테스트

-MTU확인

-traceroute

-OS 핑거프린팅

-업타임 추측

-TCP/IP 스택 감사

-> hping3은 일전에 DoS 공격 때 언급했었는데 상당히 강력하다. 추천!


Usage

#hping3 -h  입력 시 출력되는 것이 상당히 많다.

아래는 조금이나마 편하게(?) 볼 수 있는 페이지이다. 기본 옵션, 자주쓰는 옵션, IP 관련 옵션, ICMP 관련 옵션, TCP/UDP 관련 옵션, TCP FLAGS, Protocol Selection으로 구분할 수 있다.

조금 더 구분을 하자면 아래와 같다.(아래의 자주쓰는 명령어는 지극히 개인적인 판단이니 단순 참고용)

Base

-c, --count: 지정한 패킷만 전송 후 종료

-i, --interval: 간격 정하기

 --fast      alias for -i u10000 (10 packets for second)

      --faster    alias for -i u1000 (100 packets for second)

      --flood    sent packets as fast as possible. Don't show replies.

-V, --verbose: 자세히 보기

IP Related

-a, --spoof: 출발지 ip 변조 (상당히 강력)

--rand-source: 출발지 ip를 랜덤값으로 바꿈(MAC 주소는 안바뀐다고 들었는데 확인 필요)

TCP/UDP Related

-p, --destport: 목적지 port

TCP Flags

-F --fin,  -S --syn, -R --rst, -A --ack

MODE

-1: icmp

-2: udp

-8: scan


활용방법
http://kkn1220.tistory.com/75 참고

위의 주소는 DoS공격에 hping3이 사용되는 것을 확인할 수 있다. 자세한 설명은 위의 주소에서 확인하면 된다.

아래는 대략적인 사용법이다.

1) SYN Flooding

- SYN flooding이란 SYN을 넘치게 하는 것을 뜻한다. 즉 클라이언트가 서버의 SYN Queue를 overflow시켜 서버를 오동작하거나 충돌시키는 공격이다.

#hping3 <target-ip> -a <fake-ip> -p <destination port> -S -i u10000

//-S는 TCP Flags 의 --syn이며, i u10000은 --fast 이다. 위의 명령어에서 확인 가능하다.


2) Land Attack

- 패킷을 전송할 때 출발지 IP주소와 목적지 IP주소 값을 타겟의 IP주소 값으로 똑같이 만들어서 타겟으로 보낸다.

- 시스템은 처음 시도된 SYN에 대한 reply 패킷을 출발지 IP 주소값을 참조하여 그 값을 목적지 IP주소 값으로 설정하여 패킷을 보낸다. 그러나 이 값은 자기 자신의 IP 주소값이기 때문에 네트워크 밖으로 나가지 않고 자기 자신에게 돌아오며 land 공격은 동시 사용자를 점유하는 것 동시에 CPU부하 또한 올리게 된다.

#hping3 <target-ip> -a <target-ip> -s 100 -p 100


3) Smurf Attack 

1. smurf공격은 공격자가 타겟의 IP로 스푸핑한 후, 타겟이 속해 있는 broadcast network로 broadcast 요청을 보낸다.

2. ICMP request를 수신한 컴퓨터들은 타겟에 reply 패킷을 보낸다.

3. 대량의 ICMP reply를 수신한 타겟은 과부하 상태가 된다.

#hping3 <broadcast network> -a <target-ip> --icmp --flood


4) PortScan

hping3은 타겟의 열린 포트를 확인할 수 있다.

hping –I <interface> --scan <port> -S <target-ip> 

'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering24]miranda  (0) 2016.03.29
[Information-Gathering23]masscan  (0) 2016.03.24
[Information-Gathering21]goofile  (0) 2016.03.18
[Information-Gathering20]golismero  (0) 2016.03.18
[Information-Gathering19]fragrouter  (0) 2016.03.07

+ Recent posts