20: 14: 17.533119 IP [ip-address] .60000> [resolver-ip] .53: 31337+ A? ya.ru. (23)
20: 14: 17.534871 IP [resolver-ip] .53> [ip-address] .60000: 31337 3/0/0 A 213.180.204.3, A 213.180.193.3, A 93.158.134.3 (71)
20: 16: 43.333220 IP [ip-address] .60000> [resolver-ip] .53: 31337+ [b2 & 3 = 0x180] A? ya.ru. (23)
20: 16: 43.336146 IP [resolver-ip] .53> [ip-address] .60000: 31337 3/0/0 A 213.180.193.3, A 213.180.204.3, A 93.158.134.3 (71)
There are two bits of three, and there can be no more than a bit. header bytes two and three.
1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | ID | + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | QR | Opcode | AA | TC | RD | RA | Z | RCODE | + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | QDCOUNT | + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | ANCOUNT | + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | NSCOUNT | + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | ARCOUNT | + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
$ echo 'ibase = 16; obase = 2; 180' | bc
1 1000 0000
#!/usr/bin/env python from scapy.all import * pkt=IP(dst="[resolver-ip]")/\ UDP(sport=60000)/\ DNS(id=31337,qr=0,rd=1,ra=1,qd=DNSQR(qname="ya.ru")) pkt.show2() send(pkt)
$ sudo tcpdump -n -i eth0 port 53 and host [resolver-ip]
20: 17: 43.975572 IP [ip-address] .60000> [resolver-ip] .53: 31337+ [b2 & 3 = 0x180] A? ya.ru. (23)
20: 17: 43.979447 IP [resolver-ip] .53> [ip-address] .60000: 31337 3/0/0 A 93.158.134.3, A 213.180.204.3, A 213.180.193.3 (71)
Source: https://habr.com/ru/post/241375/
All Articles