Skip to content

Commit be7d055

Browse files
committed
feat(recon): Implement advanced path and parameter fuzzing
- Added extended version identification (/v2/, /beta/, etc) - Added file extension fuzzing (.json, .bak, .old) - Added shadow admin path fuzzing (/admin, /system) - Injected edge-case anomalies into parameters (0, 999999, SQLi/LFI snippets)
1 parent d7f25ce commit be7d055

1 file changed

Lines changed: 42 additions & 6 deletions

File tree

src/secnodeapi/services/recon.py

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,35 @@ def _mutate_path(path: str) -> List[str]:
1717
"""Generate potential hidden paths based on existing routes."""
1818
mutations: Set[str] = set()
1919
stripped = path.rstrip("/")
20+
21+
# Version mutations
2022
if "/v1/" in stripped:
21-
mutations.add(stripped.replace("/v1/", "/v2/", 1))
22-
mutations.add(stripped.replace("/v1/", "/internal/", 1))
23-
if not stripped.endswith("/admin"):
24-
mutations.add(f"{stripped}/admin")
23+
for ver in ("/v2/", "/v3/", "/beta/", "/dev/", "/internal/"):
24+
mutations.add(stripped.replace("/v1/", ver, 1))
25+
26+
# Extension mutations
27+
if "." not in stripped.split("/")[-1]:
28+
for ext in (".json", ".xml", ".yaml", ".bak", ".old"):
29+
mutations.add(f"{stripped}{ext}")
30+
31+
# Admin & Shadow directory mutations
32+
if not any(x in stripped for x in ("/admin", "/administrator", "/manager", "/config")):
33+
for shadow in ("/admin", "/administrator", "/manager", "/config", "/system"):
34+
mutations.add(f"{stripped}{shadow}")
35+
36+
# ID & Injection mutations
2537
if "{id}" in stripped:
26-
mutations.add(stripped.replace("{id}", "1"))
27-
mutations.add(stripped.replace("{id}", "2"))
38+
for inject in (
39+
"1",
40+
"2",
41+
"0",
42+
"999999",
43+
"00000000-0000-0000-0000-000000000000",
44+
"../../etc/passwd",
45+
"' OR 1=1--"
46+
):
47+
mutations.add(stripped.replace("{id}", inject))
48+
2849
return [m for m in mutations if m and m != path]
2950

3051

@@ -71,6 +92,21 @@ def _build_discovery_tests(endpoints: List[APIEndpoint]) -> List[TestCase]:
7192
)
7293
)
7394
idx += 1
95+
96+
# Probe for hidden parameters on existing GET paths
97+
if "GET" in known_methods:
98+
discovery_tests.append(
99+
TestCase(
100+
id=f"PARAM-FUZZ-{idx}",
101+
name="Parameter Discovery",
102+
description="Probe for hidden debug or admin parameters",
103+
owasp_category="API9: Improper Inventory Management",
104+
endpoint=path,
105+
method="GET",
106+
params={"debug": "true", "admin": "1", "test": "true"}
107+
)
108+
)
109+
idx += 1
74110

75111
return discovery_tests
76112

0 commit comments

Comments
 (0)