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