Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Monday, April 27, 2015
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 29
Guests Online: 28
TeamSpeak Online : 5 Members Online: 1

Registered Members: 88073
Newest Member: madatoyo
Latest Articles
Our sponsor needs your help!


One of our sponsors needs your help, http://www.virginmediabusiness.co.uk/pitch-to-rich/grow/krystal-hosting/
Go check out their video and Don't forget to vote !


~ Thanks for your help
HBH
View Thread

HellBound Hackers | Computer General | Programming

Author

PHP Port Scanner


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-11-05 21:41
I wrote a port scanner in php. Its a very unstealthy and simple piece of code - it just does the old connect() scan, so it is easily logged.

However, the reason I wrote it is because it could come in quite handy. With a http proxy, you are only concealed behind port 80, the http port. But, host this on a free account and access it from behind a proxy, and the server will do the scanning. You will be concealed.

Well, that's the theory.

Code

<?php
error_reporting(0);
$address = "127.0.0.1"; //Change this to data sent from a HTML form
$startport = 1; //Change this to data sent from a HTML form
$endport = 500; //Change this to data sent from a HTML form
if ($startport > $endport){exit("Starting port must be greater than or equal to finishing port!\n");}
if ($socket < 0){exit("Couldn't create socket");}
for ($port = $startport; $port <= $endport; $port++)
{
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connect = socket_connect($socket, $address, $port);
if ($connect > 0){echo "Port ".$port." is open\n";}
socket_close($socket);
}
?>





Author

RE: PHP Port Scanner


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-11-05 23:01
nice,