1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import urllib
import urllib2
import time
 
url = "http://webhacking.kr"
id_pw = {'id' : 'rap1er''pw' : 'password'}
user_agent = {'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko'}
session_id = 'PHPSESSID=3da1bb25110cf6a6985794933b3bf4e8'
print session_id
 
#target_url = url + '/index.php'
 
while True:
    req = urllib2.Request(url, urllib.urlencode(id_pw), headers=user_agent)
    req.add_header('cookie', session_id)
    res = urllib2.urlopen(req)
    print res.read()
 
    time.sleep(180)    
cs


문제 풀라고 고민하다가 자꾸 세션이 만료돼서 로그인을 다시해주는게 귀찮아서 만듬

+ Recent posts