Spaces:
Runtime error

ShelbyXcode / app /main.py
ezshelbycode's picture
Create main.py
c9e48e2 verified
Raw History Blame Contribute Delete
590 Bytes
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}