Start ZAP in daemon mode. Handles stale/crashed ZAP processes by cleaning up zombies and freeing locked ports before attempting to start a fresh instance. Thread-safe: uses _zap_start_lock to prevent concurrent starts.
(self, port: int = None)
| 2264 | self.scan_results[scan_id].append(finding) |
| 2265 | |
| 2266 | logger.info(f"Parsed {len(self.scan_results.get(scan_id, []))} findings from Nikto text output") |
| 2267 | except Exception as e: |
| 2268 | logger.error(f"Error parsing Nikto text output: {e}") |
| 2269 | |
| 2270 | def _run_sqlmap_scan(self, scan_id: str, target: str, options: Dict): |
| 2271 | """Run SQLMap SQL injection scan""" |
| 2272 | sqlmap_path = self._tool_paths.get('sqlmap') |
| 2273 | if not sqlmap_path: |
| 2274 | raise RuntimeError("SQLMap not installed") |
| 2275 | |
| 2276 | progress = self.active_scans[scan_id] |
| 2277 | |
| 2278 | with tempfile.TemporaryDirectory() as output_dir: |
| 2279 | cmd = [ |
| 2280 | 'python3', sqlmap_path, |
| 2281 | '-u', target, |
| 2282 | '--batch', |
| 2283 | '--level', str(options.get('level', 1)), |
| 2284 | '--risk', str(options.get('risk', 1)), |
| 2285 | '--output-dir', output_dir, |
| 2286 | '--forms' if options.get('forms', False) else '', |
no test coverage detected