|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 50
Members: 0
Total: 50
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
PHP-NMAP |
|
Posted: Wed Jun 08, 2005 3:06 pm |
|
|
LINUX |
Moderator |
|
|
Joined: May 24, 2004 |
Posts: 404 |
Location: Caiman |
|
|
|
|
|
|
good project, install php-nmap in one owned server is very good for fast and stealth scan
PHP-NMAP really like
--------
Ideally, you should be able to unpackage php-nmap-xx.yy.tar.gz, edit nmap.php, and copy it someplace in your documentroot path. You need to have a webserver and PHP installed. You will also need nmap (http://www.insecure.org/nmap/) installed.
You will need to suid root nmap if you wish for web users to be able to use the Stealth Scans.
You REALLY SHOULD htpasswd php-nmap. When you get threatening emails from the University of California and the DoD because someone used your install of php-nmap to attack them, don't say I didn't tell you so!
If you have comments or suggestions, feel free to email me.
-- sirmorcant@morcant.org
source for view Code: | <?php
// Path to NMAP Executable
$nmapcmd = '/usr/bin/nmap';
// Default Scan Type
// To get SYN, you need to chmod +s nmap
$default_scan_option = 'connect';
// Enable verbose output
$default_verbose = true;
// Default Ping Type
$default_ping_type = 'tcp_icmp';
// Detect OS Type
$default_os_detect = true;
// Default host should be that of the client
$default_remote_addr = true;
// Host Flags
$host_flags = '';
// Table Background Color
$tablebgcolor = '#e1e1e1';
// Host Section Background Color
$hostsectioncolor = '#913a47';
// Scan Section Background Color
$scansectioncolor = '#3c7996';
// General Section Background Color
$generalsectioncolor = '#3a914b';
?>
<html>
<head>
<title>PHP-NMAP</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
</head>
<body>
<?php
if ($submit && $host) {
$args = '';
switch ($scan_type) {
case 'connect':
$args .= '-sT ';
break;
case 'syn':
$args .= '-sS ';
break;
case 'null':
$args .= '-sN ';
break;
case 'fin';
$args .= '-sF ';
break;
case 'xmas':
$args .= '-sX ';
break;
case 'ack':
$args .= '-sA ';
break;
case 'window':
$args .= '-sW ';
break;
case 'ping';
$args .= '-sP ';
break;
default:
$args .= '-sT ';
break;
}
switch ($ping_type) {
case 'tcp':
$args .= '-PT ';
break;
case 'tcp_icmp':
$args .= '-PB ';
break;
case 'icmp':
$args .= '-PI ';
break;
case 'none':
$args .= '-P0 ';
break;
default:
$args .= '-PB ';
break;
}
if ($os_detect)
$args .= '-O ';
if ($ident_info)
$args .= '-I ';
if ($fragmentation)
$args .= '-f ';
if ($verbose)
$args .= '-v ';
if ($use_port)
$args .= '-p ' . escapeshellarg($port_range);
if ($fast_scan)
$args .= '-F ';
if ($use_decoy)
$args .= '-D ' . escapeshellarg($decoy_name);
if ($use_device)
$args .= '-e ' . escapeshellarg($device_name);
if ($dont_resolve)
$args .= '-n ';
if ($udp_scan)
$args .= '-sU ';
if ($rpc_scan)
$args .= '-sR ';
$args .= $host_flags . ' ' . escapeshellarg($host);
// echo ($nmapcmd . ' ' . $args);
?>
<pre>
<?php
system($nmapcmd . ' ' . $args . ' 2>&1');
?>
</pre>
<?php
/* if (($fp = popen($nmapcmd . ' ' . $args . ' 2>&1', 'w')) != false) {
while (!feof($fp)) {
$read = fread($fp, 512);
echo str_replace("\n", "<br>\r\n", $read);
flush();
}
pclose($fp);
} else {
echo 'Error running nmap.<br>';
return;
}
*/
} else {
?>
<form action="<?php echo $SCRIPT_NAME; ?>" method="post">
<div class="header-banner" align="center">
<font size="+3">PHP-NMAP</font><br>
<br>
</div>
<table bgcolor="<?php echo $tablebgcolor; ?>" border="0" cols="4" width="550" cellpadding="5" cellspacing="0" align="center">
<tr bgcolor="<?php echo $hostsectioncolor; ?>">
<td width="100"><b>Host(s) to scan</b>:</td>
<td width="200" colspan="2"><input type="text" name="host" size="20" value="<?php if ($default_remote_addr) echo $REMOTE_ADDR; ?>"></td>
<td width="100" align="right"><input type="submit" name="submit" value="Scan"> ;;<input type="reset" value="Clear"></td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><b>Scan Options</b>:</td>
<td width="100" bgcolor="<?php echo $generalsectioncolor; ?>"> ;;</td>
<td width="100" bgcolor="<?php echo $generalsectioncolor; ?>"><b>General Options</b>:</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"> ;;</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="connect" <?php if ($default_scan_option == 'connect') echo 'CHECKED'; ?>> connect()</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="dont_resolve"> Don't Resolve</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="radio" name="ping_type" value="tcp" <?php if ($default_ping_type == 'tcp') echo 'CHECKED'; ?>> TCP Ping</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="fragmentation"> Fragmentation</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="syn" <?php if ($default_scan_option == 'syn') echo 'CHECKED'; ?>> SYN Stealth</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="fast_scan"> Fast Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="radio" name="ping_type" value="tcp_icmp" <?php if ($default_ping_type == 'tcp_icmp') echo 'CHECKED'; ?>> TCP&ICMP Ping</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="ident_info"> Get Ident Info</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="null" <?php if ($default_scan_option == 'null') echo 'CHECKED'; ?>> NULL Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="verbose" <?php if ($default_verbose) echo 'CHECKED'; ?>> Verbose</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="radio" name="ping_type" value="icmp" <?php if ($default_ping_type == 'icmp') echo 'CHECKED'; ?>> ICMP Ping</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="resolve_all"> Resolve All</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="fin" <?php if ($default_scan_option == 'fin') echo 'CHECKED'; ?>> FIN Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="udp_scan"> UDP Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="radio" name="ping_type" value="none" <?php if ($default_ping_type == 'none') echo 'CHECKED'; ?>> Don't Ping</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="os_detect" <?php if ($default_os_detect) echo 'CHECKED'; ?>> OS Detection</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="xmas" <?php if ($default_scan_option == 'xmas') echo 'CHECKED'; ?>> XMAS Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="rpc_scan"> RPC Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"> ;;</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"> ;;</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="ack" <?php if ($default_scan_option == 'ack') echo 'CHECKED'; ?>> ACK Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="use_port"> Port Range:</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="use_decoy"> Use Decoy(s):</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="checkbox" name="use_device"> Use Device:</td>
</tr>
<tr>
<td bgcolor="<?php echo $scansectioncolor; ?>"><input type="radio" name="scan_type" value="window" <?php if ($default_scan_option == 'window') echo 'CHECKED'; ?>> Window Scan</td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="text" name="port_range" size="10"></td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="text" name="decoy_name" size="10"></td>
<td bgcolor="<?php echo $generalsectioncolor; ?>"><input type="text" name="device_name" size="10"></td>
</tr>
</table>
</form>
<?php
} // if ($submit)
?>
</body>
</html>
|
Download: http://www.geekinventions.com/modules.php?name=Downloads&d_op=getit&lid=3 |
|
|
|
|
|
|
|
|
Posted: Wed Jun 08, 2005 6:25 pm |
|
|
Injector |
Active user |
|
|
Joined: Dec 29, 2004 |
Posts: 49 |
|
|
|
|
|
|
|
thats a good one LINUX tnx
I'll try this one today |
|
|
|
|
Posted: Fri Jun 10, 2005 5:15 am |
|
|
shai-tan |
Valuable expert |
|
|
Joined: Feb 22, 2005 |
Posts: 477 |
|
|
|
|
|
|
|
|
_________________ Shai-tan
?In short: just say NO TO DRUGS, and maybe you won?t end up like the Hurd people.? -- Linus Torvalds |
|
|
|
Posted: Wed Jul 14, 2010 8:08 am |
|
|
tsabitah |
Valuable expert |
|
|
Joined: Jul 07, 2010 |
Posts: 328 |
Location: surabaya |
|
|
|
|
|
|
very good topic, because I often use a tool zenmap
Zenmap - Official cross-platform GUI Nmap Security Scanner |
|
|
|
|
www.waraxe.us Forum Index -> Php
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|