from fastapi import FastAPI import subprocess app = FastAPI() @app.get("/") def home(): return {"EzShelbyXCode": "Docker Cyber Tool Running"} @app.get("/ping") def ping(target: str): result = subprocess.getoutput(f"ping -c 2 {target}") return {"target": target, "result": result} @app.get("/dns") def dns_lookup(domain: str): result = subprocess.getoutput(f"nslookup {domain}") return {"domain": domain, "result": result} @app.get("/scan") def scan(target: str): result = subprocess.getoutput(f"nmap -F {target}") return {"target": target, "result": result}