DSL Tips and Tricks :: commands from web


I found a nice way to send Linux commands to the system from the web :
The monkey web server must be running
copy/paste the first file in /opt/monkey/htdocs give the name: command.html
copy/paste the second file in /opt/monkey/cgi-in/ give the name: command.lua
from a naviguator go to your.dsl.ip.box/command.html
All commands are not working because of some caracters like / or | or .. but you can have the output of :
ls, pwd, ps aux, mount, cat file, etc..

Of course take care of your security : don't use outside your local network...

FIRST FILE BEGIN ===============
<FORM action="/cgi-bin/command.lua" method="get">
<INPUT type="text" name="Command"><BR>
<INPUT type="submit" value="GO">
FIRST FILE END ================

SECOND FILE BEGIN ===============

print("Content-type: text/plain\n\n")

io.write("\n=============COMMAND START===================\n")
local f = io.popen(vars.Command)
local l = f:read("*a")
io.write("=============COMMAND END===================\n")

SECOND FILE END ================

Have fun!

original here.