Different error messages...

This is a discussion on Different error messages... within the Networking/Device Communication forums, part of the General Programming Boards category; Well, I have been wondering, I can implement a basic port scanner, but it only works if the connection is ...

  1. #1
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790

    Different error messages...

    Well, I have been wondering, I can implement a basic port scanner, but it only works if the connection is open on the other computer,how do you detect whether or not there is some service on a port that is closed in unix? I know NMap can do it, I just dont have the source to look at.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>but it only works if the connection is open on the other computer
    Isn't that what a port scanner is for, determining which ports are open and which are closed?

    >>how do you detect whether or not there is some service on a port that is closed in unix
    If the port if closed, there's no service on it.

    If a port is found to be open, your software then needs to try to understand what that port is used for. So, for example, if you successfully open port 80, you can send in an HTTP request. The response you get back will help you understand which web server software is running on that host. In order to do this for all known ports, you need to study how to use each protocol. Another easy example would be FTP, where the FTP server gives you a banner page telling you it's brand and version
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    Quote Originally Posted by Hammer
    >>but it only works if the connection is open on the other computer
    Isn't that what a port scanner is for, determining which ports are open and which are closed?
    well, not exactly, if you run NMap, it will give all services that are currently running on the computer, even if they are locked to outside connection.... I need to download the source...

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21