The Artima Developer Community
Sponsored Link

Java Answers Forum
Help Please

8 replies on 1 page. Most recent reply: Sep 29, 2003 9:28 AM by shon

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 8 replies on 1 page
shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Help Please Posted: Sep 27, 2003 3:51 AM
Reply to this message Reply
Advertisement
Can anyone tell me how to get other computer system info beyond the network using ip ?

let say i used JAVA CODE getting other computer ip,
how to get the computer os version, system info by using ip?

does i possible ?


Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Help Please Posted: Sep 27, 2003 5:25 AM
Reply to this message Reply
nmap will be able to get you this stuff.. Why don't you execute nmap with the right switches from Java code.

shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Re: Help Please Posted: Sep 27, 2003 5:32 AM
Reply to this message Reply
u mean have to install nmap from http://www.insecure.org/nmap/ ? isn't it ...
OKay , thanks.

shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Re: Help Please Posted: Sep 27, 2003 10:43 AM
Reply to this message Reply
if don't used nmap, does it possible to do that using java?
if has teach me how to start....
thanks

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Help Please Posted: Sep 28, 2003 7:55 AM
Reply to this message Reply
The source code at:
http://www.quantumhyperspace.com/SourceBank/viewCode.jsp?javaFile=Net.java
runs the windows ne command
It may be similar to what you are wanting to do.

Check out the System class in the API.
The static method getProperties returns:


getProperties
public static Properties getProperties()Determines the current system properties.
First, if there is a security manager, its checkPropertiesAccess method is called with no arguments. This may result in a security exception.

The current set of system properties for use by the getProperty(String) method is returned as a Properties object. If there is no current set of system properties, a set of system properties is first created and initialized. This set of system properties always includes values for the following keys: Key Description of Associated Value
java.version Java Runtime Environment version
java.vendor Java Runtime Environment vendor
java.vendor.url Java vendor URL
java.home Java installation directory
java.vm.specification.version Java Virtual Machine specification version
java.vm.specification.vendor Java Virtual Machine specification vendor
java.vm.specification.name Java Virtual Machine specification name
java.vm.version Java Virtual Machine implementation version
java.vm.vendor Java Virtual Machine implementation vendor
java.vm.name Java Virtual Machine implementation name
java.specification.version Java Runtime Environment specification version
java.specification.vendor Java Runtime Environment specification vendor
java.specification.name Java Runtime Environment specification name
java.class.version Java class format version number
java.class.path Java class path
java.library.path List of paths to search when loading libraries
java.io.tmpdir Default temp file path
java.compiler Name of JIT compiler to use
java.ext.dirs Path of extension directory or directories
os.name Operating system name
os.arch Operating system architecture
os.version Operating system version
file.separator File separator ("/" on UNIX)
path.separator Path separator (":" on UNIX)
line.separator Line separator ("\n" on UNIX)
user.name User's account name
user.home User's home directory
user.dir User's current working directory



There is also some info embedded into the http request made by a user's web browser when they conect to a web site. IT has things like the user's IP address, the user-agent or the web browser type, To program this you have to have access to a web server.

Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Help Please Posted: Sep 28, 2003 6:26 PM
Reply to this message Reply
Charles,

[let say i used JAVA CODE getting other computer ip,
how to get the computer os version, system info by using ip?]


Charles,

The system properties you have specified to get the OS and other information about a machine is only applicable to the machine where the Java program (JVM) is running right? (Correct me if I am wrong)

But the original question looks like he/she wants to acquire information about a remote machine using IP. The net command is a solution, but what information you could acquire from the remote machine with that command?

shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Re: Help Please Posted: Sep 28, 2003 6:29 PM
Reply to this message Reply
is seems like very cimplicated,I can't understand. Do you mind explain it how to take a first steps? Thanks for you help.

Greg

Posts: 18
Nickname: singleton
Registered: Jun, 2003

Re: Help Please Posted: Sep 29, 2003 6:32 AM
Reply to this message Reply
Well there are a number of possibilites that I can think
of. One would be to use a URLConnection and use the
getHeaderFields method to get info about the machine but
this only works if there is a web server running there.

Short of this I'd suggest
connecting to known ports and identifying the os by
which are open. Here's a list of known port by os. See
below.

--------------------------------------------------------
<|Remote Operating System Detection|>
By: Virtual_Mage

One thing that is a valuable skill among hackers is the ability to be able to figure out what operating system a remote computer has installed on it. While there are programs which do this, those programs are not as accurate as the human mind is. Programs such as nmap that claim to do this, only do so by looking at what ports the computer has open, and then use that information to make an educated guess. The purpose of this tutorial is to teach you how to do this without the aid of anything except the program netcat, or telnet if you don't have netcat.

I. The No Brainers

There are a few situations in which it is very easy to determine what OS a computer uses. For example, if the IP address of the computer happens to be in the IP block owned by AOL or MSN, then it probably is not using a *nix style operating system, since AOL does not support UNIX/Linux and MSN doesn't either. Also, a great way to find oit what OS a webserver has is to telnet to port 80 and hit enter a few times, until it give you an error message. The error message will probably say what webserver software the computer is using. If it uses IIS, then you know that it is either Windows NT or 2000, and can safely assume that it is the server version of one of them. However, if it were using Apache, then you might be able to assume that it is using *nix, since Apache comes with *nix, and must be downloaded if a windows user wants to use it.

II. Unique Ports

Some operating systems have ports that they use for various things, that no other operating system uses. This is a brief list of such ports.

Windows Systems:
135 ( end point mapper/ DCOM services )
139 ( netbios )
445 ( SMB port; only windows 2000 )
500 ( IKE/IPSEC )
1024-1030 ( Windows 2000 RPC services )
3268 ( Active Directory; Win NT and 2000 only )

*NIX Systems:
139 ( SAMBA )
513 ( rlogin )
6000 ( X Windows )
514 ( rshell )
517 ( talk )
901 ( SAMBA swat )

Common Trojans ( since most trojans only run on windows )
12345 ( netbus )
31337 ( backorifice )
27374 ( sub seven )

By checking a remote computer for the the ports above, it's rather easy to get a general idea of what operating system the computer uses. In some cases, you may even be able to figure out exactly which OS just by the open ports.

III. TCP/IP Services

There are several TCP/IP services that both *nix and Windows use, which can be used to help identify the OS. In general, you can assume any computer which has these ports open is a server of some sort.

Telnet (23)
Many times you can discern the OS a computer uses simply by telnetting to it. Most *NIX style OS'es will come right out and tell you which OS they are, even the version, when you telnet to them.

SSH (22)
It is normally safe to assume that most computers using SSH are *NIX, because *NIX comes with SSH already installed, and Windows does not.

SMTP (25)
Sometimes, you can tell what OS a computer is using just by telnetting to port 25 on it and seeing what version of sendmail it uses. Many versions of *NIX use their own version of SMTP, and many times, a corporation will install a third party senndmail server on their computers, rather then the one that comes with it. In that case, it's as simple as checking what OS'es are supported by that particular sendmail software.

FTP (21)
This is pretty much the same deal as SMTP.

HTTP (80)
Telnet to it to see what webserver software it uses. If it's IIS, then it is without a doubt a Windows computer.


IV. Routers

There may be times that you find some of these ports open, and are wondering what they are, or you know that a network using a router, but you don't know what kind. Well, the below is basically for finding out what kind of router it is.

CISCO Routers:
21
23
79
80
512
513
514
1993
1999
2001
4001
6001
9001
49 (UDP)
67 (UDP)
123 (ntp)
161 (udp)

CISCO Switches:
23
80
7161
123 (UDP)
161 (UDP)

Bay Routers:
21
23
7 (UDP)
9 (UDP)
67 (UDP)
68 (UDP)
69 (UDP)
161 (UDP)
520 (UDP)

Ascend Routers:
23
7 (UDP)
9 (UDP)
161 (UDP)
162 (UDP)
514 (UDP)
520 (UDP)

shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Re: Help Please Posted: Sep 29, 2003 9:28 AM
Reply to this message Reply
do u mean used telnet ot netcat to access to the remote pc ?
actually i get a function which re netstat -an to get open port of the remote pc, but it seems like hard to excecute the command throught telneting to remote pc ...

But anyway i will try ..

Any other suggestion ?

Flat View: This topic has 8 replies on 1 page
Topic: populating a tree from a database Previous Topic   Next Topic Topic: Java Links

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use