PHP/Utility Function/system

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

Calling the man Command

   <source lang="html4strict">

<html> <head> <title>Calling the "man" Command.This Script is NOT Secure</title> </head> <body>

<form action="<?php print $PHP_SELF ?>" method="post">

<input type="text" value="<?php print $_REQUEST["manpage"] ?>" name="manpage" />

</form>

<?php
if ( isset( $_REQUEST["manpage"] ) ) {
  system( "man ".$_REQUEST["manpage"]." | col -b" );
}
?>

</body> </html>

 </source>
   
  


Output man page

   <source lang="html4strict">

<?php

print "
";
system( "man man | col -b", $return );
print "
";

?>

 </source>
   
  


pingserver.php

   <source lang="html4strict">

<?php

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

?>

 </source>
   
  


portscanner.php

   <source lang="html4strict">

<?php

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

?>

 </source>