Recent Post»

Recent Comment»

« 2024/5 »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
05-09 11:29

 

'tcpdump'에 해당되는 글 2

  1. 2016.05.17 tcpdump 관련 command
  2. 2013.07.29 tcpdump - 네트워크 패킷 덤프
 

tcpdump 관련 command

Linux | 2016. 5. 17. 00:34 | Posted by 짱아
반응형

# tcpdump로 패킷 캡처 하기

tcpdump -i any net 111.111.0.0/16 and tcp -w dump.result &
    -i any : 모든 포트에 대해 Listen
    net 111.111.0.0/16 : 지정된 CIDR 네트워크에 대해 capture
    and : combination 
        AND : and / &&
        OR : or / ||
        EXCEPT : not / !
    tcp : tcp 프로토콜
    -w dump.result : 캡춰된 내용 해당 파일에 저장


tcpdump -i any net 123.123.123.123/32 -w dump.result &
    123.123.123.123으로 발생되는 트래픽만 캡춰

# tcpdump 결과 파일 읽기

기본 패킷 내역 확인
tcpdump -r dump.result | less

패킷 데이터 확인 #1
tcpdump -qns 0 -X -r dump.result | less
    -X : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex and ASCII. This is very handy for analysing new protocols.
    cf, -xx : ASCII 패킷 정보 없음.

패킷 데이터 확인 #2
tcpdump -qns 0 -A -r dump.result | less
    -A : Print each packet (minus its link level header) in ASCII. Handy for capturing web pages.

관련 Tool
wireshark : wireshark.org (Windows, OS X 용)
tcpick
tcpxtract
tshark


# 참고 
http://www.tcpdump.org/tcpdump_man.html
https://danielmiessler.com/study/tcpdump/
http://www.thegeekstuff.com/2010/08/tcpdump-command-examples/


반응형
:

tcpdump - 네트워크 패킷 덤프

Network | 2013. 7. 29. 23:50 | Posted by 짱아
반응형

tcpdump - dump traffic on a network

 

* tcpdump 실행하기

$sudo tcpdump -n

; -n 은 대부분의 네트워크 관련 명령어에서 IP 주소를 호스트명으로 변환하지 않는 옵션

* tcpdump 종료하기

Ctrl + C

 

* tcpdump 출력 필터링 하기

$sudo tcpdump -n host dev

; dev 호스트와 주고 받은 패킷만을 수집하고자 하는 경우

$sudo tcpdump -n not host dev

; dev 호스트만 제외하고 수집하고자 하는 경우

 

$sudo tcpdump port 80

; 80 포트만 수집하고자 하는 경우

$sudo tcpdump port 80 or port 443

; 80 또는 443 포트 수집

 

$sudo tcpdump -w output.pcap

; output.pcap 파일로 저장

$sudo tcpdump -C 10 -w output.pcap

; 10M 단위로 output.pcap1 ~ 파일 저장

$sudo tcpdump -C 10 -W 5 -w output.pcap

; 10M 단위로 저장파일 5개까지만 저장(총 50M내에서 순환기록)

 

$sudo tcpdump -r output.pcap

;수집한 결과 파일 output.pcap을 실시간 처럼 재생

반응형
: