SQLi: custom substr method
This commit is contained in:
5
sqli.py
5
sqli.py
@@ -35,6 +35,9 @@ class SQLi(ABC):
|
||||
|
||||
return rows
|
||||
|
||||
def substring(self, what, offset: int, size: int):
|
||||
return f"substr({what},{offset},{size})"
|
||||
|
||||
@abstractmethod
|
||||
def ascii(self):
|
||||
pass
|
||||
@@ -207,7 +210,7 @@ class BlindSQLi(SQLi, ABC):
|
||||
cur_str = ""
|
||||
while True:
|
||||
found = False
|
||||
cur_column = self.ascii() + f"(substr({column},{len(cur_str) + 1},1))"
|
||||
cur_column = self.ascii() + "(" + self.substring(column, len(cur_str) + 1, 1) + ")"
|
||||
if charset:
|
||||
query = self.build_query(cur_column, table, condition, offset)
|
||||
for c in charset:
|
||||
|
||||
Reference in New Issue
Block a user