看到一个代理服务器网站挺好的,不过就是有限制,只能免费用3天~后来研究了一番,发现所谓的过期只是关闭了端口而已,但是IP还是原来的~so,我们只需要知道端口就可以咯
从1-65535扫描了下端口,发现开了好多,猜想正确,接下来就是验证的时刻了 :)
然后写了个脚本判断是否是代理端口,直接贴代码吧
1 #!/usr/bin/env python 2 #-*- coding:utf-8 -*- 3 import urllib2,sys 4 5 if len(sys.argv) != 2: 6 print "[?] Usage: this.py <proxy.txt>" 7 print "[-] Proxy: ip:port" 8 exit(0) 9 if __name__ == '__main__': 10 # open proxys 11 tmp = open(sys.argv[1]).readlines() 12 for t in tmp: 13 t = t.strip(" ") 14 print "[-] Checking [%s].."%t 15 p = "http://%s"%t 16 h = urllib2.ProxyHandler({"http": p}) 17 o = urllib2.build_opener(h, urllib2.HTTPHandler) 18 try: 19 r = o.open("http://www.baidu.com/", timeout=5) 20 if len(r.read()) > 10: 21 print "[*] {%s} Alive !"%p 22 else: 23 print "[!] {%s} NONO !"%p 24 except: 25 print "[!] {%s} NONO !"%p