sqlmap-ai 2.0.5__tar.gz → 2.0.8__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 (40) hide show
  1. sqlmap_ai-2.0.8/PKG-INFO +157 -0
  2. sqlmap_ai-2.0.8/README.md +88 -0
  3. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/pyproject.toml +2 -1
  4. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/setup.cfg +4 -4
  5. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/setup.py +19 -23
  6. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/__init__.py +2 -6
  7. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/adaptive_testing.py +1 -1
  8. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/advanced_reporting.py +20 -25
  9. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/ai_analyzer.py +1 -1
  10. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/cli.py +45 -44
  11. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/config_manager.py +55 -39
  12. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/enhanced_cli.py +208 -153
  13. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/evasion_engine.py +1 -5
  14. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/html_reporter.py +132 -24
  15. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/main.py +344 -71
  16. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/parser.py +2 -1
  17. sqlmap_ai-2.0.8/sqlmap_ai/run.py +364 -0
  18. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/runner.py +259 -83
  19. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/security_manager.py +35 -36
  20. sqlmap_ai-2.0.8/sqlmap_ai/startup.py +236 -0
  21. sqlmap_ai-2.0.8/sqlmap_ai/templates/report_template.html +131 -0
  22. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/ui.py +2 -10
  23. sqlmap_ai-2.0.8/sqlmap_ai.egg-info/PKG-INFO +157 -0
  24. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai.egg-info/SOURCES.txt +2 -0
  25. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai.egg-info/requires.txt +1 -0
  26. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/tests/test_config_manager.py +8 -11
  27. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/tests/test_security_manager.py +45 -20
  28. sqlmap_ai-2.0.8/utils/__init__.py +3 -0
  29. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/utils/ai_providers.py +87 -24
  30. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/utils/groq_utils.py +0 -14
  31. sqlmap_ai-2.0.5/PKG-INFO +0 -670
  32. sqlmap_ai-2.0.5/README.md +0 -602
  33. sqlmap_ai-2.0.5/sqlmap_ai/templates/report_template.html +0 -222
  34. sqlmap_ai-2.0.5/sqlmap_ai.egg-info/PKG-INFO +0 -670
  35. sqlmap_ai-2.0.5/utils/__init__.py +0 -6
  36. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/LICENSE +0 -0
  37. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai/timeout_handler.py +0 -0
  38. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai.egg-info/dependency_links.txt +0 -0
  39. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai.egg-info/entry_points.txt +0 -0
  40. {sqlmap_ai-2.0.5 → sqlmap_ai-2.0.8}/sqlmap_ai.egg-info/top_level.txt +0 -0
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: sqlmap-ai
3
+ Version: 2.0.8
4
+ Summary: AI-powered SQL injection testing tool with multiple AI providers
5
+ Home-page: https://github.com/atiilla/sqlmap-ai
6
+ Author: Atilla
7
+ Author-email: Atilla <attilla@tuta.io>
8
+ Maintainer-email: Atilla <attilla@tuta.io>
9
+ License-Expression: MIT
10
+ Project-URL: Homepage, https://github.com/atiilla/sqlmap-ai
11
+ Project-URL: Documentation, https://github.com/atiilla/sqlmap-ai#readme
12
+ Project-URL: Repository, https://github.com/atiilla/sqlmap-ai.git
13
+ Project-URL: Issues, https://github.com/atiilla/sqlmap-ai/issues
14
+ Keywords: sqlmap,sql-injection,security,ai,penetration-testing,cybersecurity
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: Security
26
+ Classifier: Topic :: System :: Systems Administration
27
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
28
+ Classifier: Topic :: Software Development :: Testing
29
+ Requires-Python: >=3.8
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: python-dotenv>=1.0.0
33
+ Requires-Dist: groq>=0.4.0
34
+ Requires-Dist: requests>=2.31.0
35
+ Requires-Dist: openai>=1.3.0
36
+ Requires-Dist: anthropic>=0.8.0
37
+ Requires-Dist: pyyaml>=6.0.1
38
+ Requires-Dist: rich>=13.0.0
39
+ Requires-Dist: jinja2>=3.1.2
40
+ Requires-Dist: cryptography>=3.4.0
41
+ Requires-Dist: colorama>=0.4.6
42
+ Requires-Dist: waitress>=2.1.0
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
46
+ Requires-Dist: black>=23.0.0; extra == "dev"
47
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
48
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
49
+ Provides-Extra: local-llm
50
+ Requires-Dist: transformers>=4.35.0; extra == "local-llm"
51
+ Requires-Dist: torch>=2.1.0; extra == "local-llm"
52
+ Provides-Extra: reporting
53
+ Requires-Dist: plotly>=5.0.0; extra == "reporting"
54
+ Requires-Dist: pandas>=2.0.0; extra == "reporting"
55
+ Provides-Extra: all
56
+ Requires-Dist: pytest>=7.0.0; extra == "all"
57
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "all"
58
+ Requires-Dist: black>=23.0.0; extra == "all"
59
+ Requires-Dist: flake8>=6.0.0; extra == "all"
60
+ Requires-Dist: mypy>=1.0.0; extra == "all"
61
+ Requires-Dist: transformers>=4.35.0; extra == "all"
62
+ Requires-Dist: torch>=2.1.0; extra == "all"
63
+ Requires-Dist: plotly>=5.0.0; extra == "all"
64
+ Requires-Dist: pandas>=2.0.0; extra == "all"
65
+ Dynamic: author
66
+ Dynamic: home-page
67
+ Dynamic: license-file
68
+ Dynamic: requires-python
69
+
70
+ # SQLMap AI Assistant
71
+
72
+ An AI-powered wrapper around SQLMap that makes SQL injection testing more accessible and automated.
73
+
74
+ ## Features
75
+
76
+ ### Core Features
77
+ - **AI-Assisted Testing** - Intelligent vulnerability analysis and recommendations
78
+ - **Adaptive Testing** - Step-by-step testing that adapts to target responses
79
+ - **Enhanced HTML Reports** - Beautiful, detailed reports with vulnerability details
80
+ - **Parameter Targeting** - Test specific parameters with `-p` option (like original SQLMap)
81
+ - **WAF Bypass** - Automatic tamper script selection for firewall evasion
82
+ - **Database Enumeration** - Complete database, table, and column discovery
83
+ - **Request File Support** - Test from Burp Suite, ZAP, or browser captures
84
+
85
+ ### AI Providers
86
+ - **Groq** - Fastest AI analysis (recommended)
87
+ - **DeepSeek** - Affordable and capable analysis
88
+ - **OpenAI** - GPT-4 powered analysis
89
+ - **Anthropic Claude** - Advanced reasoning
90
+ - **Ollama** - Local, private AI (no cloud required)
91
+
92
+ ### New in v2.0.6
93
+ - [x] **Private Network Scanning** - Local/private IP targets now allowed by default
94
+ - [x] **Configurable Network Policy** - New `allow_private_networks` security setting
95
+ - [x] **Improved Test Coverage** - Added dedicated tests for private network validation
96
+
97
+ > See the full [Changelog](docs/CHANGELOG.md) for previous versions.
98
+
99
+ <img src="sqlmap.gif"/>
100
+
101
+ ## Quick Start
102
+
103
+ **1. Install SQLMap:**
104
+ ```bash
105
+ sudo apt install sqlmap # Debian/Ubuntu/Kali
106
+ brew install sqlmap # macOS
107
+ ```
108
+
109
+ **2. Install SQLMap AI:**
110
+ ```bash
111
+ pip install sqlmap-ai
112
+ sqlmap-ai --install-check
113
+ ```
114
+
115
+ **3. Set an API key** in your `.env` file (e.g., Groq - free & fastest):
116
+ ```bash
117
+ GROQ_API_KEY=your_groq_api_key_here
118
+ ```
119
+
120
+ **4. Run:**
121
+ ```bash
122
+ sqlmap-ai -u "http://example.com/page.php?id=1"
123
+ ```
124
+
125
+ > See the full [Installation Guide](docs/INSTALLATION.md) for all providers and options.
126
+
127
+ ## Documentation
128
+
129
+ | Guide | Description |
130
+ |-------|-------------|
131
+ | [Installation](docs/INSTALLATION.md) | Prerequisites, setup, AI provider configuration |
132
+ | [Usage](docs/USAGE.md) | Examples, testing modes, request files, workflows |
133
+ | [Configuration](docs/CONFIGURATION.md) | `.env`, `config.yaml`, command-line reference |
134
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues and getting help |
135
+ | [Changelog](docs/CHANGELOG.md) | Version history |
136
+
137
+ ## Requirements
138
+
139
+ - Python 3.8+
140
+ - SQLMap (must be installed globally on your system)
141
+ - Kali/Debian/Ubuntu: `sudo apt install sqlmap`
142
+ - macOS: `brew install sqlmap`
143
+ - From source: [github.com/sqlmapproject/sqlmap](https://github.com/sqlmapproject/sqlmap)
144
+ - Internet connection (for cloud AI providers)
145
+ - 2GB+ RAM (for Ollama local models)
146
+
147
+ ## License
148
+
149
+ This project is licensed under the MIT License.
150
+
151
+ ## Disclaimer
152
+
153
+ This tool is intended for educational and ethical hacking purposes only. Always obtain permission before testing any system or application. The developers are not responsible for any misuse or damage caused by this tool.
154
+
155
+ ## Star History
156
+
157
+ [![Star History Chart](https://api.star-history.com/svg?repos=atiilla/sqlmap-ai&type=Date)](https://www.star-history.com/#atiilla/sqlmap-ai&Date)
@@ -0,0 +1,88 @@
1
+ # SQLMap AI Assistant
2
+
3
+ An AI-powered wrapper around SQLMap that makes SQL injection testing more accessible and automated.
4
+
5
+ ## Features
6
+
7
+ ### Core Features
8
+ - **AI-Assisted Testing** - Intelligent vulnerability analysis and recommendations
9
+ - **Adaptive Testing** - Step-by-step testing that adapts to target responses
10
+ - **Enhanced HTML Reports** - Beautiful, detailed reports with vulnerability details
11
+ - **Parameter Targeting** - Test specific parameters with `-p` option (like original SQLMap)
12
+ - **WAF Bypass** - Automatic tamper script selection for firewall evasion
13
+ - **Database Enumeration** - Complete database, table, and column discovery
14
+ - **Request File Support** - Test from Burp Suite, ZAP, or browser captures
15
+
16
+ ### AI Providers
17
+ - **Groq** - Fastest AI analysis (recommended)
18
+ - **DeepSeek** - Affordable and capable analysis
19
+ - **OpenAI** - GPT-4 powered analysis
20
+ - **Anthropic Claude** - Advanced reasoning
21
+ - **Ollama** - Local, private AI (no cloud required)
22
+
23
+ ### New in v2.0.6
24
+ - [x] **Private Network Scanning** - Local/private IP targets now allowed by default
25
+ - [x] **Configurable Network Policy** - New `allow_private_networks` security setting
26
+ - [x] **Improved Test Coverage** - Added dedicated tests for private network validation
27
+
28
+ > See the full [Changelog](docs/CHANGELOG.md) for previous versions.
29
+
30
+ <img src="sqlmap.gif"/>
31
+
32
+ ## Quick Start
33
+
34
+ **1. Install SQLMap:**
35
+ ```bash
36
+ sudo apt install sqlmap # Debian/Ubuntu/Kali
37
+ brew install sqlmap # macOS
38
+ ```
39
+
40
+ **2. Install SQLMap AI:**
41
+ ```bash
42
+ pip install sqlmap-ai
43
+ sqlmap-ai --install-check
44
+ ```
45
+
46
+ **3. Set an API key** in your `.env` file (e.g., Groq - free & fastest):
47
+ ```bash
48
+ GROQ_API_KEY=your_groq_api_key_here
49
+ ```
50
+
51
+ **4. Run:**
52
+ ```bash
53
+ sqlmap-ai -u "http://example.com/page.php?id=1"
54
+ ```
55
+
56
+ > See the full [Installation Guide](docs/INSTALLATION.md) for all providers and options.
57
+
58
+ ## Documentation
59
+
60
+ | Guide | Description |
61
+ |-------|-------------|
62
+ | [Installation](docs/INSTALLATION.md) | Prerequisites, setup, AI provider configuration |
63
+ | [Usage](docs/USAGE.md) | Examples, testing modes, request files, workflows |
64
+ | [Configuration](docs/CONFIGURATION.md) | `.env`, `config.yaml`, command-line reference |
65
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues and getting help |
66
+ | [Changelog](docs/CHANGELOG.md) | Version history |
67
+
68
+ ## Requirements
69
+
70
+ - Python 3.8+
71
+ - SQLMap (must be installed globally on your system)
72
+ - Kali/Debian/Ubuntu: `sudo apt install sqlmap`
73
+ - macOS: `brew install sqlmap`
74
+ - From source: [github.com/sqlmapproject/sqlmap](https://github.com/sqlmapproject/sqlmap)
75
+ - Internet connection (for cloud AI providers)
76
+ - 2GB+ RAM (for Ollama local models)
77
+
78
+ ## License
79
+
80
+ This project is licensed under the MIT License.
81
+
82
+ ## Disclaimer
83
+
84
+ This tool is intended for educational and ethical hacking purposes only. Always obtain permission before testing any system or application. The developers are not responsible for any misuse or damage caused by this tool.
85
+
86
+ ## Star History
87
+
88
+ [![Star History Chart](https://api.star-history.com/svg?repos=atiilla/sqlmap-ai&type=Date)](https://www.star-history.com/#atiilla/sqlmap-ai&Date)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sqlmap-ai"
7
- version = "2.0.5"
7
+ version = "2.0.8"
8
8
  description = "AI-powered SQL injection testing tool with multiple AI providers"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -43,6 +43,7 @@ dependencies = [
43
43
  "jinja2>=3.1.2",
44
44
  "cryptography>=3.4.0",
45
45
  "colorama>=0.4.6",
46
+ "waitress>=2.1.0",
46
47
  ]
47
48
 
48
49
  [project.optional-dependencies]
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,8 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- Setup script for SQLMap AI
4
- Provides backward compatibility and additional installation features
5
- """
6
2
 
7
3
  import os
8
4
  import sys
@@ -19,7 +15,7 @@ def read_readme():
19
15
 
20
16
  # Read requirements from pyproject.toml
21
17
  def get_requirements():
22
- """Get requirements from pyproject.toml"""
18
+
23
19
  try:
24
20
  import tomllib
25
21
  except ImportError:
@@ -33,7 +29,7 @@ def get_requirements():
33
29
  return []
34
30
 
35
31
  def install_sqlmap():
36
- """Install SQLMap if not already installed"""
32
+
37
33
  try:
38
34
  # Check if sqlmap is already installed
39
35
  result = subprocess.run(
@@ -43,7 +39,7 @@ def install_sqlmap():
43
39
  timeout=10
44
40
  )
45
41
  if result.returncode == 0:
46
- print(" SQLMap is already installed")
42
+ print(" SQLMap is already installed")
47
43
  return True
48
44
  except (subprocess.TimeoutExpired, FileNotFoundError, subprocess.SubprocessError):
49
45
  pass
@@ -56,19 +52,19 @@ def install_sqlmap():
56
52
  capture_output=True,
57
53
  text=True
58
54
  )
59
- print(" SQLMap installed successfully")
55
+ print(" SQLMap installed successfully")
60
56
  return True
61
57
  except subprocess.CalledProcessError as e:
62
- print(f" Failed to install SQLMap: {e}")
58
+ print(f"X Failed to install SQLMap: {e}")
63
59
  print("Please install SQLMap manually: pip install sqlmap")
64
60
  return False
65
61
 
66
62
  def create_env_template():
67
- """Create .env template if it doesn't exist"""
63
+
68
64
  # Use current working directory instead of project root
69
65
  env_file = Path.cwd() / ".env"
70
66
  if env_file.exists():
71
- print(" .env file already exists")
67
+ print(" .env file already exists")
72
68
  return True
73
69
 
74
70
  print("📝 Creating .env template...")
@@ -108,15 +104,15 @@ DEFAULT_TIMEOUT=300
108
104
  try:
109
105
  with open(env_file, 'w') as f:
110
106
  f.write(env_content)
111
- print(" .env template created")
107
+ print(" .env template created")
112
108
  print(" Please edit .env file and add your API keys")
113
109
  return True
114
110
  except Exception as e:
115
- print(f" Failed to create .env template: {e}")
111
+ print(f"X Failed to create .env template: {e}")
116
112
  return False
117
113
 
118
114
  def setup_directories():
119
- """Create necessary directories"""
115
+
120
116
  print("📁 Setting up directories...")
121
117
 
122
118
  directories = [
@@ -128,15 +124,15 @@ def setup_directories():
128
124
  try:
129
125
  for directory in directories:
130
126
  directory.mkdir(exist_ok=True)
131
- print(" Directories created")
127
+ print(" Directories created")
132
128
  return True
133
129
  except Exception as e:
134
- print(f" Failed to create directories: {e}")
130
+ print(f"X Failed to create directories: {e}")
135
131
  return False
136
132
 
137
133
  def run_post_install():
138
- """Run post-installation tasks"""
139
- print("\n🚀 Running post-installation tasks...")
134
+
135
+ print("\nRunning post-installation tasks...")
140
136
 
141
137
  success = True
142
138
 
@@ -153,13 +149,13 @@ def run_post_install():
153
149
  success = False
154
150
 
155
151
  if success:
156
- print("\n🎉 Installation completed successfully!")
152
+ print("\nInstallation completed successfully!")
157
153
  print("\nNext steps:")
158
154
  print("1. Edit .env file and add your API keys")
159
155
  print("2. Run: sqlmap-ai --config-wizard")
160
156
  print("3. Run: sqlmap-ai --help")
161
157
  else:
162
- print("\n⚠️ Installation completed with issues")
158
+ print("\n⚠️ Installation completed with issues")
163
159
  print("Please resolve the issues above before using SQLMap AI")
164
160
 
165
161
  return success
@@ -171,12 +167,12 @@ if __name__ == "__main__":
171
167
  # Run setup first
172
168
  setup(
173
169
  name="sqlmap-ai",
174
- version="2.0.0",
170
+ version="2.0.7",
175
171
  description="AI-powered SQL injection testing tool with multiple AI providers",
176
172
  long_description=read_readme(),
177
173
  long_description_content_type="text/markdown",
178
174
  author="Atilla",
179
- author_email="atiilla@example.com",
175
+ author_email="attilla@tuta.io",
180
176
  url="https://github.com/atiilla/sqlmap-ai",
181
177
  packages=find_packages(include=["sqlmap_ai*", "utils*"]),
182
178
  include_package_data=True,
@@ -239,7 +235,7 @@ if __name__ == "__main__":
239
235
  long_description=read_readme(),
240
236
  long_description_content_type="text/markdown",
241
237
  author="Atilla",
242
- author_email="atiilla@example.com",
238
+ author_email="attilla@tuta.io",
243
239
  url="https://github.com/atiilla/sqlmap-ai",
244
240
  packages=find_packages(include=["sqlmap_ai*", "utils*"]),
245
241
  include_package_data=True,
@@ -1,10 +1,6 @@
1
- """
2
- SQLMap AI - AI-powered SQL injection testing tool
3
- """
4
-
5
- __version__ = "2.0.0"
1
+ __version__ = "2.0.8"
6
2
  __author__ = "Atilla"
7
- __email__ = "atiilla@example.com"
3
+ __email__ = "atilla@tuta.io"
8
4
  __description__ = "AI-powered SQL injection testing tool with multiple AI providers"
9
5
 
10
6
  # Import main components
@@ -24,7 +24,7 @@ class AdaptiveTestingEngine:
24
24
  self.test_parameter = test_parameter # Specific parameter(s) to test
25
25
 
26
26
  def _add_param_option(self, options: List[str]) -> List[str]:
27
- """Add -p parameter option if specified"""
27
+
28
28
  if self.test_parameter:
29
29
  options.append(f"-p {self.test_parameter}")
30
30
  return options
@@ -1,8 +1,3 @@
1
- """
2
- Advanced reporting system with HTML, PDF, and interactive visualizations.
3
- Provides comprehensive vulnerability analysis and remediation guidance.
4
- """
5
-
6
1
  import json
7
2
  import time
8
3
  import os
@@ -36,7 +31,7 @@ except ImportError:
36
31
 
37
32
  @dataclass
38
33
  class VulnerabilityDetails:
39
- """Detailed vulnerability information"""
34
+
40
35
  parameter: str
41
36
  injection_type: str
42
37
  payload: str
@@ -50,7 +45,7 @@ class VulnerabilityDetails:
50
45
 
51
46
  @dataclass
52
47
  class ScanStatistics:
53
- """Scan performance and statistics"""
48
+
54
49
  total_requests: int
55
50
  successful_injections: int
56
51
  false_positives: int
@@ -62,7 +57,7 @@ class ScanStatistics:
62
57
 
63
58
  @dataclass
64
59
  class RemediationGuidance:
65
- """Remediation recommendations"""
60
+
66
61
  immediate_actions: List[str]
67
62
  long_term_fixes: List[str]
68
63
  secure_coding_practices: List[str]
@@ -71,7 +66,7 @@ class RemediationGuidance:
71
66
 
72
67
 
73
68
  class VulnerabilityAssessment:
74
- """Vulnerability risk assessment engine"""
69
+
75
70
 
76
71
  def __init__(self):
77
72
  self.risk_factors = {
@@ -106,7 +101,7 @@ class VulnerabilityAssessment:
106
101
  }
107
102
 
108
103
  def assess_vulnerability(self, vuln_data: Dict[str, Any]) -> VulnerabilityDetails:
109
- """Assess vulnerability risk and impact"""
104
+
110
105
 
111
106
  # Determine injection type
112
107
  injection_type = self._determine_injection_type(vuln_data)
@@ -134,7 +129,7 @@ class VulnerabilityAssessment:
134
129
  )
135
130
 
136
131
  def _determine_injection_type(self, vuln_data: Dict[str, Any]) -> str:
137
- """Determine the type of SQL injection"""
132
+
138
133
  techniques = vuln_data.get('techniques', [])
139
134
 
140
135
  if 'time-based blind' in str(techniques).lower():
@@ -151,7 +146,7 @@ class VulnerabilityAssessment:
151
146
  return "Generic SQL Injection"
152
147
 
153
148
  def _calculate_risk_score(self, vuln_data: Dict[str, Any]) -> int:
154
- """Calculate numerical risk score"""
149
+
155
150
  base_score = 60 # Base vulnerability score
156
151
 
157
152
  # Database privileges factor
@@ -180,7 +175,7 @@ class VulnerabilityAssessment:
180
175
  return min(base_score, 100)
181
176
 
182
177
  def _get_risk_level(self, score: int) -> str:
183
- """Convert risk score to risk level"""
178
+
184
179
  if score >= 90:
185
180
  return "CRITICAL"
186
181
  elif score >= 70:
@@ -193,7 +188,7 @@ class VulnerabilityAssessment:
193
188
  return "INFO"
194
189
 
195
190
  def _assess_exploitation_complexity(self, vuln_data: Dict[str, Any]) -> str:
196
- """Assess how difficult the vulnerability is to exploit"""
191
+
197
192
  factors = 0
198
193
 
199
194
  # WAF presence increases complexity
@@ -226,7 +221,7 @@ class VulnerabilityAssessment:
226
221
  return "Trivial"
227
222
 
228
223
  def _calculate_remediation_priority(self, risk_score: int, complexity: str) -> str:
229
- """Calculate remediation priority"""
224
+
230
225
  if risk_score >= 90:
231
226
  return "IMMEDIATE"
232
227
  elif risk_score >= 70:
@@ -240,7 +235,7 @@ class VulnerabilityAssessment:
240
235
 
241
236
 
242
237
  class AdvancedReportGenerator:
243
- """Advanced report generator with multiple output formats"""
238
+
244
239
 
245
240
  def __init__(self):
246
241
  self.vulnerability_assessor = VulnerabilityAssessment()
@@ -249,7 +244,7 @@ class AdvancedReportGenerator:
249
244
  self._create_templates()
250
245
 
251
246
  def _create_templates(self):
252
- """Create HTML templates for reports"""
247
+
253
248
  if not HAS_JINJA2:
254
249
  return
255
250
 
@@ -395,7 +390,7 @@ class AdvancedReportGenerator:
395
390
  output_format: str = "html",
396
391
  output_path: Optional[str] = None
397
392
  ) -> str:
398
- """Generate comprehensive vulnerability report"""
393
+
399
394
 
400
395
  # Process scan data
401
396
  vulnerabilities = self._process_vulnerabilities(scan_data)
@@ -411,7 +406,7 @@ class AdvancedReportGenerator:
411
406
  )
412
407
 
413
408
  def _process_vulnerabilities(self, scan_data: Dict[str, Any]) -> List[VulnerabilityDetails]:
414
- """Process scan data to extract vulnerability details"""
409
+
415
410
  vulnerabilities = []
416
411
 
417
412
  scan_history = scan_data.get('scan_history', [])
@@ -441,7 +436,7 @@ class AdvancedReportGenerator:
441
436
  scan_data: Dict[str, Any],
442
437
  vulnerabilities: List[VulnerabilityDetails]
443
438
  ) -> Dict[str, Any]:
444
- """Generate scan summary statistics"""
439
+
445
440
 
446
441
  # Calculate overall risk
447
442
  if vulnerabilities:
@@ -482,7 +477,7 @@ class AdvancedReportGenerator:
482
477
  }
483
478
 
484
479
  def _generate_remediation_guidance(self, vulnerabilities: List[VulnerabilityDetails]) -> RemediationGuidance:
485
- """Generate comprehensive remediation guidance"""
480
+
486
481
 
487
482
  immediate_actions = [
488
483
  "Immediately patch or disable vulnerable endpoints",
@@ -542,7 +537,7 @@ class AdvancedReportGenerator:
542
537
  remediation: RemediationGuidance,
543
538
  output_path: Optional[str] = None
544
539
  ) -> str:
545
- """Generate HTML report"""
540
+
546
541
 
547
542
  if not HAS_JINJA2:
548
543
  return self._generate_simple_html_report(scan_data, vulnerabilities, scan_summary)
@@ -587,7 +582,7 @@ class AdvancedReportGenerator:
587
582
  vulnerabilities: List[VulnerabilityDetails],
588
583
  scan_summary: Dict[str, Any]
589
584
  ) -> str:
590
- """Generate simple HTML report without Jinja2"""
585
+
591
586
 
592
587
  html_content = f"""
593
588
  <!DOCTYPE html>
@@ -653,7 +648,7 @@ class AdvancedReportGenerator:
653
648
  remediation: RemediationGuidance,
654
649
  output_path: Optional[str] = None
655
650
  ) -> str:
656
- """Generate JSON report"""
651
+
657
652
 
658
653
  report_data = {
659
654
  "metadata": {
@@ -684,7 +679,7 @@ class AdvancedReportGenerator:
684
679
 
685
680
 
686
681
  def _generate_timeline_chart(self, scan_history: List[Dict[str, Any]]) -> str:
687
- """Generate timeline chart of scan steps"""
682
+
688
683
 
689
684
  if not HAS_PLOTLY:
690
685
  return ""
@@ -172,7 +172,7 @@ def ai_suggest_next_steps(report, scan_history=None, extracted_data=None, ai_pro
172
172
  return valid_options
173
173
 
174
174
  def create_simple_prompt(report, structured_info, scan_history=None, extracted_data=None):
175
- """Create a simpler prompt for Ollama to avoid timeouts"""
175
+
176
176
  prompt = """
177
177
  You are a SQLMap expert. Analyze this SQL injection scan result and suggest the next steps.
178
178