exploitgraph 1.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 (48) hide show
  1. exploitgraph-1.0.0/LICENSE +21 -0
  2. exploitgraph-1.0.0/PKG-INFO +429 -0
  3. exploitgraph-1.0.0/README.md +383 -0
  4. exploitgraph-1.0.0/core/__init__.py +0 -0
  5. exploitgraph-1.0.0/core/attack_graph.py +83 -0
  6. exploitgraph-1.0.0/core/aws_client.py +284 -0
  7. exploitgraph-1.0.0/core/config.py +83 -0
  8. exploitgraph-1.0.0/core/console.py +469 -0
  9. exploitgraph-1.0.0/core/context_engine.py +172 -0
  10. exploitgraph-1.0.0/core/correlator.py +476 -0
  11. exploitgraph-1.0.0/core/http_client.py +243 -0
  12. exploitgraph-1.0.0/core/logger.py +97 -0
  13. exploitgraph-1.0.0/core/module_loader.py +69 -0
  14. exploitgraph-1.0.0/core/risk_engine.py +47 -0
  15. exploitgraph-1.0.0/core/session_manager.py +254 -0
  16. exploitgraph-1.0.0/exploitgraph.egg-info/PKG-INFO +429 -0
  17. exploitgraph-1.0.0/exploitgraph.egg-info/SOURCES.txt +46 -0
  18. exploitgraph-1.0.0/exploitgraph.egg-info/dependency_links.txt +1 -0
  19. exploitgraph-1.0.0/exploitgraph.egg-info/entry_points.txt +2 -0
  20. exploitgraph-1.0.0/exploitgraph.egg-info/requires.txt +21 -0
  21. exploitgraph-1.0.0/exploitgraph.egg-info/top_level.txt +2 -0
  22. exploitgraph-1.0.0/modules/__init__.py +0 -0
  23. exploitgraph-1.0.0/modules/base.py +82 -0
  24. exploitgraph-1.0.0/modules/cloud/__init__.py +0 -0
  25. exploitgraph-1.0.0/modules/cloud/aws_credential_validator.py +340 -0
  26. exploitgraph-1.0.0/modules/cloud/azure_enum.py +289 -0
  27. exploitgraph-1.0.0/modules/cloud/cloudtrail_analyzer.py +494 -0
  28. exploitgraph-1.0.0/modules/cloud/gcp_enum.py +272 -0
  29. exploitgraph-1.0.0/modules/cloud/iam_enum.py +321 -0
  30. exploitgraph-1.0.0/modules/cloud/iam_privilege_escalation.py +515 -0
  31. exploitgraph-1.0.0/modules/cloud/metadata_check.py +315 -0
  32. exploitgraph-1.0.0/modules/cloud/s3_enum.py +469 -0
  33. exploitgraph-1.0.0/modules/discovery/__init__.py +0 -0
  34. exploitgraph-1.0.0/modules/discovery/http_enum.py +235 -0
  35. exploitgraph-1.0.0/modules/discovery/subdomain_enum.py +260 -0
  36. exploitgraph-1.0.0/modules/exploitation/__init__.py +0 -0
  37. exploitgraph-1.0.0/modules/exploitation/api_exploit.py +403 -0
  38. exploitgraph-1.0.0/modules/exploitation/jwt_attack.py +346 -0
  39. exploitgraph-1.0.0/modules/exploitation/ssrf_scanner.py +258 -0
  40. exploitgraph-1.0.0/modules/reporting/__init__.py +0 -0
  41. exploitgraph-1.0.0/modules/reporting/html_report.py +446 -0
  42. exploitgraph-1.0.0/modules/reporting/json_export.py +107 -0
  43. exploitgraph-1.0.0/modules/secrets/__init__.py +0 -0
  44. exploitgraph-1.0.0/modules/secrets/file_secrets.py +358 -0
  45. exploitgraph-1.0.0/modules/secrets/git_secrets.py +267 -0
  46. exploitgraph-1.0.0/pyproject.toml +58 -0
  47. exploitgraph-1.0.0/setup.cfg +4 -0
  48. exploitgraph-1.0.0/tests/test_exploitgraph.py +524 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Prajwal Pawar
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.
@@ -0,0 +1,429 @@
1
+ Metadata-Version: 2.4
2
+ Name: exploitgraph
3
+ Version: 1.0.0
4
+ Summary: Automated attack path discovery and exploitation framework for cloud-native applications
5
+ Author-email: Prajwal Pawar <prajwal@exploitgraph.io>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/prajwalpawar/ExploitGraph
8
+ Project-URL: Repository, https://github.com/prajwalpawar/ExploitGraph
9
+ Project-URL: Bug Tracker, https://github.com/prajwalpawar/ExploitGraph/issues
10
+ Project-URL: Documentation, https://github.com/prajwalpawar/ExploitGraph/wiki
11
+ Keywords: security,pentesting,cloud,aws,attack-path,exploitation
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Information Technology
14
+ Classifier: Topic :: Security
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Environment :: Console
22
+ Classifier: Operating System :: POSIX :: Linux
23
+ Classifier: Operating System :: MacOS
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: requests>=2.31.0
28
+ Requires-Dist: colorama>=0.4.6
29
+ Requires-Dist: networkx>=3.2.0
30
+ Requires-Dist: jinja2>=3.1.2
31
+ Requires-Dist: PyJWT>=2.8.0
32
+ Requires-Dist: python-dotenv>=1.0.0
33
+ Requires-Dist: tabulate>=0.9.0
34
+ Requires-Dist: pyyaml>=6.0
35
+ Provides-Extra: aws
36
+ Requires-Dist: boto3>=1.34.0; extra == "aws"
37
+ Requires-Dist: botocore>=1.34.0; extra == "aws"
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=7.0; extra == "dev"
40
+ Requires-Dist: black>=23.0; extra == "dev"
41
+ Requires-Dist: flake8>=6.0; extra == "dev"
42
+ Requires-Dist: mypy>=1.0; extra == "dev"
43
+ Provides-Extra: all
44
+ Requires-Dist: exploitgraph[aws,dev]; extra == "all"
45
+ Dynamic: license-file
46
+
47
+ # ExploitGraph
48
+
49
+ <div align="center">
50
+
51
+ ```
52
+ ███████╗██╗ ██╗██████╗ ██╗ ██████╗ ██╗████████╗ ██████╗ ██████╗ █████╗ ██████╗ ██╗ ██╗
53
+ ██╔════╝╚██╗██╔╝██╔══██╗██║ ██╔═══██╗██║╚══██╔══╝██╔════╝ ██╔══██╗██╔══██╗██╔══██╗██║ ██║
54
+ █████╗ ╚███╔╝ ██████╔╝██║ ██║ ██║██║ ██║ ██║ ███╗██████╔╝███████║██████╔╝███████║
55
+ ██╔══╝ ██╔██╗ ██╔═══╝ ██║ ██║ ██║██║ ██║ ██║ ██║██╔══██╗██╔══██║██╔═══╝ ██╔══██║
56
+ ███████╗██╔╝ ██╗██║ ███████╗╚██████╔╝██║ ██║ ╚██████╔╝██║ ██║██║ ██║██║ ██║ ██║
57
+ ╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
58
+ ```
59
+
60
+ **Automated Attack Path Discovery & Exploitation Framework**
61
+
62
+ [![Python](https://img.shields.io/badge/Python-3.9%2B-blue?logo=python)](https://python.org)
63
+ [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
64
+ [![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS-lightgrey)](https://github.com/prajwalpawar/ExploitGraph)
65
+ [![Modules](https://img.shields.io/badge/Modules-8%2B-red)](modules/)
66
+ [![AWS](https://img.shields.io/badge/AWS-Cloud%20Security-orange?logo=amazon-aws)](modules/cloud/)
67
+
68
+ </div>
69
+
70
+ ---
71
+
72
+ ## What is ExploitGraph?
73
+
74
+ ExploitGraph is a **modular, open-source attack path discovery framework** that automatically chains cloud misconfigurations, exposed secrets, and application vulnerabilities into a complete kill chain — starting from **zero prior knowledge**.
75
+
76
+ Unlike tools that require credentials first (Pacu) or only audit configurations (Prowler/ScoutSuite), ExploitGraph **starts from nothing** and discovers everything it needs:
77
+
78
+ ```
79
+ Cloud Misconfiguration → Data Exposure → Secret Leakage → API Abuse → Full Compromise
80
+ ```
81
+
82
+ Every step is visualized as an interactive attack graph with MITRE ATT&CK mappings and AWS remediation commands.
83
+
84
+ ### How it differs from existing tools
85
+
86
+ | Tool | Starting Point | Output | Attack Chain |
87
+ |------|---------------|--------|--------------|
88
+ | **Pacu** | Needs IAM credentials | Module results | No chaining |
89
+ | **Prowler** | Needs AWS credentials | Audit findings | No chaining |
90
+ | **ScoutSuite** | Needs AWS credentials | Config report | No chaining |
91
+ | **TruffleHog** | Git repo / S3 bucket | Secret list | No chaining |
92
+ | **ExploitGraph** | **Just a URL** | **Full kill chain + visual graph** | **Automated** |
93
+
94
+ ---
95
+
96
+ ## Features
97
+
98
+ - **msfconsole-style interactive shell** with tab completion
99
+ - **8+ modular attack modules** across discovery, cloud, secrets, exploitation, reporting
100
+ - **Generic — works against any target** (not limited to fintech or specific apps)
101
+ - **Wordlist-driven discovery** — no hardcoded paths
102
+ - **20+ secret patterns** including AWS keys, JWT secrets, Stripe keys, GitHub tokens
103
+ - **Optional boto3 AWS integration** — real S3 ACL checks, IAM enumeration, MFA detection
104
+ - **JWT attack engine** — none-algorithm bypass, weak secret bruteforce
105
+ - **Interactive D3.js attack graph** in HTML report
106
+ - **CVSS scoring** per finding + session risk score (0-10)
107
+ - **MITRE ATT&CK for Cloud** mapping
108
+ - **Multi-session SQLite persistence** — resume scans across sessions
109
+ - **Offensive and defensive modes**
110
+ - **pip-installable** Python package
111
+
112
+ ---
113
+
114
+ ## Installation
115
+
116
+ ### Quick Start
117
+ ```bash
118
+ git clone https://github.com/prajwalpawar/ExploitGraph.git
119
+ cd ExploitGraph
120
+ pip install -r requirements.txt
121
+ python3 exploitgraph.py
122
+ ```
123
+
124
+ ### With AWS Support
125
+ ```bash
126
+ pip install -r requirements.txt
127
+ pip install boto3 botocore
128
+ ```
129
+
130
+ ### Requirements
131
+ - Python 3.9+
132
+ - Linux / macOS (Kali Linux recommended)
133
+ - No AWS credentials required for HTTP-mode scanning
134
+
135
+ ---
136
+
137
+ ## Usage
138
+
139
+ ### Interactive Console
140
+ ```bash
141
+ python3 exploitgraph.py
142
+ ```
143
+
144
+ ```
145
+ exploitgraph> workspace new pentest http://target.com
146
+ exploitgraph> run auto
147
+ ```
148
+
149
+ ### CLI Mode
150
+ ```bash
151
+ # Full automated attack chain
152
+ python3 exploitgraph.py -t http://target.com --auto
153
+
154
+ # Single module
155
+ python3 exploitgraph.py -t http://target.com -m cloud/s3_enum
156
+
157
+ # Defensive audit mode (no exploitation)
158
+ python3 exploitgraph.py -t http://target.com --mode defensive --auto
159
+
160
+ # List all modules
161
+ python3 exploitgraph.py --list-modules
162
+ ```
163
+
164
+ ### Console Commands
165
+ ```
166
+ SESSION
167
+ workspace new <name> <url> Create workspace
168
+ set TARGET http://target.com Set target
169
+ set MODE offensive|defensive Set mode
170
+
171
+ MODULES
172
+ show modules List all modules by category
173
+ use discovery/http_enum Select a module
174
+ options Show module options
175
+ set OPTION value Configure option
176
+ run Execute module
177
+ run auto Full attack chain
178
+ back Deselect module
179
+
180
+ INFORMATION
181
+ show findings Security findings
182
+ show secrets Extracted credentials
183
+ show attack-path ASCII kill chain
184
+ show summary Risk score + stats
185
+ info <module> Module details
186
+ search <keyword> Search modules
187
+
188
+ OUTPUT
189
+ export html HTML report with D3.js graph
190
+ export json JSON for SIEM integration
191
+ export all All formats
192
+
193
+ SESSION MANAGEMENT
194
+ sessions List sessions
195
+ sessions -i <id> Switch session
196
+ sessions -k <id> Kill session
197
+ ```
198
+
199
+ ---
200
+
201
+ ## Modules
202
+
203
+ ### Discovery
204
+ | Module | Description | MITRE |
205
+ |--------|-------------|-------|
206
+ | `discovery/http_enum` | Wordlist-driven endpoint enumeration + tech fingerprinting | T1595.003 |
207
+
208
+ ### Cloud
209
+ | Module | Description | MITRE |
210
+ |--------|-------------|-------|
211
+ | `cloud/s3_enum` | S3 bucket discovery, public ACL detection, file download + boto3 audit | T1530 |
212
+ | `cloud/iam_enum` | IAM user/role enumeration, MFA checks, policy analysis (requires boto3) | T1580, T1078.004 |
213
+
214
+ ### Secrets
215
+ | Module | Description | MITRE |
216
+ |--------|-------------|-------|
217
+ | `secrets/file_secrets` | 20+ pattern regex scanner + Shannon entropy detection | T1552.001 |
218
+
219
+ ### Exploitation
220
+ | Module | Description | MITRE |
221
+ |--------|-------------|-------|
222
+ | `exploitation/api_exploit` | Generic credential testing, admin access, privilege escalation | T1078.004 |
223
+ | `exploitation/jwt_attack` | None-algorithm bypass, weak secret bruteforce, algorithm confusion | T1078, T1550.001 |
224
+
225
+ ### Reporting
226
+ | Module | Description |
227
+ |--------|-------------|
228
+ | `reporting/html_report` | Interactive HTML report with D3.js attack graph, CVSS scores, MITRE mapping |
229
+ | `reporting/json_export` | Structured JSON for SIEM/ticketing integration |
230
+
231
+ ---
232
+
233
+ ## Secret Patterns (20+)
234
+
235
+ ExploitGraph detects the following credential types:
236
+
237
+ ```
238
+ AWS Access Key ID AKIA[0-9A-Z]{16}
239
+ AWS Secret Access Key aws_secret_access_key = ...
240
+ JWT Secret jwt_secret_key = ...
241
+ Generic API Key api_key = ...
242
+ Stripe Live Key sk_live_...
243
+ GitHub Token ghp_...
244
+ Google API Key AIza...
245
+ SendGrid API Key SG....
246
+ Slack Token xox[baprs]-...
247
+ Database Password db_password = ...
248
+ Database URL postgresql://user:pass@host
249
+ Private Key -----BEGIN RSA PRIVATE KEY-----
250
+ Bearer Token Authorization: Bearer ...
251
+ Encryption Key aes_key = [hex]
252
+ Admin Credentials admin password = ...
253
+ Twilio SID AC[a-z0-9]{32}
254
+ Webhook Secret webhook_secret = ...
255
+ High-Entropy Strings Shannon entropy > 4.5
256
+ ```
257
+
258
+ ---
259
+
260
+ ## MITRE ATT&CK for Cloud Coverage
261
+
262
+ | Technique | Name | Module |
263
+ |-----------|------|--------|
264
+ | T1595.003 | Wordlist Scanning | http_enum |
265
+ | T1580 | Cloud Infrastructure Discovery | s3_enum, iam_enum |
266
+ | T1530 | Data from Cloud Storage Object | s3_enum |
267
+ | T1552.001 | Credentials in Files | file_secrets |
268
+ | T1552.005 | Cloud Instance Metadata API | file_secrets |
269
+ | T1078.004 | Valid Accounts: Cloud Accounts | api_exploit, iam_enum |
270
+ | T1548 | Abuse Elevation Control Mechanism | api_exploit |
271
+ | T1550.001 | Application Access Token | jwt_attack |
272
+
273
+ ---
274
+
275
+ ## Demo: Vulnerable Target (Viva/Lab Use)
276
+
277
+ A deliberately vulnerable Flask fintech application is included for demonstration:
278
+
279
+ ```bash
280
+ # Terminal 1 — Start target
281
+ cd target && python3 app.py
282
+ # Running at http://127.0.0.1:5000
283
+
284
+ # Terminal 2 — Attack it
285
+ python3 exploitgraph.py -t http://127.0.0.1:5000 --auto
286
+ ```
287
+
288
+ The target simulates:
289
+ - Public S3 bucket with backup archive
290
+ - `.env` file with exposed AWS keys, API keys, JWT secrets
291
+ - Weak admin credentials in deployment notes
292
+ - Unauthenticated admin API endpoints
293
+ - Debug endpoint leaking configuration
294
+
295
+ > **The target app is for controlled lab environments only.**
296
+
297
+ ---
298
+
299
+ ## Writing Custom Modules
300
+
301
+ Create a file in `modules/custom/my_module.py`:
302
+
303
+ ```python
304
+ from modules.base import BaseModule, ModuleResult
305
+
306
+ class MyModule(BaseModule):
307
+ NAME = "my_module"
308
+ DESCRIPTION = "My custom scanner"
309
+ CATEGORY = "discovery"
310
+ SEVERITY = "HIGH"
311
+ MITRE = ["T1595"]
312
+
313
+ OPTIONS = {
314
+ "TARGET": {"default": "", "required": True, "description": "Target URL"},
315
+ }
316
+
317
+ def run(self, session):
318
+ target = self.get_option("TARGET")
319
+ # ... your logic ...
320
+ session.add_finding(
321
+ module="my_module",
322
+ title="Finding Title",
323
+ severity="HIGH",
324
+ description="What was found",
325
+ evidence="Proof",
326
+ recommendation="How to fix",
327
+ cvss_score=7.5,
328
+ )
329
+ return ModuleResult(True, {"found": True})
330
+ ```
331
+
332
+ ExploitGraph automatically discovers and loads it. No configuration needed.
333
+
334
+ ---
335
+
336
+ ## Report Output
337
+
338
+ The HTML report includes:
339
+ - Executive summary with severity breakdown
340
+ - Interactive D3.js attack graph (drag, zoom, hover for details)
341
+ - Expandable findings with CVSS scores
342
+ - Evidence + proof-of-concept per finding
343
+ - AWS CLI remediation commands
344
+ - MITRE ATT&CK technique mapping
345
+ - Full secrets table
346
+ - Exploitation evidence log
347
+ - Session risk score (0-10)
348
+
349
+ ---
350
+
351
+ ## AWS Integration
352
+
353
+ With boto3 installed and credentials configured:
354
+
355
+ ```bash
356
+ # Using AWS CLI profile
357
+ exploitgraph> use cloud/s3_enum
358
+ exploitgraph> set AWS_PROFILE my-profile
359
+ exploitgraph> run
360
+
361
+ # Using discovered credentials (auto-populated from file_secrets)
362
+ exploitgraph> use cloud/iam_enum
363
+ exploitgraph> run # Picks up AWS keys found by file_secrets automatically
364
+ ```
365
+
366
+ **All AWS operations are READ-ONLY** — no modifications to your AWS environment.
367
+
368
+ ---
369
+
370
+ ## Architecture
371
+
372
+ ```
373
+ ExploitGraph/
374
+ ├── exploitgraph.py Entry point (CLI + console launcher)
375
+ ├── core/
376
+ │ ├── console.py msfconsole-style interactive shell
377
+ │ ├── module_loader.py Dynamic plugin discovery & loading
378
+ │ ├── session_manager.py SQLite-backed multi-session tracking
379
+ │ ├── attack_graph.py networkx attack graph engine
380
+ │ ├── risk_engine.py CVSS-style risk scoring
381
+ │ ├── logger.py Structured colored logger
382
+ │ └── config.py YAML configuration loader
383
+ ├── modules/
384
+ │ ├── base.py BaseModule abstract class
385
+ │ ├── discovery/ HTTP enumeration modules
386
+ │ ├── cloud/ AWS/cloud security modules
387
+ │ ├── secrets/ Credential extraction modules
388
+ │ ├── exploitation/ Attack execution modules
389
+ │ ├── reporting/ Report generation modules
390
+ │ └── custom/ Drop your own modules here
391
+ ├── data/wordlists/ Attack wordlists
392
+ ├── sessions/ SQLite session database
393
+ ├── reports/ Generated reports
394
+ └── target/ Demo vulnerable application
395
+ ```
396
+
397
+ ---
398
+
399
+ ## Legal Disclaimer
400
+
401
+ ExploitGraph is developed for **authorized security testing and educational purposes only**.
402
+
403
+ - Only use against systems you own or have explicit written permission to test
404
+ - The demo target application is for isolated lab environments only
405
+ - Unauthorized use against third-party systems is illegal
406
+
407
+ The author assumes no liability for misuse of this tool.
408
+
409
+ ---
410
+
411
+ ## License
412
+
413
+ MIT License — see [LICENSE](LICENSE)
414
+
415
+ ---
416
+
417
+ ## Author
418
+
419
+ **Prajwal Pawar**
420
+ B.Sc. Cyber Security — Final Year Project
421
+ School of Computer Application
422
+
423
+ ---
424
+
425
+ ## Contributing
426
+
427
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
428
+
429
+ The easiest contribution: write a new module in `modules/custom/` following the `BaseModule` pattern and submit a PR.