Follow us on Twitter!
Don't judge the unknown - Grindordie
Monday, April 21, 2014
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: 31
Guests Online: 28
Members Online: 3

Registered Members: 82858
Newest Member: alexxkim
Latest Articles
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,