1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| import requests import getpass import sys
username = input('username=') password = getpass.getpass('password=')
headers = { 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'sec-ch-ua': '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'Origin': 'http://lgn6.bjut.edu.cn', 'Upgrade-Insecure-Requests': '1', 'DNT': '1', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Sec-Fetch-Site': 'cross-site', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-User': '?1', 'Sec-Fetch-Dest': 'document', 'Referer': 'http://lgn6.bjut.edu.cn/', 'Accept-Language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7', }
params = ( ('https://lgn.bjut.edu.cn', ''), )
data = { 'DDDDD': username, 'upass': password, 'v46s': '0', 'v6ip': '', 'f4serip': '172.30.201.10', '0MKKey': '' }
try: response = requests.post('https://lgn6.bjut.edu.cn/V6?https://lgn.bjut.edu.cn', headers=headers, data=data) print(response.text) except: input('something went wrong...') sys.exit()
tmp = response.text.split('value=') v6ip = tmp[-1].split('\'')[1]
headers = { 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'sec-ch-ua': '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'Origin': 'https://lgn6.bjut.edu.cn', 'Upgrade-Insecure-Requests': '1', 'DNT': '1', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Sec-Fetch-Site': 'same-site', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-Dest': 'document', 'Referer': 'https://lgn6.bjut.edu.cn/', 'Accept-Language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7', }
data = { 'DDDDD': username, 'upass': password, '0MKKey': 'Login', 'v6ip': v6ip }
try: response = requests.post('https://lgn.bjut.edu.cn/', headers=headers, data=data) print(response.text) except: input('something went wrong...') sys.exit()
if 'You have successfully logged into our system.' in response.text: print('***Login successful***') input('press any key to continue...')
|