numasec 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. numasec-3.0.0/.gitignore +104 -0
  2. numasec-3.0.0/CHANGELOG.md +116 -0
  3. numasec-3.0.0/LICENSE +46 -0
  4. numasec-3.0.0/PKG-INFO +306 -0
  5. numasec-3.0.0/README.md +260 -0
  6. numasec-3.0.0/pyproject.toml +140 -0
  7. numasec-3.0.0/src/numasec/__init__.py +10 -0
  8. numasec-3.0.0/src/numasec/__main__.py +125 -0
  9. numasec-3.0.0/src/numasec/agent.py +741 -0
  10. numasec-3.0.0/src/numasec/chains.py +162 -0
  11. numasec-3.0.0/src/numasec/cli.py +921 -0
  12. numasec-3.0.0/src/numasec/config.py +208 -0
  13. numasec-3.0.0/src/numasec/context.py +261 -0
  14. numasec-3.0.0/src/numasec/cost_tracker.py +148 -0
  15. numasec-3.0.0/src/numasec/demo.py +422 -0
  16. numasec-3.0.0/src/numasec/error_recovery.py +443 -0
  17. numasec-3.0.0/src/numasec/extractors.py +534 -0
  18. numasec-3.0.0/src/numasec/few_shot_examples.py +505 -0
  19. numasec-3.0.0/src/numasec/knowledge/__init__.py +1 -0
  20. numasec-3.0.0/src/numasec/knowledge/advanced_privesc.md +257 -0
  21. numasec-3.0.0/src/numasec/knowledge/attack_chains/lfi_to_rce.md +129 -0
  22. numasec-3.0.0/src/numasec/knowledge/attack_chains/sqli_to_rce.md +134 -0
  23. numasec-3.0.0/src/numasec/knowledge/attack_chains/ssti_to_rce.md +164 -0
  24. numasec-3.0.0/src/numasec/knowledge/attack_chains/upload_to_rce.md +212 -0
  25. numasec-3.0.0/src/numasec/knowledge/attack_decision_matrix.md +108 -0
  26. numasec-3.0.0/src/numasec/knowledge/binary/heap_exploitation.md +212 -0
  27. numasec-3.0.0/src/numasec/knowledge/binary/resources.md +83 -0
  28. numasec-3.0.0/src/numasec/knowledge/binary/rop_advanced.md +209 -0
  29. numasec-3.0.0/src/numasec/knowledge/blind_injection_techniques.md +230 -0
  30. numasec-3.0.0/src/numasec/knowledge/blockchain_cheatsheet.md +127 -0
  31. numasec-3.0.0/src/numasec/knowledge/cloud/cloud_exploitation.md +231 -0
  32. numasec-3.0.0/src/numasec/knowledge/crypto_cheatsheet.md +232 -0
  33. numasec-3.0.0/src/numasec/knowledge/enterprise/README.md +124 -0
  34. numasec-3.0.0/src/numasec/knowledge/enterprise/api_security.md +432 -0
  35. numasec-3.0.0/src/numasec/knowledge/enterprise/cloud_security.md +449 -0
  36. numasec-3.0.0/src/numasec/knowledge/enterprise/compliance_frameworks.md +332 -0
  37. numasec-3.0.0/src/numasec/knowledge/enterprise/owasp_top_10.md +295 -0
  38. numasec-3.0.0/src/numasec/knowledge/legacy/README.md +13 -0
  39. numasec-3.0.0/src/numasec/knowledge/linux_cheatsheet.md +301 -0
  40. numasec-3.0.0/src/numasec/knowledge/osint_cheatsheet.md +164 -0
  41. numasec-3.0.0/src/numasec/knowledge/payloads/TEMPLATE.md +48 -0
  42. numasec-3.0.0/src/numasec/knowledge/payloads/command_injection.md +130 -0
  43. numasec-3.0.0/src/numasec/knowledge/payloads/php_rce.md +165 -0
  44. numasec-3.0.0/src/numasec/knowledge/payloads/python_sandbox.md +168 -0
  45. numasec-3.0.0/src/numasec/knowledge/pwn_reverse_cheatsheet.md +222 -0
  46. numasec-3.0.0/src/numasec/knowledge/quick_wins.md +148 -0
  47. numasec-3.0.0/src/numasec/knowledge/ssti_advanced_bypasses.md +133 -0
  48. numasec-3.0.0/src/numasec/knowledge/volatility_cheatsheet.md +122 -0
  49. numasec-3.0.0/src/numasec/knowledge/web/payloads_deserialization.md +209 -0
  50. numasec-3.0.0/src/numasec/knowledge/web/payloads_file_upload.md +387 -0
  51. numasec-3.0.0/src/numasec/knowledge/web/payloads_graphql.md +401 -0
  52. numasec-3.0.0/src/numasec/knowledge/web/payloads_http_smuggling.md +207 -0
  53. numasec-3.0.0/src/numasec/knowledge/web/payloads_jwt.md +541 -0
  54. numasec-3.0.0/src/numasec/knowledge/web/payloads_ldap.md +143 -0
  55. numasec-3.0.0/src/numasec/knowledge/web/payloads_nosql.md +247 -0
  56. numasec-3.0.0/src/numasec/knowledge/web/payloads_prototype_pollution.md +209 -0
  57. numasec-3.0.0/src/numasec/knowledge/web/payloads_race_condition.md +165 -0
  58. numasec-3.0.0/src/numasec/knowledge/web/payloads_ssrf.md +189 -0
  59. numasec-3.0.0/src/numasec/knowledge/web/payloads_websocket.md +230 -0
  60. numasec-3.0.0/src/numasec/knowledge/web/payloads_xpath.md +140 -0
  61. numasec-3.0.0/src/numasec/knowledge/web/payloads_xxe.md +201 -0
  62. numasec-3.0.0/src/numasec/knowledge/web/race_conditions.md +160 -0
  63. numasec-3.0.0/src/numasec/knowledge/web_cheatsheet.md +366 -0
  64. numasec-3.0.0/src/numasec/knowledge/windows/active_directory.md +158 -0
  65. numasec-3.0.0/src/numasec/knowledge/windows/windows_cheatsheet.md +289 -0
  66. numasec-3.0.0/src/numasec/knowledge_loader.py +391 -0
  67. numasec-3.0.0/src/numasec/logging_config.py +115 -0
  68. numasec-3.0.0/src/numasec/planner.py +304 -0
  69. numasec-3.0.0/src/numasec/plugins.py +553 -0
  70. numasec-3.0.0/src/numasec/prompts/system.md +173 -0
  71. numasec-3.0.0/src/numasec/reflection.py +179 -0
  72. numasec-3.0.0/src/numasec/renderer.py +1435 -0
  73. numasec-3.0.0/src/numasec/report.py +1047 -0
  74. numasec-3.0.0/src/numasec/router.py +641 -0
  75. numasec-3.0.0/src/numasec/session.py +284 -0
  76. numasec-3.0.0/src/numasec/state.py +95 -0
  77. numasec-3.0.0/src/numasec/target_profile.py +354 -0
  78. numasec-3.0.0/src/numasec/theme.py +120 -0
  79. numasec-3.0.0/src/numasec/tools/__init__.py +618 -0
  80. numasec-3.0.0/src/numasec/tools/browser.py +1511 -0
  81. numasec-3.0.0/src/numasec/tools/browser_fallback.py +239 -0
  82. numasec-3.0.0/src/numasec/tools/exploit.py +354 -0
  83. numasec-3.0.0/src/numasec/tools/recon.py +616 -0
@@ -0,0 +1,104 @@
1
+ # ── Virtual environments ──
2
+ .venv/
3
+ venv/
4
+ ENV/
5
+ env/
6
+
7
+ # ── Node ──
8
+ node_modules/
9
+ package-lock.json
10
+
11
+ # ── Python bytecode & packaging ──
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+ *.egg-info/
16
+ *.egg
17
+ .eggs/
18
+ dist/
19
+ build/
20
+ *.so
21
+ .Python
22
+
23
+ # ── Testing & coverage ──
24
+ .pytest_cache/
25
+ .coverage
26
+ .coverage.*
27
+ htmlcov/
28
+ .tox/
29
+ .nox/
30
+
31
+ # ── Linters & type checkers ──
32
+ .ruff_cache/
33
+ .mypy_cache/
34
+
35
+ # ── Data files (local databases, sessions) ──
36
+ /data/
37
+ *.db
38
+ *.sqlite
39
+ *.sqlite3
40
+
41
+ # ── CTF artifacts (output files) ──
42
+ *_context.txt
43
+ *_extracted/
44
+ *_carved/
45
+ *_foremost/
46
+ *_http_objects/
47
+
48
+ # ── Generated reports ──
49
+ numasec_report_*
50
+
51
+ # ── IDE ──
52
+ .vscode/
53
+ .idea/
54
+ *.swp
55
+ *.swo
56
+ .github/copilot-instructions.md
57
+
58
+ # ── OS ──
59
+ .DS_Store
60
+ Thumbs.db
61
+
62
+ # ── Temp & log files ──
63
+ test.*
64
+ *.tmp
65
+ *.bak
66
+ *.log
67
+ *_results.txt
68
+ *_debug.txt
69
+ debug_*.txt
70
+ reproduction_*.txt
71
+
72
+ # ── Knowledge base cache ──
73
+ .numasec_kb_cache/
74
+ .numasec_vector_db/
75
+
76
+ # ── Workspace sessions (generated) ──
77
+ workspace/sessions/
78
+
79
+ # ── Binaries downloaded during CTF ──
80
+ *.elf
81
+ *.exe
82
+ *.dll
83
+
84
+ # ── Large files ──
85
+ *.raw
86
+ *.dd
87
+ *.img
88
+ *.vmem
89
+
90
+ # ── Secrets & runtime data ──
91
+ .env
92
+ .env.*
93
+ !.env.example
94
+ config.yaml
95
+ evidence/
96
+
97
+ # ── Private docs (not for public repo) ──
98
+ docs/STRATEGY.md
99
+ docs/LAUNCH_CONTENT.md
100
+ docs/notes/
101
+
102
+ # ── Misc ──
103
+ .trash/
104
+ .agent/
@@ -0,0 +1,116 @@
1
+ # Changelog
2
+
3
+ All notable changes to NumaSec will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [3.0.0] - 2026-02-05 🚀
11
+
12
+ ### The Great Refactor
13
+
14
+ **Complete rewrite from 41k lines to ~8k lines.** Simpler, faster, cheaper, smarter.
15
+
16
+ ### Architecture — v3 ReAct Agent
17
+
18
+ - **ReAct agent loop** — Structured reasoning with loop detection, adaptive timeouts, smart failure handling
19
+ - **Attack Planner** — 5-phase hierarchical plan (recon → enumeration → exploitation → post-exploit → reporting) with auto-advance
20
+ - **Target Profile** — Structured memory: ports, endpoints, technologies, credentials, vulnerability hypotheses
21
+ - **14 Auto-Extractors** — Parse tool output (nmap, httpx, nuclei, sqlmap, ffuf, etc.) into structured data automatically
22
+ - **Reflection Engine** — Strategic analysis after each tool call with tool-specific reflectors
23
+ - **14 Escalation Chains** — Pre-built attack chains (SQLi→RCE, LFI→RCE, SSTI→RCE, upload→RCE, etc.)
24
+ - **Knowledge Base** — 39 curated entries: cheatsheets, payloads, attack patterns, loaded on-demand with LRU cache
25
+ - **Task-Type LLM Routing** — 5 task types (PLANNING, TOOL_USE, ANALYSIS, REFLECTION, REPORT) routed to optimal model
26
+ - **Report Generator** — Professional MD/HTML/JSON with dark-theme HTML, remediation engine, CVSS mapping
27
+ - **Plugin System** — Extend with custom tools, chains, extractors via `~/.numasec/plugins/`
28
+ - **19 security tools** — Focused, not bloated
29
+ - **Multi-LLM support** — DeepSeek, Claude, OpenAI, Ollama with automatic fallback
30
+
31
+ ### New Modules
32
+
33
+ | Module | Purpose |
34
+ |--------|---------|
35
+ | `target_profile.py` | Structured memory (Port, Endpoint, Technology, Credential, VulnHypothesis) |
36
+ | `extractors.py` | 14 tool-output extractors → TargetProfile |
37
+ | `planner.py` | 5-phase hierarchical attack plan with PhaseStatus tracking |
38
+ | `reflection.py` | Strategic reflection with tool-specific analysis |
39
+ | `chains.py` | 14 escalation chains for confirmed vulnerabilities |
40
+ | `knowledge_loader.py` | On-demand knowledge loading with LRU cache (39 entries) |
41
+ | `report.py` | MD/HTML/JSON report generation with remediation guidance |
42
+ | `plugins.py` | Plugin discovery, loading, scaffolding |
43
+
44
+ ### SOTA Prompt Engineering
45
+
46
+ | Technique | Impact | Source |
47
+ |-----------|--------|--------|
48
+ | Few-Shot Examples | +55% tool accuracy | Brown et al. 2020 |
49
+ | Chain-of-Thought | -30% mistakes | Wei et al. 2022 |
50
+ | Self-Correction | +40% recovery | Shinn et al. 2023 |
51
+ | Error Recovery | +44% retry success | 23 patterns |
52
+ | Context Management | 0 API errors | Group-based trimming |
53
+
54
+ ### Tools (19 total)
55
+
56
+ **Recon:**
57
+ - `nmap` - Port scanning, service detection
58
+ - `httpx` - HTTP probing, tech fingerprinting
59
+ - `subfinder` - Subdomain enumeration
60
+ - `ffuf` - Directory/file fuzzing
61
+
62
+ **Web:**
63
+ - `http` - HTTP requests (SQLi, IDOR, auth bypass)
64
+ - `browser_navigate` - JavaScript pages (SPAs)
65
+ - `browser_fill` - Form testing, XSS payloads
66
+ - `browser_click` - Click elements (CSRF)
67
+ - `browser_screenshot` - Visual evidence
68
+ - `browser_login` - Authenticated testing
69
+ - `browser_get_cookies` - Session analysis
70
+ - `browser_set_cookies` - Session hijacking
71
+ - `browser_clear_session` - Fresh sessions
72
+
73
+ **Exploit:**
74
+ - `nuclei` - CVE scanning
75
+ - `sqlmap` - SQL injection
76
+ - `run_exploit` - Custom exploit execution (Python/curl/scripts)
77
+
78
+ **Core:**
79
+ - `read_file` - Read files
80
+ - `write_file` - Write evidence
81
+ - `run_command` - Shell commands
82
+
83
+ ### Features
84
+
85
+ - **Browser automation** - Playwright for XSS testing with screenshots
86
+ - **Session persistence** - Resume pentests with `/resume`
87
+ - **Cost tracking** - Real-time cost display, budget limits
88
+ - **Cyberpunk CLI** - Beautiful Rich TUI
89
+ - **Context trimming** - Group-based, never breaks tool sequences
90
+
91
+ ### Removed
92
+
93
+ - ❌ MCP protocol (unnecessary complexity)
94
+ - ❌ LanceDB/vector storage (not needed)
95
+ - ❌ Multi-agent architecture (too expensive)
96
+ - ❌ 28 tools → 17 (focused set)
97
+ - ❌ 41k lines → 6k lines
98
+
99
+ ### Cost
100
+
101
+ | Provider | Avg Cost/Pentest |
102
+ |----------|------------------|
103
+ | DeepSeek | $0.12 |
104
+ | Claude | $0.50 |
105
+ | OpenAI | $0.80 |
106
+
107
+ ---
108
+
109
+ ## [2.x] - Legacy
110
+
111
+ Previous versions used MCP architecture with 28+ tools and ~41k lines of code.
112
+ Deprecated in favor of simpler single-agent design.
113
+
114
+ ---
115
+
116
+ [3.0.0]: https://github.com/FrancescoStabile/numasec/releases/tag/v3.0.0
numasec-3.0.0/LICENSE ADDED
@@ -0,0 +1,46 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Francesco Stabile
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ SECURITY TOOL DISCLAIMER
26
+
27
+ This software is a penetration testing tool designed for authorized security
28
+ assessments only. By using this software, you acknowledge and agree that:
29
+
30
+ 1. You will only use this software on systems you own or have explicit written
31
+ authorization to test.
32
+ 2. You are solely responsible for ensuring your use complies with all applicable
33
+ laws, including but not limited to the Computer Fraud and Abuse Act (CFAA),
34
+ Computer Misuse Act, and similar legislation in your jurisdiction.
35
+ 3. The authors and contributors are not responsible for any misuse of this
36
+ software or any damages, legal consequences, or liabilities arising from
37
+ its use.
38
+ 4. Unauthorized access to computer systems is a criminal offense. The authors
39
+ do not condone, encourage, or support any illegal activities.
40
+
41
+ ---
42
+
43
+ Trademark Notice: The "NumaSec" name and logo are trademarks of Francesco Stabile
44
+ and are not covered by the MIT license above. You may not use the NumaSec name
45
+ or logo to endorse or promote products derived from this software without prior
46
+ written permission.
numasec-3.0.0/PKG-INFO ADDED
@@ -0,0 +1,306 @@
1
+ Metadata-Version: 2.4
2
+ Name: numasec
3
+ Version: 3.0.0
4
+ Summary: AI security testing for apps. Paste a URL, get a full security report. Like having a pentester on your team for $0.12.
5
+ Project-URL: Homepage, https://github.com/FrancescoStabile/numasec
6
+ Project-URL: Documentation, https://github.com/FrancescoStabile/numasec/blob/main/docs/ARCHITECTURE.md
7
+ Project-URL: Repository, https://github.com/FrancescoStabile/numasec
8
+ Project-URL: Issues, https://github.com/FrancescoStabile/numasec/issues
9
+ Project-URL: Changelog, https://github.com/FrancescoStabile/numasec/blob/main/CHANGELOG.md
10
+ Author-email: Francesco Stabile <francesco.stabile.dev@gmail.com>
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: ai,ai-security,app-security,claude,cybersecurity,deepseek,llm,pentesting,playwright,security,security-check,security-testing,vibe-security,vulnerability-scanner,web-security
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Information Technology
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: MacOS
20
+ Classifier: Operating System :: POSIX :: Linux
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Topic :: Security
27
+ Classifier: Topic :: Software Development :: Testing
28
+ Classifier: Typing :: Typed
29
+ Requires-Python: >=3.11
30
+ Requires-Dist: httpx>=0.27.0
31
+ Requires-Dist: playwright>=1.40.0
32
+ Requires-Dist: prompt-toolkit>=3.0.43
33
+ Requires-Dist: python-dotenv>=1.0.0
34
+ Requires-Dist: pyyaml>=6.0.0
35
+ Requires-Dist: rich>=13.7.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: mypy>=1.9.0; extra == 'dev'
38
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
39
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
40
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
41
+ Requires-Dist: ruff>=0.3.0; extra == 'dev'
42
+ Provides-Extra: docs
43
+ Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
44
+ Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
45
+ Description-Content-Type: text/markdown
46
+
47
+ <div align="center">
48
+
49
+ # Numasec
50
+
51
+ ### Vibe coding changed how we build. Numasec changes how we secure it.
52
+
53
+ One command. Real vulnerabilities. Full report. **$0.12.**
54
+
55
+ <img src="docs/assets/demo.gif" alt="Numasec Demo" width="700">
56
+
57
+ *Numasec autonomously finding 8 vulnerabilities in [OWASP Juice Shop](https://owasp.org/www-project-juice-shop/) — a deliberately insecure web app used as a security training benchmark.*
58
+
59
+ [![$0.12/scan](https://img.shields.io/badge/cost-$0.12%2Fscan-58a6ff?style=flat-square&labelColor=0d1117)](#quick-start)
60
+ [![Autonomous Agent](https://img.shields.io/badge/agent-fully_autonomous-8b5cf6?style=flat-square&labelColor=0d1117)](#how-it-works)
61
+ [![Bring Your Own LLM](https://img.shields.io/badge/LLM-bring_your_own-f97316?style=flat-square&labelColor=0d1117)](#quick-start)
62
+ [![MIT License](https://img.shields.io/badge/license-MIT-6b7280?style=flat-square&labelColor=0d1117)](LICENSE)
63
+
64
+ </div>
65
+
66
+ ---
67
+
68
+ You describe the target. Numasec figures out how to break in — planning the attack, picking techniques, adapting on the fly, and writing the report. No security expertise. No config files. No $10K consultant.
69
+
70
+ ```bash
71
+ pip install numasec && numasec --demo
72
+ ```
73
+
74
+ ```
75
+ λ check http://localhost:3000 for security issues
76
+
77
+ ◉ SCANNING
78
+ http://localhost:3000
79
+
80
+ ── [1] http → GET http://localhost:3000/
81
+ │ 200
82
+ │ server: Express
83
+ │ x-powered-by: Express
84
+ └─ 0.1s
85
+
86
+ ── [2] http → GET http://localhost:3000/.env
87
+ │ 200
88
+ │ DATABASE_URL=postgresql://admin:supersecret@db:5432/myapp
89
+ │ JWT_SECRET=mysecretkey123
90
+ └─ 0.2s
91
+
92
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
93
+ ▲▲ CRITICAL — Environment File Exposed
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+ │ The .env file is publicly accessible. It contains the
96
+ │ database password, JWT secret, and API keys. Anyone can
97
+ │ read them.
98
+
99
+ │ Evidence: GET /.env → 200 OK with credentials
100
+ │ Fix: Block .env in Express static config
101
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
102
+
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ ▲▲ CRITICAL — SQL Injection in Login
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+ │ The login endpoint doesn't sanitize input. A single
107
+ │ payload bypasses authentication and grants admin access
108
+ │ to any account.
109
+
110
+ │ Payload: ' OR '1'='1
111
+ │ Evidence: POST /api/auth/login → 200 OK with admin token
112
+ │ Fix: Use parameterized queries (Prisma/Sequelize)
113
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
114
+
115
+ ┌──────────────────────────────────────────────────────┐
116
+ │ ASSESSMENT COMPLETE │
117
+ │ │
118
+ │ Target: http://localhost:3000 │
119
+ │ Duration: 4m 23s │
120
+ │ Cost: $0.12 │
121
+ │ │
122
+ │ ▲▲ 2 CRITICAL ▲ 1 HIGH │
123
+ │ ■ 1 MEDIUM ● 1 LOW │
124
+ │ │
125
+ │ Risk Level: CRITICAL │
126
+ │ │
127
+ │ Critical security issues detected — immediate │
128
+ │ action required. Fix critical findings first. │
129
+ └──────────────────────────────────────────────────────┘
130
+ ```
131
+
132
+ ---
133
+
134
+ ## What It Finds
135
+
136
+ Numasec doesn't just scan — it thinks. It plans an attack strategy, picks the right tools, adapts based on what it discovers, and escalates when it finds something real.
137
+
138
+ | What it tests | How |
139
+ |--------------|-----|
140
+ | **Exposed secrets** — .env files, API keys, credentials in source | HTTP probing, directory fuzzing |
141
+ | **SQL injection** — auth bypass, data extraction, blind injection | Manual payloads → sqlmap escalation |
142
+ | **XSS** — reflected, stored, DOM-based in forms and search fields | Playwright browser automation with screenshots |
143
+ | **Misconfigurations** — missing headers, debug mode, stack traces | Response analysis, technology fingerprinting |
144
+ | **Known CVEs** — outdated frameworks, vulnerable dependencies | Nuclei templates, version detection |
145
+ | **Auth flaws** — default creds, IDOR, broken access controls | Login testing, session analysis |
146
+
147
+ Every finding comes with evidence and a fix — not just "vulnerability found", but *what's wrong*, *why it matters*, and *exactly how to fix it*.
148
+
149
+ ---
150
+
151
+ ## Quick Start
152
+
153
+ ```bash
154
+ pip install numasec
155
+ ```
156
+
157
+ **See it work instantly** — no API key, no target, no setup:
158
+
159
+ ```bash
160
+ numasec --demo
161
+ ```
162
+
163
+ **Run it for real** — set one API key and go:
164
+
165
+ ```bash
166
+ export DEEPSEEK_API_KEY="sk-..." # ~$0.12/scan, 1M free tokens for new accounts
167
+ numasec
168
+ ```
169
+
170
+ That's it. Paste a URL, describe what to test, and Numasec handles the rest.
171
+
172
+ <details>
173
+ <summary><b>More options</b> — Claude, OpenAI, Ollama, browser mode, security tools</summary>
174
+
175
+ ```bash
176
+ # AI providers (set any combination — automatic fallback)
177
+ export DEEPSEEK_API_KEY="sk-..." # Cheapest (~$0.12/scan)
178
+ export ANTHROPIC_API_KEY="sk-ant-..." # Best reasoning
179
+ export OPENAI_API_KEY="sk-..." # General purpose
180
+ # Ollama detected automatically if running locally (free)
181
+
182
+ # Browser automation — XSS testing, form filling, visual evidence
183
+ playwright install chromium
184
+
185
+ # Security scanners — advanced vulnerability detection
186
+ sudo apt install nmap sqlmap
187
+ # nuclei: https://github.com/projectdiscovery/nuclei
188
+
189
+ # Usage
190
+ numasec # Interactive mode
191
+ numasec check http://localhost:3000 # One-shot check
192
+ numasec --show-browser # Watch the browser in real-time
193
+ numasec --budget 5.0 # Set cost limit
194
+ numasec --resume <session-id> # Resume a previous session
195
+ ```
196
+
197
+ </details>
198
+
199
+ ---
200
+
201
+ ## The Report
202
+
203
+ Every assessment produces a professional HTML report — dark theme, severity donut chart, evidence blocks, remediation steps. Share it with your team, attach it to a ticket, or hand it to an AI to fix the code.
204
+
205
+ <div align="center">
206
+ <img src="docs/assets/report.gif" alt="Numasec Security Report" width="700">
207
+ </div>
208
+
209
+ ---
210
+
211
+ ## How It Works
212
+
213
+ ```
214
+ You describe the target
215
+ → AI plans the attack (discovery → mapping → testing → exploitation → results)
216
+ → Picks the right tool for each step (19 tools: nmap, sqlmap, Playwright, nuclei...)
217
+ → Analyzes results, generates hypotheses, adapts the plan
218
+ → Confirmed findings documented with evidence and fixes
219
+ → Professional report generated automatically
220
+ ```
221
+
222
+ It's not a scanner. It's not a ChatGPT wrapper. It's an autonomous agent with structured memory, attack planning, 14 result extractors, 14 escalation chains, and a 46-file knowledge base — all orchestrated by a ReAct loop that thinks before it acts.
223
+
224
+ <details>
225
+ <summary><b>Architecture deep dive</b></summary>
226
+
227
+ ```
228
+ cli.py → Interactive REPL with real-time streaming
229
+ agent.py → ReAct loop (50 iterations, loop detection, circuit breaker)
230
+ router.py → Multi-provider LLM routing (DeepSeek → Claude → OpenAI → Ollama)
231
+ planner.py → 5-phase attack plan (discovery → mapping → testing → analysis → results)
232
+ state.py → Structured memory (TargetProfile with ports, endpoints, technologies)
233
+ extractors.py → 14 extractors parse tool output into structured data automatically
234
+ reflection.py → 7 tool-specific analyzers guide what to check next
235
+ chains.py → 14 escalation chains (SQLi→RCE, LFI→RCE, SSTI→RCE, XSS→session theft...)
236
+ knowledge/ → 46 attack patterns, cheatsheets, and payload references
237
+ report.py → Reports in Markdown, HTML, and JSON
238
+ plugins.py → Extend with custom tools, chains, and extractors
239
+ renderer.py → Terminal UI with character-by-character streaming
240
+ ```
241
+
242
+ 12,000+ lines of Python. 170+ tests. 5 core dependencies.
243
+
244
+ See [ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full technical breakdown.
245
+
246
+ </details>
247
+
248
+ <details>
249
+ <summary><b>Python API</b></summary>
250
+
251
+ ```python
252
+ from numasec.agent import Agent
253
+ from numasec.router import LLMRouter, Provider
254
+ from numasec.tools import create_tool_registry
255
+ from numasec.state import State
256
+
257
+ router = LLMRouter(primary=Provider.DEEPSEEK)
258
+ tools = create_tool_registry()
259
+ state = State()
260
+ agent = Agent(router=router, tools=tools, state=state)
261
+
262
+ async for event in agent.run("find SQLi in localhost:3000"):
263
+ if event.type == "text":
264
+ print(event.content, end="")
265
+ elif event.type == "finding":
266
+ print(f"Found: {event.finding.title}")
267
+ ```
268
+
269
+ </details>
270
+
271
+ ---
272
+
273
+ ## Legal
274
+
275
+ **Only test apps you own or have explicit permission to test.** Numasec is a security tool — use it responsibly.
276
+
277
+ ✅ Your own apps, staging/production environments, bug bounty targets, practice labs (DVWA, Juice Shop, HackTheBox)
278
+
279
+ ❌ Other people's apps without written authorization
280
+
281
+ ---
282
+
283
+ ## Roadmap
284
+
285
+ - Parallel tool execution (asyncio.gather for independent scans)
286
+ - LLM-powered planning (adaptive strategies based on target type)
287
+ - Benchmark suite (automated scoring against DVWA, Juice Shop, WebGoat)
288
+ - CI/CD integration (security gates in deployment pipelines)
289
+ - MCP integration (Model Context Protocol for tool interoperability)
290
+
291
+ See [VISION.md](docs/notes/VISION.md) for the full technical blueprint.
292
+
293
+ ---
294
+
295
+ ## Contributing
296
+
297
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Issues, PRs, and feedback welcome.
298
+
299
+ ---
300
+
301
+ **Built by [Francesco Stabile](https://www.linkedin.com/in/francesco-stabile-dev)** — making security accessible to every developer.
302
+
303
+ [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=flat-square&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/francesco-stabile-dev)
304
+ [![X](https://img.shields.io/badge/X-000000?style=flat-square&logo=x&logoColor=white)](https://x.com/Francesco_Sta)
305
+
306
+ [MIT License](LICENSE)