Parse WhatWeb JSON output (handles array, single object, or JSON-lines)
(self, stdout: str, scan_id: str)
| 1893 | if resolved: |
| 1894 | for t in resolved[:8]: |
| 1895 | cmd.extend(['-t', t]) |
| 1896 | self._scan_log(scan_id, 'info', f"Nuclei template paths: {', '.join(resolved[:8])}") |
| 1897 | else: |
| 1898 | self._scan_log(scan_id, 'warning', |
| 1899 | "No requested template categories found on disk; " |
| 1900 | "running nuclei's default template set filtered by severity") |
| 1901 | |
| 1902 | # Add HTTP Basic Auth header if provided |
| 1903 | if options.get('http_basic_auth'): |
| 1904 | import base64 |
| 1905 | auth_string = options['http_basic_auth'] |
| 1906 | auth_bytes = base64.b64encode(auth_string.encode('utf-8')).decode('utf-8') |
| 1907 | cmd.extend(['-H', f'Authorization: Basic {auth_bytes}']) |
| 1908 | |
| 1909 | # Add Bearer Token if provided |
| 1910 | if options.get('bearer_token'): |
| 1911 | cmd.extend(['-H', f'Authorization: Bearer {options["bearer_token"]}']) |
| 1912 | |
| 1913 | # Add API Key header if provided |
| 1914 | if options.get('api_key'): |
| 1915 | header_name = options.get('api_key_header', 'X-API-Key') |
| 1916 | cmd.extend(['-H', f'{header_name}: {options["api_key"]}']) |
| 1917 | |
| 1918 | # Add Cookie if provided |
| 1919 | if options.get('cookie_value'): |
| 1920 | cmd.extend(['-H', f'Cookie: {options["cookie_value"]}']) |
| 1921 |
no test coverage detected