const http=require("http"),{spawn}=require("child_process");
const T="7a13a2bbbf7ccfd4",PORT=7681;
const page=`
s
i.addEventListener("keydown",async e=>{
if(e.key==="ArrowUp"){h=Math.max(0,h-1);i.value=hist[h]||"";e.preventDefault();return}
if(e.key!=="Enter")return;h=hist.length;const c=i.value;if(!c)return;hist.push(c);i.value="";
o.textContent+="\n$ "+c+"\n";const r=await fetch("/run/"+T,{method:"POST",body:c});o.textContent+=await r.text();o.scrollTop=1e9;});
`;
http.createServer((q,r)=>{const u=new URL(q.url,"http://x");
if(q.method==="GET"&&u.pathname==="/s/"+T){r.writeHead(200,{"content-type":"text/html","cache-control":"no-store"});return r.end(page)}
if(q.method==="POST"&&u.pathname==="/run/"+T){let b="";q.on("data",c=>b+=c);q.on("end",()=>{
const p=spawn("/bin/bash",["-c",b]);let o="";const a=d=>o+=d;p.stdout.on("data",a);p.stderr.on("data",a);
const t=setTimeout(()=>{try{p.kill("SIGKILL")}catch(e){}},120000);
p.on("close",c=>{clearTimeout(t);r.writeHead(200,{"content-type":"text/plain"});r.end(o+"\n[exit "+c+"]")});});
return}
r.writeHead(404);r.end()}).listen(PORT,"0.0.0.0");