MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / start_zap_daemon

Method start_zap_daemon

advanced_vuln_scanner.py:2266–2283  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 '',

Callers 6

_zap_watchdogMethod · 0.95
_run_zap_spider_innerMethod · 0.95
_fetch_zap_alertsMethod · 0.95
start_zap_daemonFunction · 0.80

Calls 5

_is_zap_runningMethod · 0.95
acquireMethod · 0.80
warningMethod · 0.80
releaseMethod · 0.80

Tested by

no test coverage detected