import json
headers={
''Host'': ''x.x.x.x'',
''Content-Length'': ''35'',
''Accept'': ''application/json, text/plain, */*'',
''User-Agent'': ''Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36'',
''Content-Type'': ''application/json;charset=UTF-8'',
''Origin'': ''http://x.x.x.x'',
''Referer'': ''http://x.x.x.x/setting/github'',
''Accept-Encoding'': ''gzip, deflate'',
''Accept-Language'': ''zh-CN,zh;q=0.9''
}
usr_list=[]
psw_list=[]
url=''http://x.x.x.x/api/setting/github''
def get_data(username,passwad):
data={
"username": username,
"password": passwad
}
return json.dumps(data)
with open(''usr.txt'',encoding=''utf-8'') as f:
for usr in f.readlines():
if usr!=None:
usr_list.append(usr.strip(''\\n''))
print(usr_list)
with open(''psw.txt'',encoding=''utf-8'') as f:
for psw in f.readlines():
if psw!=None:
psw_list.append(psw.strip(''\\n''))
print(psw_list)
for usname,pswa in zip(usr_list,psw_list):
print(usname)
print(pswa)
res=requests.post(url,headers=headers,data=get_data(username=usname,passwad=pswa))
最后修改:2021 年 02 月 10 日 08 : 45 PM
如果觉得我的文章对你有用,请随意赞赏