Files
3288588344-toulu/免流校园网签到.py
2024-06-15 16:36:22 +08:00

39 lines
1.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import requests
import time
url = "http://8.137.111.254:1024/user/index.php"
params = {'act': "do_login"}
payload = "name=xxxxxx&pass=xxxxxxxxxxx"#name是账号pass是密码
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
'Accept': "application/json, text/javascript, */*; q=0.01",
'Accept-Encoding': "gzip, deflate",
'X-Requested-With': "XMLHttpRequest",
'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8",
'Origin': "http://8.137.111.254:1024",
'Referer': "http://8.137.111.254:1024/user/index.php",
'Accept-Language': "zh-CN,zh;q=0.9",
}
response = requests.post(url, params=params, data=payload, headers=headers)
cookie_value = response.cookies.get('PHPSESSID')
print("Cookie value:", cookie_value)
time.sleep(2)
url = "http://8.137.111.254:1024/user/getline.php"
params = {'act': "sign"}
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
'Accept': "application/json, text/javascript, */*; q=0.01",
'Accept-Encoding': "gzip, deflate",
'X-Requested-With': "XMLHttpRequest",
'Origin': "http://8.137.111.254:1024",
'Referer': "http://8.137.111.254:1024/user/admin.php",
'Accept-Language': "zh-CN,zh;q=0.9",
'Cookie': f"PHPSESSID={cookie_value}"
}
response = requests.post(url, params=params, headers=headers)
print(response.json())