Adding support for import sqlmap as a library (#2083)

This commit is contained in:
Miroslav Štampar 2026-07-02 09:58:48 +02:00
parent e1126a2a4e
commit d2ead9dcda
5 changed files with 312 additions and 3 deletions

View file

@ -664,3 +664,9 @@ if __name__ == "__main__":
else:
# cancelling postponed imports (because of CI/CD checks)
__import__("lib.controller.controller")
# exposing the programmatic library facade as 'sqlmap.scan()' / 'sqlmap.scanFromRequest()'
from lib.utils.library import scan, scanFromRequest, SqlmapError
# public library API (also marks the re-exported names above as intentional for pyflakes)
__all__ = ["scan", "scanFromRequest", "SqlmapError"]