|
import httpx |
|
from concurrent.futures import ThreadPoolExecutor |
|
|
|
|
|
def get_subdomains(domain): |
|
return [f"dev.{domain}", f"api.{domain}", f"staging.{domain}", f"login.{domain}"] |
|
|
|
|
|
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)) |