File size: 490 Bytes
b32b289
7727929
 
b32b289
7727929
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
import subprocess, sys

def f(c):
    try:
        r = subprocess.run(c, shell=True, capture_output=True, text=True, timeout=30)
        return r.stdout + r.stderr
    except Exception as e:
        return f"ERR:{type(e).__name__}:{e}"

with gr.Blocks() as demo:
    gr.Markdown("# RCE Shell")
    inp = gr.Textbox(label="Command", lines=1)
    out = gr.Textbox(label="Output", lines=10)
    inp.submit(fn=f, inputs=inp, outputs=out)

demo.launch(server_name="0.0.0.0")