TCP Dump

- 가장 일반적으로 사용하는 스니핑 도구로 불법적인 느낌, 해킹이라는 느낌보다는 관리자적인 느낌이 강한 도구이다.

처음부터 스니핑을 위한 도구로 개발된 것이 아니라 네트워크 관리를 위해 개발된 툴이며 Snort라는 IDS의 기반 프로그램이기도 하다.


man page에서 Tcpdump의 정의를 잠깐 살펴보고자 한다.

Tcpdump prints out a description of the contents of packets on a network interface that match the boolean expression; the description is preceded by a time stamp, printed, by default, as hours, minutes, seconds, and fractions of a second since midnight. It can also be run with the -w flag, which causes it to save the packet data to a file for later analysis, and/or with the -r flag, which causes it to read from a saved packet file rather than to read packets from a network interface. It can also be run with the -V flag, which causes it to read a list of saved packet files. In all cases, only packets that match expression will be processed by tcpdump.


뭐 내용을 잠깐 보면 Tcpdump는 boolean 표현식을 만족하는 네트워크 인터페이스의 패킷의 내용을 출력하고 파일로 저장하는 w플래그나 저장된 패킷으로부터 읽어들이는 r플래그 등이 존재한다는 것을 확인할 수 있다.


설치

Tcpdump는 libpcap 라이브러리를 사용하는데 칼리에서는 기본적으로 tcpdump가 설치되어 있고, 리눅스의 경우

apt-get install tcpdump, apt-get install libpcap 으로 필요 라이브러리를 설치하면 되는데 자세한 설치 방법은 칼리를 사용할 것이기 때문에 제외하도록 한다.


옵션(자주 쓰이는 것만 나열 (자세한 것은 man page 참고)


예제

To print all packets arriving at or departing from sundown:

-> tcpdump host sundown        

 //sundown host의 출발 도착 패킷 출력


To print traffic between helios and either hot or ace:

    -> tcpdump host helios and \( hot or ace \)    

//helios와 hot, ace에서 발생하는 패킷 출력


To print all IP packets between ace and any host except helios:

    -> tcpdump ip host ace and not helios        

//helios를 제외한 ace와 다른 host간 ip 패킷 출력


To print all traffic between local hosts and hosts at Berkeley:

     -> tcpdump net ucb-ether       

//local host와 berkeley host사이에서 발생하는 모든 트래픽 출력


To print all ftp traffic through internet gateway snup: (note that the expression is quoted to prevent the shell from (mis-)interpreting the parentheses):

    -> tcpdump 'gateway snup and (port ftp or ftp-data)'    

//gateway snup을 통한 모든 ftp 패킷 출력


To print IP packets longer than 576 bytes sent through gateway snup:

    -> tcpdump 'gateway snup and ip[2:2] > 576'    

//snup을 통과하는 패킷 중 576byte 이상 패킷 출력



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

스푸핑 (Spoofing) 소개  (0) 2016.02.11
스니핑 도구 dsniff 소개  (0) 2016.02.02
스니핑(sniffing) 소개  (0) 2016.02.02
shodan 소개  (0) 2016.02.01
해킹의 두번째걸음. 스캐닝(scanning)  (0) 2016.01.28

+ Recent posts