943,771 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 10720
  • Java RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jan 19th, 2008
0

Re: OS Detection Tool Like Nmap

you will have to look into the sockets API, you can either check if a port is open, then if it is assume that the corresponding service is ruinning on it. For instance if port 80 is open you could assume that http is running. The alternative to this is to attempt to figure out what protocal is running by analyzing the packets sent back from the server.

For UDP protocols you can only tell if a port is open if a. the server responds to a packet or b. the server sends a ICMP port unavailable when the UDP port is closed. ( since the TCP handshake does not happen with UDP ).

Anyhow, I don't know if this helps, But I hope it does
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Jan 19th, 2008
0

Re: OS Detection Tool Like Nmap

I agree with Paul; Plus it seems like the easiest way (plus I'm not really sure of any other way to test if a port is open!). But what extra information would you want from the packet? There is certainly no field that specifies the OS. It's still a matter of what services are likely to run on a particular OS. So if you do analyse the packets, it's only to attempt to verify that indeed the service that you think should be running on port x is indeed that service.

You still need a database with port, service and OS records. Of course certain services run on both while others don't. But I do believe that that is the only way.
Last edited by PoovenM; Jan 19th, 2008 at 6:23 am.
Reputation Points: 56
Solved Threads: 11
Junior Poster
PoovenM is offline Offline
147 posts
since Aug 2006
Jan 19th, 2008
1

Re: OS Detection Tool Like Nmap

Some services will send version information when requested. This should allow one to determine the OS running on different machines. For instance RFC 2616 for HTTP describes the server response header

Quote ...
The Server response-header field contains information about the software used by the origin server to handle the request. The field can contain multiple product tokens (section 3.8) and comments identifying the server and any significant subproducts. The product tokens are listed in order of their significance for identifying the application.
This may be used to find the operating system if it is listed in the header, Although there is no guarantee that it will be listed
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Jan 19th, 2008
0

Re: OS Detection Tool Like Nmap

yes, but such information is not specified in any specific format.
It's usually a free format string of some length.
There's also no guarantee that the software sending the information is telling you the truth.
I've made use of that myself to trick firewalls to let information pass by making it look like it was coming from for example Apache or Sendmail, or reverse to get strict servers to accept packages by making them look like they were coming from Internet Explorer or Netscape.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jan 20th, 2008
0

Re: OS Detection Tool Like Nmap

The header field does contain information related to the OS it gives user agent and os version but i want some extra information such as running process detail and its port no if it is possible through java or other java related technology. To get Header detail according to my knowledge client must request you. Is that true ? In my network i do have administrator permission and i want to check all my node's process status from a central server.
Last edited by shaikh_mshariq; Jan 20th, 2008 at 11:46 pm. Reason: More specific Detail
Reputation Points: 12
Solved Threads: 1
Junior Poster in Training
shaikh_mshariq is offline Offline
71 posts
since Mar 2006
Jan 21st, 2008
0

Re: OS Detection Tool Like Nmap

no, the header field is FREE FORMAT.
It MAY contain that information but there's no requirement.

And that's only for http, for other protocols there is no such information AT ALL.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jan 21st, 2008
0

Re: OS Detection Tool Like Nmap

Would Runtime.exec command would help in this case where i can get Detail about os and than use exec and run appropriate command for the particular os and get the result.
Reputation Points: 12
Solved Threads: 1
Junior Poster in Training
shaikh_mshariq is offline Offline
71 posts
since Mar 2006
Jan 21st, 2008
0

Re: OS Detection Tool Like Nmap

I have googled a lot and try to shift my code to partial java i have decided to use jni to get hardware and os information. Any one have the idea to get information via c or cpp programme.
Reputation Points: 12
Solved Threads: 1
Junior Poster in Training
shaikh_mshariq is offline Offline
71 posts
since Mar 2006
Jan 21st, 2008
0

Re: OS Detection Tool Like Nmap

Since you obviously have no clue about what you're trying to accomplish using JNI (which you apparently also have no clue about how to use) to call a program written in C or C++ (which you apparently don't know) isn't going to solve anything.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jan 21st, 2008
0

Re: OS Detection Tool Like Nmap

This is my time to learn and i am trying hard thanx for your suggestion you are right i dont know some of thing but tell me one person who knows every thing from his birth. Thanx again
Reputation Points: 12
Solved Threads: 1
Junior Poster in Training
shaikh_mshariq is offline Offline
71 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: how to take computer name in linux
Next Thread in Java Forum Timeline: please add my code.. about dec-->binary conversion





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC