Jump to content

Remote IP Address


Recommended Posts

Hello. How would i go about getting the remote IP address for a computer? Thanks in advance.

Spyro.. Honestly, you have been here a long time. You should know how to go about posting questions by now.

Give MORE information. Do you have a hostname of the remote computer and just need to resolve its IP? Do you just want the external IP of the computer the script is running on? Or is it some other circumstance?

There is no such thing as too much information.

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Hello. How would i go about getting the remote IP address for a computer? Thanks in advance.

I use a script that runs ipconfig on the remote computer and then parses out the ip addresses (and mac id's). However, if the network card is disabled, it will not get the ip address. I use PSEXEC from Sysinternals to run my script on the remote machine. You can pass the output of ipconfig to the clipboard using the WindowsXP utility "clip.exe" which comes with the resource disk. Of course, as Simucal says, this may have nothing to do with what you really want...
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

I am soo sorry. I was in a hurry. I just need to get the external IP of the computer that the script is running on.

Just use ipconfig locally and parse the ip address the same way.
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

What ever. I just figured it out on my own. wrote my own function...

func getremoteip()
;       Function By Brad Reddicopp
InetGet ( "http://www.whatismyip.com/" ,"C:\temp.dat" , 1)
$html = fileread("C:\temp.dat")
$html = StringAddCR ($html)
filedelete("C:\temp.dat")
filewrite("C:\temp.dat", $html)
$line = FileReadLine ( "C:\temp.dat", 31)
$ip = StringTrimLeft ( $line, 15)
$ip = StringTrimRight ( $ip, 5)
filedelete("C:\temp.dat")
return $ip
endfunc
Link to comment
Share on other sites

Um, i need the script to do that.

That's what I meant. Run ipconfig through your autoit script on whatever machine you want. When you get the output, sort through it for the ip addresses that you get back.

If it's the external ip address of your router then you may have to use whatismyip.com. Do you know who owns that site? Just wondering if it's legit?

This site is even cleaner: http://www.whatismyip.org/

Try this:

#include <inet.au3>
$xip = _InetGetSource("http://whatismyip.org/")
MsgBox(1,$xip,$xip)
Edited by jefhal
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Yes, it is cleaner. What ever... I just finnished. Plus, i dont want too many includes, so im fine here.

And yes, that website is legit. why would it not be?

Edited by spyrorocks
Link to comment
Share on other sites

why not just use @IPAddress2

He's actually looking for the "outside" address of his network. The one that an outsider would attempt to connect to. @IPAddress2 is, I believe, the ip address of the second network adapter that is on the local machine. In the case of a machine that is a proxy server, that would also be the "outside" address, but in a NAT network, that would just be another internal NAT ip address.
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

It does not explicitly say so in the help file but _GetIp() returns the public (Internett) address of my network. That is the address after the third firewall in my case. I'm only using the beta (126).

Link to comment
Share on other sites

It does not explicitly say so in the help file but _GetIp() returns the public (Internett) address of my network. That is the address after the third firewall in my case. I'm only using the beta (126).

You are correct sir! inet.au3 uses an external website as well to retrieve the outside ip address of your network. I guess the fundamental question is: which external website do I not only trust, but do I expect to be around longer than my code is in use?
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

I know, have hacked it at least once to use my ISP's server :D

If you have access to your outermost firewall you could use information from it. At least a reasonably new one has a web interface (goes for *DSL modems to).

Edited by Uten
Link to comment
Share on other sites

I think GRC would be the best - IMHO. Besides there is a lot of other great things from this site.

https://www.grc.com/x/ne.dll?bh0bkyd2

Look at the bottom of the page.

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...