ai-recon / src /scanner.py
S-Dreamer's picture
Create scanner.py
c1294c9 verified
raw
history blame contribute delete
762 Bytes
import httpx
from concurrent.futures import ThreadPoolExecutor
# Simulated subdomain scan
def get_subdomains(domain):
return [f"dev.{domain}", f"api.{domain}", f"staging.{domain}", f"login.{domain}"]
# Simulated HTTP scan
def scan_http(target):
try:
r = httpx.get(f"http://{target}", timeout=3)
return {
"url": f"http://{target}",
"status": r.status_code,
"server": r.headers.get("server", "Unknown"),
"tech": r.headers.get("x-powered-by", "Unknown")
}
except Exception:
return {"url": f"http://{target}", "error": "Unreachable"}
def threaded_http_scan(subs):
with ThreadPoolExecutor(max_workers=10) as executor:
return list(executor.map(scan_http, subs))