mirror of
https://github.com/mblanke/StrikePackageGPT.git
synced 2026-03-01 14:20:21 -05:00
perf: Optimize network scan speed and defaults
- Change default scan type from 'os' to 'quick' (much faster) - Add -T4 timing template for aggressive speed - Add --min-hostgroup for parallel host scanning - Remove slow OS detection from quick scan - Add time estimates in UI: ping ~30s, quick ~1-3min, os ~5-15min - Color-coded scan options by speed - ping scan: fastest, just host discovery - quick scan: top 100 ports, no OS detection
This commit is contained in:
@@ -399,15 +399,15 @@ async def start_network_scan(request: NetworkScanRequest):
|
|||||||
total_hosts = calculate_target_hosts(request.target)
|
total_hosts = calculate_target_hosts(request.target)
|
||||||
|
|
||||||
# Build nmap command based on scan type
|
# Build nmap command based on scan type
|
||||||
# Use --stats-every to get progress updates
|
# Use -T4 for faster timing, --stats-every for progress, --min-hostgroup for parallel scanning
|
||||||
scan_commands = {
|
scan_commands = {
|
||||||
"ping": f"nmap -sn {request.target} -oX - --stats-every 2s",
|
"ping": f"nmap -sn -T4 --min-hostgroup 64 {request.target} -oX - --stats-every 1s",
|
||||||
"quick": f"nmap -T4 -F -O --osscan-limit {request.target} -oX - --stats-every 2s",
|
"quick": f"nmap -T4 -F --top-ports 100 --min-hostgroup 32 {request.target} -oX - --stats-every 1s",
|
||||||
"os": f"nmap -O -sV --version-light {request.target} -oX - --stats-every 2s",
|
"os": f"nmap -T4 -O --osscan-guess --max-os-tries 1 --min-hostgroup 16 {request.target} -oX - --stats-every 2s",
|
||||||
"full": f"nmap -sS -sV -O -p- --version-all {request.target} -oX - --stats-every 2s"
|
"full": f"nmap -T4 -sS -sV -O --version-light -p- --min-hostgroup 8 {request.target} -oX - --stats-every 2s"
|
||||||
}
|
}
|
||||||
|
|
||||||
command = scan_commands.get(request.scan_type, scan_commands["os"])
|
command = scan_commands.get(request.scan_type, scan_commands["quick"])
|
||||||
|
|
||||||
network_scans[scan_id] = {
|
network_scans[scan_id] = {
|
||||||
"scan_id": scan_id,
|
"scan_id": scan_id,
|
||||||
|
|||||||
@@ -836,12 +836,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-sp-grey/50 p-3 rounded text-xs text-sp-white-muted">
|
<div class="bg-sp-grey/50 p-3 rounded text-xs text-sp-white-muted">
|
||||||
<p class="font-semibold text-sp-white mb-1">Scan Options:</p>
|
<p class="font-semibold text-sp-white mb-1">⏱️ Estimated Times (per /24):</p>
|
||||||
<ul class="space-y-1">
|
<ul class="space-y-1">
|
||||||
<li>• <strong>Ping Sweep:</strong> Fast host discovery only</li>
|
<li>• <strong class="text-green-400">Ping Sweep:</strong> ~10-30 seconds</li>
|
||||||
<li>• <strong>Quick Scan:</strong> Top 100 ports with OS hints</li>
|
<li>• <strong class="text-blue-400">Quick Scan:</strong> ~1-3 minutes (recommended)</li>
|
||||||
<li>• <strong>OS Detection:</strong> Detailed OS fingerprinting</li>
|
<li>• <strong class="text-yellow-400">OS Detection:</strong> ~5-15 minutes</li>
|
||||||
<li>• <strong>Full Scan:</strong> Complete port + OS (slower)</li>
|
<li>• <strong class="text-red-400">Full Scan:</strong> ~30-60+ minutes</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -894,7 +894,7 @@
|
|||||||
networkScanProgress: { current: 0, total: 0, currentIp: '', hostsFound: 0 },
|
networkScanProgress: { current: 0, total: 0, currentIp: '', hostsFound: 0 },
|
||||||
showRangeScanModal: false,
|
showRangeScanModal: false,
|
||||||
rangeScanTarget: '',
|
rangeScanTarget: '',
|
||||||
rangeScanType: 'os',
|
rangeScanType: 'quick',
|
||||||
|
|
||||||
phases: [
|
phases: [
|
||||||
{
|
{
|
||||||
|
|||||||
21
services/hackgpt-api/app/from fastapi import FastAPI.py
Normal file
21
services/hackgpt-api/app/from fastapi import FastAPI.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
from starlette.middleware.cors import CORSMiddleware
|
||||||
|
import os
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
# CORS middleware
|
||||||
|
app.add_middleware(
|
||||||
|
CORSMiddleware,
|
||||||
|
allow_origins=["*"], # Allows all origins
|
||||||
|
allow_credentials=True,
|
||||||
|
allow_methods=["*"], # Allows all methods
|
||||||
|
allow_headers=["*"], # Allows all headers
|
||||||
|
)
|
||||||
|
|
||||||
|
LLM_ROUTER_URL = os.getenv("LLM_ROUTER_URL", "http://strikepackage-llm-router:8000")
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
async def root():
|
||||||
|
return {"message": "Hello World"}
|
||||||
Reference in New Issue
Block a user