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
{

}
?>

214 Like 23 Dislike
Previous php-forum Next php-forum
Other php-forum

Amend code to allow multiple attachments
Hi

I have a php page that allows the user to browse to a file (image) then sumbit, the confi

MySQL-PHP Query Results Help
Hello all. I'm hoping to be able to get some help in solving a problem with query/rowcount output. I

URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But

re calling a function without including file
Hi,
i am new to programming in php, i was just checking the wordpress code and found out in the w

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

Image upload - determine folder
I have an upload script that may be accessed from different directories. Problem is, the script is m

how do I show what a user have selected from a checkbox?
From my code below, how would i show which check boxes have been checked and which radio buttons sel

Extract specific information from a PHP Multidimensional Array
Howdy! I've racked my brain over this for 24 hours now. I think it's time I asked for help. I'm lear

Warning: mysql_num_rows() expects parameter 1
When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash