File size: 762 Bytes
c1294c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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))