Waraxe IT Security Portal
Login or Register
November 5, 2024
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 74
Members: 0
Total: 74
Full disclosure
4 vulnerabilities in ibmsecurity
32 vulnerabilities in IBM Security Verify Access
xlibre Xnest security advisory & bugfix releases
APPLE-SA-10-29-2024-1 Safari 18.1
SEC Consult SA-20241030-0 :: Query Filter Injection in Ping Identity PingIDM (formerly known as ForgeRock Identity Management) (CVE-2024-23600)
SEC Consult SA-20241023-0 :: Authenticated Remote Code Execution in Multiple Xerox printers (CVE-2024-6333)
APPLE-SA-10-28-2024-8 visionOS 2.1
APPLE-SA-10-28-2024-7 tvOS 18.1
APPLE-SA-10-28-2024-6 watchOS 11.1
APPLE-SA-10-28-2024-5 macOS Ventura 13.7.1
APPLE-SA-10-28-2024-4 macOS Sonoma 14.7.1
APPLE-SA-10-28-2024-3 macOS Sequoia 15.1
APPLE-SA-10-28-2024-2 iOS 17.7.1 and iPadOS 17.7.1
APPLE-SA-10-28-2024-1 iOS 18.1 and iPadOS 18.1
Open Redirect / Reflected XSS - booked-schedulerv2.8.5
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Php -> PHP-NMAP
Post new topicReply to topic View previous topic :: View next topic
PHP-NMAP
PostPosted: Wed Jun 08, 2005 3:06 pm Reply with quote
LINUX
Moderator
Moderator
Joined: May 24, 2004
Posts: 404
Location: Caiman




good project, install php-nmap in one owned server Smile is very good for fast and stealth scan

PHP-NMAP really like Laughing
--------
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
View user's profile Send private message Visit poster's website
PostPosted: Wed Jun 08, 2005 6:25 pm Reply with quote
Injector
Active user
Active user
Joined: Dec 29, 2004
Posts: 49




thats a good one LINUX tnx Very Happy

I'll try this one today Twisted Evil
View user's profile Send private message
PostPosted: Fri Jun 10, 2005 5:15 am Reply with quote
shai-tan
Valuable expert
Valuable expert
Joined: Feb 22, 2005
Posts: 477




Nice....... Thanks man

_________________
Shai-tan

?In short: just say NO TO DRUGS, and maybe you won?t end up like the Hurd people.? -- Linus Torvalds
View user's profile Send private message
PostPosted: Wed Jul 14, 2010 8:08 am Reply with quote
tsabitah
Valuable expert
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
View user's profile Send private message Visit poster's website
PHP-NMAP
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

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.037 Seconds