Skip to content

Instantly share code, notes, and snippets.

@AlifArnado
Created November 20, 2015 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlifArnado/ae5a838da83004b1fb46 to your computer and use it in GitHub Desktop.
Save AlifArnado/ae5a838da83004b1fb46 to your computer and use it in GitHub Desktop.
Testing Call System Nmap Using PHP
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Scanner Port Using NMap PHP</title>
<link rel="stylesheet" href="">
</head>
<body>
<form method="POST" action="">
<label for="input URL">Input URL or IPAddress</label>
<input type="text" name="url_name" value="" placeholder="input url or IpAddress">
<input type="submit" name="submit" value="Scanner This Port">
</form>
</body>
</html>
<?php
/**
* Mencoba meremote system Nmap Menggunakan PHP
* Name : Alif Benden Arnado
* Author : PHP Network
*/
if ($_POST) {
try {
$server = $_POST['url_name'];
/*---------- Setting Directory Nmap Location ----------*/
echo "<pre>";
echo "<h3>Report Scanning Nmap : </h3>";
system("/usr/bin/nmap $server");
echo "</pre>";
} catch (Exception $e) {
die("map Not Foun". $e);
} finally {
/*---------- Kill Task Nmap ----------*/
system("killall -q nmap");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment