PHP/Utility Function/system

Материал из Web эксперт
Перейти к: навигация, поиск

Calling the man Command

 
<html>
<head>
<title>Calling the "man" Command.This Script is NOT Secure</title>
</head>
<body>
<div>
<form action="<?php print $PHP_SELF ?>" method="post">
<p>
<input type="text" value="<?php print $_REQUEST["manpage"] ?>" name="manpage" />
</p>
</form>
<pre>
<?php
if ( isset( $_REQUEST["manpage"] ) ) {
  system( "man ".$_REQUEST["manpage"]." | col -b" );
}
?>
</pre>
</div>
</body>
</html>



Output man page

 
<?php
print "<pre>";
system( "man man | col -b", $return );
print "</pre>";
?>



pingserver.php

 
<?php
   $server = "www.example.ru";
   $count = 3;
   echo "<pre>";
   system("/bin/ping -c $count $server");
   echo "</pre>";
   system("killall -q ping");
?>



portscanner.php

 
<?php
   $target = "www.example.ru";
   echo "<pre>";
   system("/usr/bin/nmap $target");
   echo "</pre>";
   system("killall -q nmap");
?>