東北大學 python模擬登陸校園網(2019年6月啓用新登陸模式後)

import re
import requests
url="http://ipgw.neu.edu.cn/srun_cas.php?ac_id=1"
head={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36",
}
sess=requests.session()
req=sess.get(url,headers=head)

lt_execution_id=re.findall('name="lt" value="(.*?)".*\sname="execution" value="(.*?)"', req.text, re.S)

payload={
    "rsa":"usernamepassword"+lt_execution_id[0][0],
    "ul":"7",
    "pl":"12",
    "lt":lt_execution_id[0][0],
    "execution":lt_execution_id[0][1],
    "_eventId":"submit"
}
r2=sess.post("https://pass.neu.edu.cn/tpass/login?service=https%3A%2F%2Fipgw.neu.edu.cn%2Fsrun_cas.php%3Fac_id%3D3",headers=head,data=payload)
print(r2.text)
"""
東北大學校園網聯網代碼
"""

 

 "rsa":"usernamepassword"+lt_execution_id[0][0]php

這裏的usernamepassword,例如 17714xx123456,uesrname:17714xx,password:123456python

相關文章
相關標籤/搜索