Self-Improvement
Scapy 사용법 3 (DNS, traceroute) 본문
*예제
>>> sr1(IP(dst="168.126.63.1")/UDP()/DNS(rd=1,qd=DNSQR(qname="www.naver.com")))
sr1 - This is the send & receives function that only returns the first answered packet
(IP(dst=”10.1.99.2”) - Again we are using an IP packet and the destination IP is my router (which is also my DNS provider)
/UDP() - Well as you may or may not know, DNS is a UDP packet (port 53) so we need to specify that in our packet.
/DNS - This is telling Scapy that we want to create a DNS packet. rd=1 - Is telling Scapy that recursion is desired qd=DNSQR(qname=”www.citrix.com”) - Now I’m not a 100% sure but qd= I believe means Query Domain and DNSQR is DNS Question Record, qname=”” is the name of what you are querying.
wireshark로 확인하면 패킷이 확인되어짐.
wireshark로 확인.
*예제
>>> traceroute(["www.google.com"], maxttl=20)
>>> traceroute(["10.1.99.2"], dport=23, maxttl=20)
>>> traceroute(["www.google.com", "www.google.com", "www.naver.com"], maxttl=20)
>>> ans,unans=_
>>> unans
>>> unans,show()
>>> ans.show()
'scapy' 카테고리의 다른 글
Scapy 사용법 5 (sniff) (0) | 2018.10.22 |
---|---|
Scapy 사용법 4 (ICMP, TCP, UDP ping scan) (0) | 2018.10.22 |
Scapy 사용법 4 (Ack, IP Scan, ARP ping) (0) | 2018.10.22 |
scapy 사용법 2 (TCP) (0) | 2018.10.20 |
scapy 사용법 1 (ICMP) (0) | 2018.10.19 |