Spaces:
Runtime error

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