Join us at IRC!
The measure of a mans life is not how well he dies, but how well he lives.
Friday, May 25, 2012
Navigation
Members Online
Total Online: 31
Web Spiders: 11
Guests Online: 28
Members Online: 3

Registered Members: 70208
Newest Member: andresuran
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

PHP Port Scanner

BobbyB
Member



Posts: 260
Location: England
Joined: 16.03.05
Rank:
Monster
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.


<?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

wolfmankurd
Member



Posts: 1519
Location: UK
Joined: 30.05.05
Rank:
God
Posted on 17-11-05 23:01
nice,


BY READING MY POST, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE USE OF THIS (MIS)INFORMATION.


Widowmakr@hotmail.com http://LetsHackStuff.com
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.