Hello, I got surprised, some people said fishy, other is worried about
virus, anyway here is a piece of code that is scanning a set of IP addresses
for ports : ports 80, 8000, 8080  :
public static void scan(InetAddress remote) {
     int[] ports = {80,8000, 8080};
    String hostname = remote.getHostName();
    for (int i = 0 ; i < 3; i++) {
         System.out.println("current port scanning is :" + ports[i]);
      try {
        Socket s = new Socket(remote, ports[i]);
        System.out.println("A server is listening on port " + ports[i]
         + " of " + hostname);
                 if (ports[i] == 80)
                 System.out.println("Maybe a WEB SERVER is running in this hostname " 
+ "
" + hostname + " " + "at port" + " " + ports[i]);
        s.close();
      }
      catch (IOException e) {
        System.out.println("The remote host is not listening on this
port\n");
      }
    }

  }

and here is some results :

C:\>java  MajidPortScanner3
155.108.0.1
this is the ip address : 155.108.0.1
current port scanning is :80
The remote host 155.108.0.1is not listening on this port

current port scanning is :8000
The remote host 155.108.0.1is not listening on this port

current port scanning is :8080
The remote host 155.108.0.1is not listening on this port

155.108.0.2
this is the ip address : 155.108.0.2
current port scanning is :80
The remote host 155.108.0.2is not listening on this port

current port scanning is :8000
The remote host 155.108.0.2is not listening on this port

current port scanning is :8080
The remote host 155.108.0.2is not listening on this port
....................................
155.108.117.82
current port scanning is :80
A server is listening on port 80 of MIL2WWDS011
Maybe a WEB SERVER is running in this hostname  MIL2WWDS011 at port 80

current port scanning is :8000
The remote host 155.108.0.2is not listening on this port

My question was how do I know what type of werb server is running in
155.108.117.82 in port 80 ???

thanks



>From: Colin Marshall <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Type of web server from socket ??
>Date: Tue, 5 Feb 2002 14:19:39 -0000
>
>That's what I thought too. The mention of scanning IP addresses to identify
>the web server as IIS seems fishy.
>
>-----Original Message-----
>From: A mailing list about Java Server Pages specification and reference
>[mailto:[EMAIL PROTECTED]]On Behalf Of Andy Cobley
>Sent: 05 February 2002 13:50
>To: [EMAIL PROTECTED]
>Subject: Re: Type of web server from socket ??
>
> > -----Original Message-----
> > From: Patrick Bowe [mailto:[EMAIL PROTECTED]]
> > Sent: 05 February 2002 13:28
> > To: [EMAIL PROTECTED]
> > Subject: Re: Type of web server from socket ??
> >
> > If you want to use a system call, you can telnet to port 80,
> > and issue the command "GET / HTTP/1.0" followed by two returns.
> > You'd have to filter the output for the line that starts with "Server:"
> >
> > ex:
> >
> > $ telnet <server> 80
> > Trying...
> > Connected to <server>.lmig.com.
> > Escape character is '^]'.
> > GET / HTTP/1.0
>
>You certainly could but I want to know why anyone would want to do this.
>Combined with the other recent threads about incrementing IP addresses and
>a
>mention of "port scanning" I'm just a little worried that there seems to be
>some sort of "DOS attack" or virus tutorial running on this list !
>
>Andy c
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to