Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: commands from web< Next Oldest | Next Newest >
JumpZero Offline





Group: Members
Posts: 5
Joined: May 2008
Posted: July 02 2010,17:29 QUOTE

Hello,

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 ===============
<HTML>
<FORM action="/cgi-bin/command.lua" method="get">
<P>
<LABEL>COMMAND:</LABEL>
<INPUT type="text" name="Command"><BR>
<INPUT type="submit" value="GO">
</P>
</FORM>
</HTML>
FIRST FILE END ================

SECOND FILE BEGIN ===============
#!/bin/lua
dofile("/opt/monkey-0.9.2/cgi-bin/cgi.lua")

print("Content-type: text/plain\n\n")
vars=(CGI.vars(CGI.content()))

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

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

Have fun!
--
Jmp0
Back to top
Profile PM 
0 replies since July 02 2010,17:29 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: commands from web

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code