Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /SHAdd0WTAka_Zen-Ai-Pentest /tests /test_real_target.py
| """ | |
| Echte Tests gegen lokales Testziel (nginx auf localhost:8090) | |
| Diese Tests laufen wirklich und produzieren echte Ergebnisse. | |
| """ | |
| import os | |
| import subprocess | |
| import sys | |
| import pytest | |
| import requests | |
| # Testziel | |
| TEST_TARGET = "http://localhost:8090" | |
| class TestTargetReachable: | |
| """Prüfe ob das Testziel erreichbar ist""" | |
| def test_target_http(self): | |
| """Echter HTTP-Request gegen nginx""" | |
| response = requests.get(TEST_TARGET, timeout=5) | |
| assert response.status_code == 200 | |
| assert "nginx" in response.text.lower() or "welcome" in response.text.lower() | |
| def test_target_headers(self): | |
| """Prüfe echte HTTP-Header""" | |
| response = requests.get(TEST_TARGET, timeout=5) | |
| assert "Server" in response.headers | |
| assert "nginx" in response.headers["Server"].lower() | |
| class TestNmapAgainstTarget: | |
| """Echter Nmap-Scan gegen localhost""" | |
| def test_nmap_port_scan(self): | |
| """Echter Nmap-Scan gegen Port 8090""" | |
| result = subprocess.run( | |
| ["nmap", "-p", "8090", "-sV", "--open", "localhost"], | |
| capture_output=True, | |
| text=True, | |
| timeout=30, | |
| ) | |
| assert result.returncode == 0 | |
| assert "8090" in result.stdout | |
| # Echte Ergebnisse prüfen | |
| assert "open" in result.stdout.lower() | |
| class TestHttpxAgainstTarget: | |
| """Echter HTTPX-Scan gegen Testziel""" | |
| def test_httpx_probe(self): | |
| """HTTPX-Probe gegen localhost:8090""" | |
| try: | |
| from tools.httpx_integration import HTTPXIntegration | |
| httpx = HTTPXIntegration() | |
| # Teste nur die Erreichbarkeit ohne vollen Scan | |
| result = httpx.probe_single(f"{TEST_TARGET}") | |
| assert result is not None | |
| except ImportError: | |
| pytest.skip("httpx_integration not available") | |
| if __name__ == "__main__": | |
| pytest.main([__file__, "-v"]) | |
Xet Storage Details
- Size:
- 2 kB
- Xet hash:
- eaed8c189275dfef9eec2e307429dcc6b435cb59ad96d2c19bb1ac55b951bc16
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.