題目文件:https://files.cnblogs.com/files/nul1/access.log.tarapp
直接搜索flag發現是一題關於二分法注入。url
頁面爲200的字節大小爲1765,因此能夠經過讀取每行判斷是否有1765以及有沒有flag的關鍵字樣,進而提取值。spa
腳本以下所示:code
# coding:utf-8 import re import urllib f = open('access.log','r') lines = f.readlines() datas = [] for line in lines: t = urllib.unquote(line) if '1765' in t and 'flag' in t: # 過濾出與flag相關,正確的猜解 datas.append(t) flag_ascii = {} for data in datas: matchObj = re.search( r'LIMIT 0,1\),(.*?),1\)\)>(.*?) AND', data) if matchObj: key = int(matchObj.group(1)) value = int(matchObj.group(2))+1 flag_ascii[key] = value flag = '' for value in flag_ascii.values(): flag += chr(value) print flag