import sys, socket, urllib, re #userNum = 1958039481 userNum = 195804344 while True: data = urllib.urlopen('http://r.qzone.qq.com/cgi-bin/user/cgi_personal_card?uin=' + str(userNum)).read() ip = re.findall("nickname\":\"(.*?)\",", data) if len(ip) != 0: if ip[0].find('.') > 0: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((ip[0], 80)) sock.send("GET %s HTTP/1.0\r\nHost: %s\r\n\r\n" % ('/', 'naver.com')) data = sock.recv(248) if data.find("NAVER") > 0: print '[************************] ' + ip[0] + ':' + '80 [************************]' else: print '[-] This server is not Pharming\t' + ip[0] except: print '[-] nickname/userNum : ' + ip[0] + '/' + str(userNum) else: pass #print '[-] not ip type. uNum:' + str(userNum) else: pass #print '[-] data is not exist. uNum:' + str(userNum) userNum+=1