Skip to content

Commit 1465d55

Browse files
committed
Merge branch 'master' into hana-pr
# Conflicts: # data/txt/sha256sums.txt # lib/core/common.py # lib/core/settings.py
2 parents 9e92d3c + 622cfa7 commit 1465d55

239 files changed

Lines changed: 57018 additions & 4328 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
branches: [ master ]
44
pull_request:
55
branches: [ master ]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ci-${{ github.ref }}
10+
cancel-in-progress: true
611

712
permissions:
813
contents: read
@@ -12,6 +17,10 @@ jobs:
1217
runs-on: ${{ matrix.os }}
1318
timeout-minutes: 30
1419

20+
env:
21+
# deterministic dict/set iteration order run-to-run (guards against hash-order flakiness in CI)
22+
PYTHONHASHSEED: "0"
23+
1524
strategy:
1625
matrix:
1726
include:
@@ -37,11 +46,89 @@ jobs:
3746
- name: Python sanity
3847
run: python -VV
3948

49+
- name: Pyflakes lint
50+
shell: bash
51+
run: |
52+
python - <<'PY'
53+
from __future__ import print_function
54+
55+
import subprocess
56+
import sys
57+
58+
subprocess.check_call([
59+
sys.executable, "-m", "pip", "install", "pyflakes"
60+
])
61+
62+
files = subprocess.check_output(
63+
["git", "ls-files", "*.py"]
64+
).decode("utf-8").splitlines()
65+
66+
files = [
67+
f for f in files
68+
if not f.startswith("thirdparty/")
69+
]
70+
71+
proc = subprocess.Popen(
72+
[sys.executable, "-m", "pyflakes"] + files,
73+
stdout=subprocess.PIPE,
74+
stderr=subprocess.STDOUT,
75+
)
76+
out, _ = proc.communicate()
77+
78+
text = out.decode("utf-8", "replace")
79+
lines = [
80+
line for line in text.splitlines()
81+
if " redefines " not in line
82+
]
83+
84+
if lines:
85+
print("\n".join(lines))
86+
sys.exit(1)
87+
88+
if proc.returncode not in (0, 1):
89+
if text:
90+
print(text)
91+
print("pyflakes failed unexpectedly with status %s" % proc.returncode)
92+
sys.exit(proc.returncode or 1)
93+
94+
print("pyflakes: clean")
95+
PY
96+
4097
- name: Basic import test
4198
run: python -c "import sqlmap; import sqlmapapi"
4299

100+
- name: Install optional test deps (lxml, jinja2)
101+
# lxml has no PyPy-2.7 wheel and 5.x is Py3-only, so it cannot be pip-installed there. The
102+
# tests that use it (test_xpath's real-XPath checks, and the --xpath/--ssti vuln-test
103+
# endpoints) skip themselves when the engine is unavailable, so these deps are only needed
104+
# on the Py3 jobs.
105+
if: matrix.python-version != 'pypy-2.7'
106+
run: python -m pip install -q lxml jinja2
107+
108+
- name: Unit tests
109+
# -B: do not write .pyc files. On Python 2 / PyPy a cached .pyc makes a module's __file__
110+
# point at the .pyc, which would make the later --smoke getFileType(__file__) doctest see
111+
# 'binary' instead of 'text'. Keeping this step byte-compile-free leaves --smoke clean.
112+
run: python -B -m unittest discover -s tests -p "test_*.py"
113+
114+
- name: Coverage
115+
if: matrix.python-version != 'pypy-2.7'
116+
run: |
117+
python -m pip install coverage
118+
python -m coverage run --source=lib,plugins,tamper -m unittest discover -s tests -p "test_*.py"
119+
python -m coverage run -a --source=lib,plugins,tamper sqlmap.py --doc-test
120+
python -m coverage report --fail-under=50
121+
43122
- name: Smoke test
44-
run: python sqlmap.py --smoke
123+
run: python sqlmap.py --smoke-test
124+
125+
- name: Payload lint
126+
# offline: emulates blind + UNION enumeration across all DBMSes and checks
127+
# every payload agent.py builds with lib/utils/sqllint (structural sanity)
128+
run: python sqlmap.py --payload-lint
45129

46130
- name: Vuln test
47-
run: python sqlmap.py --vuln
131+
run: python sqlmap.py --vuln-test
132+
133+
- name: API test
134+
run: python sqlmap.py --api-test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ extra/.DS_Store
1414
lib/.DS_Store
1515
plugins/.DS_Store
1616
thirdparty/.DS_Store
17+
CLAUDE.md
18+
.coverage

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Links
4747
* Frequently Asked Questions (FAQ): https://github.com/sqlmapproject/sqlmap/wiki/FAQ
4848
* X: [@sqlmap](https://x.com/sqlmap)
4949
* Demos: [https://www.youtube.com/user/inquisb/videos](https://www.youtube.com/user/inquisb/videos)
50+
* Playground: https://sekumart.sekuripy.hr
5051
* Screenshots: https://github.com/sqlmapproject/sqlmap/wiki/Screenshots
5152

5253
Translations

0 commit comments

Comments
 (0)