tcpdump

MySprtlty·2023년 12월 2일
0

Linux Command Line

목록 보기
8/8

🏷️tcpdump

  • tcpdump [옵션] [조건부]

📌옵션

옵션stands for설명
-c numCount지정한 개수 만큼 출력한다.
-i 네트워크 인터페이스Interface지정한 네트워크 인터페이스를 경유하는 패킷을 출력한다.
-w filenameWrite출력한 패킷 정보를 지정한 파일에 쓴다.
-r filenameReadw옵션으로 만든 파일에서 읽는다.
-v[v][v]Verbose패킷 내용을 상세히 본다.
-nnumeric주소들을 번역하지 않는다.

📌범위

범위설명
srcSource IP를 지정한다.
dstDestination IP를 지정한다.
port특정 Port를 사용하는 패킷만 캡쳐한다.
host특정 Host로 접속 요청하는 패킷만 캡쳐한다.
network/mask네트워크 및 서브넷 마스크를 지정한다.
tcptcp로 프로토콜을 필터링한다.
udpudp로 프로토콜을 필터링한다.
icmpicmp로 프로토콜을 필터링한다.

📌조건 연산

표기
and
or
not

📌예시

tcpdump -w tcpdump.log       
tcpdump -r tcpdump.log         
tcpdump -i eth0 -c 10          
tcpdump -i eth0 tcp port 80    
tcpdump -i eth0 src 172.0.0.1  
tcpdump -i eth0 dst 172.0.0.1
tcpdump -i eth0 src 192.168.1.19 and tcp port 80
tcpdump src 192.168.1.18 and not dst port 22
tcpdump -vveennX -s0 -i eth0 -w a.out
tcpdump -vveennxxx -s0 -i eth0 -w a.out
profile
2Co 4:7

0개의 댓글