Last active
December 12, 2015 03:09
-
-
Save fqrouter/4705167 to your computer and use it in GitHub Desktop.
GFW 定位原理性脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from scapy.all import * | |
| import time | |
| dst = sys.argv[1] | |
| src = '' | |
| for ttl in range(1, 15): | |
| send(IP(dst=dst,src=src,id=ttl,ttl=ttl)/UDP()/DNS(rd=1,qd=DNSQR(qname="www.twitter.com"))) | |
| send(IP(dst=dst,src=src,id=ttl,ttl=ttl)/TCP(dport=80,sport=8081)) # 非必要参照物 | |
| time.sleep(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from scapy.all import * | |
| import time | |
| dst = sys.argv[1] | |
| src = '' | |
| for ttl in range(1, 15): | |
| send(IP(dst=dst,src=src,id=ttl,ttl=ttl)/TCP(dport=80,sport=8080)) | |
| send(IP(dst=dst,src=src,id=ttl,ttl=ttl)/TCP(dport=80,sport=8081)) | |
| time.sleep(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from scapy.all import * | |
| import time | |
| dst = sys.argv[1] | |
| src = '' | |
| for ttl in range(1, 15): | |
| syn = IP(dst=dst, src=src, id=ttl * 10 + 1, ttl=ttl) / TCP(sport=19840, dport=80, flags='S', seq=0) | |
| send(syn) | |
| getStr = 'GET / HTTP/1.1\r\nHost: www.facebook.com\r\n\r\n' | |
| request = IP(dst=dst, src=src, id=ttl * 10 + 2, ttl=ttl) / TCP( | |
| sport=19840, dport=80, seq=1, ack=100, flags='A') / getStr | |
| send(request) | |
| send(IP(dst=dst,src=src,id=ttl * 10 + 3,ttl=ttl)/TCP(dport=80,sport=8081)) # 非必要参照物 | |
| time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment