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


정의

P0f is a tool that utilizes an array of sophisticated, purely passive traffic fingerprinting mechanisms to identify the players behind any incidental TCP/IP communications (often as little as a single normal SYN) without interfering in any way. Version 3 is a complete rewrite of the original codebase, incorporating a significant number of improvements to network-level fingerprinting, and introducing the ability to reason about application-level payloads (e.g., HTTP).

Some of p0f’s capabilities include:

  • Highly scalable and extremely fast identification of the operating system and software on both endpoints of a vanilla TCP connection – especially in settings where NMap probes are blocked, too slow, unreliable, or would simply set off alarms.
  • Measurement of system uptime and network hookup, distance (including topology behind NAT or packet filters), user language preferences, and so on.
  • Automated detection of connection sharing / NAT, load balancing, and application-level proxying setups.
  • Detection of clients and servers that forge declarative statements such as X-Mailer or User-Agent.

The tool can be operated in the foreground or as a daemon, and offers a simple real-time API for third-party components that wish to obtain additional information about the actors they are talking to.


Common uses for p0f include reconnaissance during penetration tests; routine network monitoring; detection of unauthorized network interconnects in corporate environments; providing signals for abuse-prevention tools; and miscellanous forensics.

  p0f를 간략하게 소개하면 운영하는 서비스에 대한 OS를 확인하거나 어플리케이션의 정보를 확인할 수 있다.
예를 들면 서버의 OS가 리눅스 3.x, 또는 80 아파치 2.x 등을 확인할 수 있다.

해킹을 하기 전 footprint 단계에서 타겟 서비스의 정보를 파악해야 할 일이 생기는데 이럴 때 사용하는 것이 p0f 이다.
(footprint에 대한 설명은 http://kkn1220.tistory.com/61 참고)

25번 nmap에서 -O 옵션을 주어 타겟의 OS를 확인해보았다. (http://kkn1220.tistory.com/103 참고)
그렇다면 nmap과 p0f의 차이점은 무엇일까? 라는 질문을 할 수 있다. p0f는 Passive OS Fingerprinting으로 말 그대로 수동적인 OS 탐지 도구이다. nmap과 같은 Active Fingerprinting과는 수동적이냐 능동적이냐의 차이가 있으며 수동적인 OS 탐지도구의 경우 추가 또는 비정상적 트래픽을 생성하지 않는 것이 특징이다. 즉 정상적인 통신을 하면서 타겟 시스템의 OS를 확인할 수 있다.

 p0f는 4가지 동작모드를 지원한다.

-SYN mode: 연결 시도 측 운영체제 정보 확인

-SYN + ACK mode: 응답하는 측 운영체제 정보 확인

-RST/RST+ ACK mode: 연결 시도 거부 시스템 측 정보 확인

-stray ACK mode: 기존 세션 검토


Usage

사용법은 어렵지 않다. 

옵션으로 인터페이스를 설정하거나 promiscuous 모드 설정, 저장하거나 input file 지정 등 사항에 맞게 지정하면 끝이다.


-i 인터페이스 모드로 eth0을 지정하였고 promiscuous를 지정하였다. 이전에 스니핑 포스트 때 언급하였는데 자신의 주소값을 무시하고 모든 패킷을 받아들이는 상태를 promiscuous 모드라고 한다. (스니핑 http://kkn1220.tistory.com/67 참고)

그림출처: 안랩

kali는 기다리게 된다....


보기 편하도록 ubuntu(192.168.100.5)에서 실행이 아닌 kali에서 ssh로 192.168.100.5로 접속을 한 상태이다.

kkn은 ubuntu(192.168.100.5)이고 ssh로 raspberry pi(192.168.100.9)로 연결을 시도하는 화면의 모습이다.

위의 사진을 보면 192.168.100.5의 OS를 확인할 수 있다. 실제로는 3.19인데 완벽하게 맞추지는 못한다.

또한 9번 raspberry의 경우 라즈비안을 설치하였는데 os에 ??? 로 확인할 수가 없었다..


심심해서 ubuntu에서 apt-get update를 하였다. 

위의 사진에는 표현되지 않았지만 해당 서버의 경우 리눅스 2.4, 3.x로 출력이 되었다. 

또한 80포트 apache의 경우 2.x로 출력이 되었음을 확인할 수 있었다.


뭐 간단한 예제이기에 별거 없어보인다. 하지만 실제 타겟에 대해 할 경우 많은 내용이 출력될 수 있다. 그렇기 때문에 패킷 덤프파일을 이용하여 os를 탐지하는 경우가 더 많은 듯 보인다.

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

[Information-Gathering27]recon-ng  (0) 2016.04.12
[Information-Gathering25]nmap  (0) 2016.04.06
[Information-Gathering24]miranda  (0) 2016.03.29
[Information-Gathering23]masscan  (0) 2016.03.24
[Information-Gathering22]hping3  (0) 2016.03.18

+ Recent posts