commands from web

Forum: DSL Tips and Tricks
Topic: commands from web
started by: JumpZero

Posted by JumpZero on July 02 2010,17:29

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
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!

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.