Christina Quast | b894691 | 2015-05-12 16:02:48 +0200 | [diff] [blame^] | 1 | #!/usr/bin/env python |
2 | |||||
3 | from scapy.all import IP, UDP, sr1 | ||||
4 | |||||
5 | ip="127.0.0.1" | ||||
6 | port=4729 | ||||
7 | sp=58621 | ||||
8 | data=("\x02\x04\x04"+"\x00"*13+"\x9f\x16\xa0\xc0\x00\x00\x16", "\x9f\x16\xa0\xc0\x00\x00\x16") | ||||
9 | |||||
10 | p=IP(dst=ip, src=ip)/UDP(sport=sp, dport=port)/data[0] | ||||
11 | |||||
12 | if p: | ||||
13 | p.show() | ||||
14 | |||||
15 | ans = sr1(p, timeout=2) | ||||
16 | if ans: | ||||
17 | print(a) |