Port scanner problem
Posted on
16th Feb 2014 07:03 pm by
admin
Hai
recently i developed one app through which u can check the opened and closed ports under an ip address or domain.but there is a small error.
if no port numbers are given then it should scan from 1-100 ports.but it is scanning only first 5 ports..
can anyone help me out..
Code: <html>
<title>Check the Open ports</title>
<pre> <font size=3><b>Hai
Using this application u can check the ports that are opened in the ip address
Common Ports Used are
FTP 21
SSH 22
Telnet 23
SMTP 25
Web 80
Pop 3 110
IMAP 143
Other Applications
Remote Desktop 3389
PC Anywhere 5631</b></font>
</pre>
<body background="image01.jpg" bgproperties="fixed">
<form action="timer.php" method="POST">
<table align="center" border="1" bordercolor="black">
<tr>
<td align="left" bgcolor="transparent" valign="center">Ip address:<input type=text style="color: #FF0000;font-family: Verdana;font-weight: bold;font-size: 14px;background-color: transparent;" maxlength='30' name=address></td></tr><tr></tr>
<tr><td align="left" bgcolor="transparent" valign="center">Port Number:<input type=text style="color: #FF0000;font-family: Verdana;font-weight: bold;font-size: 14px;background-color: transparent;" maxlength='25' name=service></td></tr>
<tr><td align="center" valign="center"><input type=submit name=submit value=Submit></td>
</tr>
</table>
</form>
</body>
</html>
<?php
error_reporting(0);
$address = $_POST['address'];
$service = $_POST['service'];
if($address && $service)
{
if(fsockopen($address,$service,$errno,$errstr,10))
{
//echo "$address:$service is up!";
echo ("<table><td bgcolor=yellow width=100% align='center'><font face=Verdana, Arial, Helvetica, sans-serif size=2><b>$address:$service is up!</b></font></td></table>");
}
else
{
//echo "$address:$service is NOT up!";
echo ("<table><td bgcolor=yellow width=100% align='center'><font face=Verdana, Arial, Helvetica, sans-serif size=2><b>$address:$service is Down!</b></font></td></table>");
}
}
elseif($address)
{
for($service=10;$service<=100;$service++)
{
$sock_check=fsockopen($address,$service,$errno,$errstr,10);
if(!$sock_check)
{
echo ("<table><td bgcolor=yellow width=100% align='center'><font face=Verdana, Arial, Helvetica, sans-serif size=2><b>$address:$service is Down!</b></font></td></table>");
}
else
{
echo ("<table><td bgcolor=yellow width=100% align='center'><font face=Verdana, Arial, Helvetica, sans-serif size=2><b>$address:$service is up!</b></font></td></table>");
}
}
}
else
{
}
?>
No comments posted yet
Your Answer:
Login to answer
214
23
Other forums
Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato
Securing a user input - need some confirmation
Hello All,
I am in the process of recoding a large proportion of an e-commerce site, one of t
Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c
form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for
Array becomes unset by itself?
Hi,
I have a bit of experience with PHP but not extensive. It seems I cannot store any items
update sql when refresh - php
hi
I have made a table (attachement)
the users can update the sql database using + or x bu
Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,
The code below works great. It creates a table that shows the 25 most recently added t
How do I get the row number from from an sql table query
Hi all
I have a table that I query and it returns a number of rows.
mysql_num_rows($query)
Converting RGB values to HEX
Code: <?PHP
$file_handle = fopen("colors/rgb.csv", "r");
wh
Limiting uploaded file type
I am working on a simple upload script, and I need it to limit the allowed file type that is uploade