SQLi: custom substr method

This commit is contained in:
2025-12-08 12:35:56 +01:00
parent 6cd353b911
commit 43b1a0ebc6

View File

@@ -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: