Last active
December 26, 2018 09:20
-
-
Save benyaminsalimi/37f8174f60e53ecf29e111b9dfb186f4 to your computer and use it in GitHub Desktop.
python function for login to puya.birjandut.ir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this function can be use for loging to every old sadaf university portal ! also can use for evil thing :) | |
# there is no captcha and childern can do EVIL thing with this portal :-D | |
# sadaf portal developed by this company : http://dpm.ir/ | |
# sadaf portal used for Birjand university of techonology and Ferdowsi university of Mashhad | |
# usage as you know : check('9313344449','123456') | |
import requests | |
import hashlib | |
import bs4 | |
def check(username, password): | |
md5 = hashlib.md5() | |
passw=str(password) | |
user =str(username) | |
md5.update(passw) | |
head={'UserID': user ,'UserPassword':md5.hexdigest() , 'pswdStatus': 'strong', 'DummyVar': ''} | |
url = 'http://puya.birjandut.ir/gateway/UserInterim.php' | |
page = requests.post(url, data=head) | |
soup = soup = bs4.BeautifulSoup(page.text,'html.parser') | |
if soup.title.string == 'browser error': | |
return False | |
else: | |
return True | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can also read my full blog post here it so intersting 👍