Sign in to follow this  
Followers 0
publicenemy

Window Current Ip

14 posts in this topic

#1 ·  Posted (edited)

I would like to know if its possible to get the IP that is in use by a Window by using AutoIt.

Ex: IE is currently on ip xx.xx.xx.xx:port or X program is on IP xx.xx.xx.xx:port

Thanks very much.

Edited by publicenemy

Share this post


Link to post
Share on other sites



@IPAddress1

IP address of first network adapter.  Tends to return 127.0.0.1 on some computers.

@IPAddress2

IP address of second network adapter.  Returns 0.0.0.0 if not applicable.

@IPAddress3 IP address of third network adapter.  Returns 0.0.0.0 if not applicable. 

@IPAddress4 IP address of fourth network adapter.  Returns 0.0.0.0 if not applicable. 


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Thanks but this is not really what im trying to achieve. As an example, open any computer game, enter lan or internet game

Open command prompt and type netstat

This is the type of info i want but for a SPECIFIC window, like "Unreal Tournament window".

Thanks.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ahh, you want a port monitor type responce. Application blah.exe using port 80 on IP 227.31.51.243.

You can get AutoIt to grab most information from a command line program.

runwait('cmd /c netstat >c:\tempstat.txt ','',@sw_hide)

then read the file and delete it after :D

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Tks for the command, very nice.

But lets say you have 3 programs using same Port, how do you figure which program is which?

Edited by publicenemy

Share this post


Link to post
Share on other sites

The server name should not be the same...

Share this post


Link to post
Share on other sites

All I see is a bunch of IP's with netstat. If i know which port the application uses i can figure which ip its connected to by looking for xx.xx.xx.xx.:myporthere

But if 3 apps use that port how do i know which IP is which Window in my OS?

Share this post


Link to post
Share on other sites

What windows version do you have?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Xp but this program must work on the most Windows versions possible.

What i see with netstat -n is something like such

Connexions actives

  Proto  Adresse locale         Adresse distante       Etat
  TCP    64.18.165.20:1289      63.240.202.131:6112    TIME_WAIT
  TCP    64.18.165.20:1290      63.240.202.148:6112    TIME_WAIT
  TCP    64.18.165.20:1291      63.240.202.127:6112    ESTABLISHED
  TCP    64.18.165.20:1292      63.240.202.148:6112    TIME_WAIT
  TCP    64.18.165.20:1293      69.93.118.234:80       TIME_WAIT
  TCP    64.18.165.20:1294      63.240.202.169:4000    ESTABLISHED
  TCP    127.0.0.1:1045         127.0.0.1:1046         ESTABLISHED
  TCP    127.0.0.1:1046         127.0.0.1:1045         ESTABLISHED

That is with a French version but english would just be a lil different.

Edited by publicenemy

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

runwait('cmd /c netstat -an | find ":4000" >c:\tempstat.txt ','',@sw_hide)

then filter out the last octet of ip (169)

btw. such programs already exist :D

Edited by Netspider

Share this post


Link to post
Share on other sites

do a netstat before and after the "Window"


[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Share this post


Link to post
Share on other sites

Your right i could make a string compare before and after windows. I might do this.

Thanks alot guys.

Btw what programs are u talking about Netspider?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

This program looks nice and with "Process Created on" I will probably be able to figure what I want to know. Thank you very much!!!!

Edited by publicenemy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0