Is it possible to use like an exec and feed it from standard input?
What i am trying to do is something similar to netsh -r servername. This loads netsh command prompt to be executed. Then feed it the commands from a test file or prefilled in?
php cli scripts
Moderator: General Moderators
-
rogerthomas84
- Forum Newbie
- Posts: 1
- Joined: Thu Feb 15, 2007 1:58 pm
Something Interesting
I recently made this script:
Basically you can execute commands on the linux command line, like ls, whois, etc. i havent really played with it enough to know what its capabilities are 100% but if you do discover any really big issues then email me at roger@welshdragonhome.com.
Also please ensure its behind a password protected directory.
Code: Select all
<?php
if (isset($_POST['command']))
{
echo "<form action='?do=process' method='post'>";
echo "<textarea name='command' rows='2' cols='50'>$command</textarea><br>";
echo "<input type='submit' value='Execute'>";
exec($command,$arr);
$arr = join("<br>",$arr);
echo "<br><font color='blue'><b>Command : ".$command."</b></font>";
echo "<hr><br><b>Results : </b><br>".$arr."<hr>";
}
else
{
echo "<form action='?do=process' method='post'>";
echo "<textarea name='command' rows='2' cols='100'>$command</textarea>";
echo "<input type='submit' value='Execute'>";
}
?>Also please ensure its behind a password protected directory.