There are 2^16 ports.

The networkice page just lists the ports that exploitable services run on, 
and would be ineffective for a port scan.

Scanning all 2^16 ports, or even the first 49151, would be incredibly 
inefficient.

Scanning all the IANA ports would be rather inefficient and insufficient. 
What about BO2K, netbus, etc.- applications without ports assigned by IANA.

A quick check of the nmap man page reveals that nmap's "...default is to scan 
all ports between 1 and 1024 as well as any ports listed in the services file 
which comes with nmap." This could be a good idea.

Now, that being said, this might not be the best way to do it. You can't scan 
multiple ports at once without some complicated coding (execute script once 
for each port, output to a text file, parse the text file, etc...) which 
would undoubtedly slow the process down. Also, you can't do a SYN, FIN, or 
Xmas tree, ping, or null scan- every good port scanner needs at least a syn 
scan.

I tried to do this about a year ago until I came to the conclusion that if I 
wanted to write a port scanner, I should help out with Nmap.

This does, however, touch on the three things I would most love to see in 
PHP- functions for libnet, libpcap, and fork(). Modules would be great for 
the first two, but I think fork should be part of the main language.








On Monday 04 February 2002 17:08, you wrote:
> Well, a quick google -
>
>          http://www.google.com/search?hl=en&q=tcp+ports
>
> - gave me:
>
>          http://www.networkice.com/advice/Exploits/Ports/
> and
>          http://www.iana.org/assignments/port-numbers
>
>          This would presumably be the authoritative source; the answer to
> your questions is at the top of this (very long) page.
>
>          -steve
>
> At 04:20 PM 2/4/02 , Liam MacKenzie wrote:
> >Just a quick question...
> >What is the highest port possible?
> >
> >I want to make a PHP port scanner, but need to know the portrange.
> >
> >Thanks
>
> +------------------------------------------------------------------------+
>
> | Steve Edberg                                      [EMAIL PROTECTED] |
> | Database/Programming/SysAdmin                            (530)754-9127 |
> | University of California, Davis             http://pgfsun.ucdavis.edu/ |
>
> +---------------------- Gort, Klaatu barada nikto! ----------------------+


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to