|
04-15-2020
| Junior Member | | Join Date: Apr 2020
Posts: 62
Thanks: 3
Thanked 10 Times in 10 Posts
Activity: 0% Longevity: 23% | | Software that automatically logs your external IP
All of the threads that I found about this topic are really old and I'm sure a lot has changed in ~7+ years.
Does anyone know of a utility that will automatically check your external IP randomly/at set intervals and log it for you?
I'm using MiFi devices but they're all with the same carrier in the same geographic area so there's a nonzero chance of an IP getting recycled to one of my other MiFi devices. Since I'm leaving them tethered 24/7, ideally there would be a way to maintain a log of any changes automatically.
Thanks!
|
The complete step-by-step guide to get back to selling today!
| |
04-15-2020
| | Executive [VIP] | | Join Date: Jul 2018
Posts: 4,712
Thanks: 957
Thanked 829 Times in 724 Posts
Activity: 9% Longevity: 33% | | Re: Software that automatically logs your external IP
Depending on what ISP you use the IP pool may be small or large, some ISP in the US have a pretty small pool so you should always track the IPs anyway
Set your browser homepage to iplocation.net and copy/paste it into an excel every time you load the browser, wouldn't take long
|
04-15-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
The original IPBurger website logs your IP over time. On this page : https://www.ipburger.com/ip-lookup.php
I'll see if I can write a batch file that would do what you need.
EDIT: It's doable with a VBS file. I'm out of time today but I'll see if I can come up with anything later. IMO there's no need for dedicated software to do something so simple.
If anyone is up for a challenge, this is how this task could be performed with a simple vbscript file:
1) open webbrowser and go to an IP checker website
2) select the element in the page that contains the IP (div id="ipv4" or whatever)
3) copy that element to clipboard
4) open notepad
5) paste clipboard contents to notepad
6) add time/date stamp to the next line under the pasted IP
7) save file as "iplog.txt" on desktop
8) have the script close web browser + notepad
Once you have the .vbs file, it's just a matter of using task scheduler to have it run at regular intervals.
I may be overthinking this, but it sounded like an interesting thing to try.
__________________ ____________ _______ ___
Last edited by phaz0rz; 04-15-2020 at 03:17 PM.
| The Following 2 Users Say Thank You to phaz0rz For This Useful Post: | |
04-16-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
Here's what I have so far. I'm not much of scripter so this was made from a hodge-podge of examples from the internet. I'm kind of running into a dead-end.
Open notepad, paste the following code into it, and then save the file as "test.vbs" on your desktop: Code: With CreateObject("InternetExplorer.Application")
.Visible = False
.Navigate "https://whatismyipaddress.com/"
Do Until .ReadyState = 4
Wscript.Sleep 100
Loop
For Each Tag In .Document.GetElementsByTagName("script")
Tag.OuterHtml = ""
Next
For Each Tag In .Document.GetElementsByTagName("noscript")
Tag.OuterHtml = ""
Next
Content = .Document.GetElementsByTagName("div")("ipv4").InnerText
Do While InStr(Content, vbCrLf & vbCrLf)
Content = Replace(Content, vbCrLf & vbCrLf, vbCrLf)
Loop
ShowInNotepad Content
.Quit
End With
Sub ShowInNotepad(Content)
With CreateObject("Scripting.FileSystemObject")
TempPath = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%TEMP%") & "\" & .GetTempName
With .CreateTextFile("iplog.txt", True, True)
.WriteLine (Content)
End With
CreateObject("wScript.Shell").Run "notepad.exe " & "iplog.txt", 1, True
set wShell = createObject("wscript.shell"):
End With
End Sub This script invisibly opens internet explorer, navigates to an IP checking site, pulls your IPv4 address from that page, and pastes it into a text document named "iplog.txt" on your desktop. The result from running this script should just be a text file with your IP address on the first line.
What I haven't worked out yet is : how to auto-save the text file, how to timestamp each entry in it, and how to have the script continually update the same text file. I don't know if I'll be going any further, lol.
__________________ ____________ _______ ___ | The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-16-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
I figured out the timestamp issue.
I also had to change it so that IE is visible - otherwise you'll get an instance of IE running in the background for each time you run this script. Code: With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "https://whatismyipaddress.com/"
Do Until .ReadyState = 4
Wscript.Sleep 100
Loop
For Each Tag In .Document.GetElementsByTagName("script")
Tag.OuterHtml = ""
Next
For Each Tag In .Document.GetElementsByTagName("noscript")
Tag.OuterHtml = ""
Next
Content = .Document.GetElementsByTagName("div")("ipv4").InnerText
Do While InStr(Content, vbCrLf & vbCrLf)
Content = Replace(Content, vbCrLf & vbCrLf, vbCrLf)
Loop
ShowInNotepad Content
.Quit
End With
Sub ShowInNotepad(Content)
b = now()
With CreateObject("Scripting.FileSystemObject")
With .CreateTextFile("iplog.txt", True, True)
.WriteLine (Content & vbCrLf & b)
End With
CreateObject("wScript.Shell").Run "notepad.exe " & "iplog.txt", 1, True
set wShell = createObject("wscript.shell"):
End With
End Sub Save this the same way as the last example, run it, and the results will be this :
Now all I need to do is work out how to have the script continually update and save the same file, and we'll have something that could actually be pretty useful for this forum.
__________________ ____________ _______ ___ | The Following 2 Users Say Thank You to phaz0rz For This Useful Post: | |
04-16-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
(thx tin)
Alright, I fixed it. Here's the final code:
(if you want to use it, copy/paste the whole thing into notepad, and save the script as "ipchecker.vbs") Code: With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "https://whatismyipaddress.com/"
Do Until .ReadyState = 4
Wscript.Sleep 100
Loop
For Each Tag In .Document.GetElementsByTagName("script")
Tag.OuterHtml = ""
Next
For Each Tag In .Document.GetElementsByTagName("noscript")
Tag.OuterHtml = ""
Next
Content = .Document.GetElementsByTagName("div")("ipv4").InnerText
Do While InStr(Content, vbCrLf & vbCrLf)
Content = Replace(Content, vbCrLf & vbCrLf, vbCrLf)
Loop
ShowInNotepad Content
.Quit
End With
Sub ShowInNotepad(Content)
b = now()
With CreateObject("Scripting.FileSystemObject")
With .OpenTextFile("iplog.txt", 8)
.WriteLine (Content & vbCrLf & b)
.WriteBlankLines (2)
End With
CreateObject("wScript.Shell").Run "notepad.exe " & "iplog.txt", 8, True
set wShell = createObject("wscript.shell"):
End With
End Sub This will :
- open an IE window and extract your public IP
- copy/paste your public IP into a text document on your desktop called "iplog.txt"
- continually update the same text file each time the script is run
Example:
If anyone chooses to try this, you'll have to manually X out of notepad after each logging, which will automatically close notepad + IE.
This can be set to run though Windows Task Scheduler, or you can just manually click the .vbs file any time you want to check/log your IP.
Next I'll work on having the data written to an excel file rather than a text file.
__________________ ____________ _______ ___ | The Following 2 Users Say Thank You to phaz0rz For This Useful Post: | |
04-16-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
I'm kinda proud, lol. I haven't done any scripting in a decade.
__________________ ____________ _______ ___ | The Following 2 Users Say Thank You to phaz0rz For This Useful Post: | |
04-17-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
I have the excel version ready.
note:
- this version will automatically open IE + Excel and will close both programs after the task is complete
- you'll probably need to create a file on your "My Documents" folder called "iplog.xlsx" on your own before running this. I don't think the script will create the file.
- you'll need to have excel installed to use this version
- the log will be stored in your "My Documents" folder unless you specify a different location within the script. I left it as the default to avoid using a full path which would include my computer username
Instructions:
- open notepad
- copy/paste the script
- save as "ipchecker.vbs"
- double click the file whenever you want to check and log your IP, or set the script to run automatically
Without further ado... Code: With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "https://whatismyipaddress.com/"
Do Until .ReadyState = 4
Wscript.Sleep 100
Loop
For Each Tag In .Document.GetElementsByTagName("script")
Tag.OuterHtml = ""
Next
For Each Tag In .Document.GetElementsByTagName("noscript")
Tag.OuterHtml = ""
Next
Content = .Document.GetElementsByTagName("div")("ipv4").InnerText
Do While InStr(Content, vbCrLf & vbCrLf)
Content = Replace(Content, vbCrLf & vbCrLf, vbCrLf)
Loop
ShowInExcel Content
.Quit
End With
Sub ShowInExcel(Content)
b = now()
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("iplog.xlsx")
objExcel.Application.Visible = True
row = 1
Do Until IsEmpty(objExcel.Cells(row, 1).Value)
row = row + 1
Loop
objExcel.Columns(1).ColumnWidth = 50
objExcel.Cells(row, 1).Value = (Content & vbCrLf & b)
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close SaveChanges=True
End Sub Example of resulting log file:
You guys think I should make this its own thread? I remember everybody was thrilled about James' excel template back in the day.
__________________ ____________ _______ ___ | The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-17-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
Here's an example of how to set either of these scripts to run automatically using Windows Task Scheduler:
The following settings will cause my IP to be logged into the log file once every 10 minutes, indefinitely.
If you're going to set one of these to run automatically, I recommend using the Excel version since I haven't yet worked out how to have the text-only version close the notepad + IE instances it uses. The Excel version closes everything out after logging so it can be run completely in the background.
__________________ ____________ _______ ___ | The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-17-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
I'm on a role.
I've made it into an executable!
I crafted exactly what the OP was looking for, because I'm low on stock and bored. And now they're gone. I'll make a download of this new thing soon.
__________________ ____________ _______ ___ | The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-17-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP IP Logger by phaz0rz, v.1.0.0.1
This executable package just runs the excel script I posted earlier, so the same rules apply.
Pretty neat little tool. I used task scheduler and set it to run in the background every 5 minutes, followed by a popup notification that says "IP logged" which has you click "OK" to close it. The popup every 5 minutes is getting annoying so I'm probably going to disable that. Besides that, this thing is doing what it's supposed to and my Excel file is having my IP logged to it every 5 minutes. My IP doesn't usually change but I'll probably leave this running in the background just to see if it ever does.
__________________ ____________ _______ ___
Last edited by phaz0rz; 04-17-2020 at 06:26 PM.
| The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-18-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
Come on.. somebody try it..
I'm the resident programmer now. Let me know if there are any other requests.
__________________ ____________ _______ ___ |
04-18-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
Yeah, I haven't yet worked out how to "create" the excel file if it doesn't yet exist. Should be an easy fix - I just haven't got to it yet.
If you manually create a file called "iplog.xlsx" in My Documents before running it, that should work.
__________________ ____________ _______ ___ | The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-21-2020
| Junior Member
Threadstarter  
| | Join Date: Apr 2020
Posts: 62
Thanks: 3
Thanked 10 Times in 10 Posts
Activity: 0% Longevity: 23% | | Re: Software that automatically logs your external IP Quote:
Originally Posted by phaz0rz Come on.. somebody try it..
I'm the resident programmer now. Let me know if there are any other requests. | You're the man!!! Thank you so much, this is exactly what I was looking for!
P.S. Didn't disappear... Just needed a few days off haha.
| The Following User Says Thank You to HolaAmigo For This Useful Post: | |
04-22-2020
| | Executive [VIP] | | Join Date: Nov 2015
Posts: 10,834
Thanks: 2,079
Thanked 4,025 Times in 3,012 Posts
Activity: 5% Longevity: 48% | | Re: Software that automatically logs your external IP
1) It doesn't yet run automatically, but it's very easy to go into Windows Task Scheduler and set it to run at whatever interval you want (post #10, this thread). I set it to run every 5 minutes over the weekend on my laptop and wound up with 400 entries before I told it to stop logging.
2) It won't be difficult to have the date logged into the next column over. I'll work on that next.
Having an option within the program itself to set it to run at user defined automatic intervals may be over my head, but I'll try. I need to work out how to have it check if the excel file exists already, and create it if it's not already there. That's tricky with my limited skill-set as I'll probably end up wiping out my existing log file before figuring out how to check first, but amend the old file if it's already there.
Thanks for the feedback guys. :D
__________________ ____________ _______ ___ | The Following User Says Thank You to phaz0rz For This Useful Post: | |
04-22-2020
| Junior Member
Threadstarter  
| | Join Date: Apr 2020
Posts: 62
Thanks: 3
Thanked 10 Times in 10 Posts
Activity: 0% Longevity: 23% | | Re: Software that automatically logs your external IP Quote:
Originally Posted by phaz0rz 1) It doesn't yet run automatically, but it's very easy to go into Windows Task Scheduler and set it to run at whatever interval you want (post #10, this thread). I set it to run every 5 minutes over the weekend on my laptop and wound up with 400 entries before I told it to stop logging.
2) It won't be difficult to have the date logged into the next column over. I'll work on that next.
Having an option within the program itself to set it to run at user defined automatic intervals may be over my head, but I'll try. I need to work out how to have it check if the excel file exists already, and create it if it's not already there. That's tricky with my limited skill-set as I'll probably end up wiping out my existing log file before figuring out how to check first, but amend the old file if it's already there.
Thanks for the feedback guys. :D | The main thing I would add (if possible) is the use of a Google Sheet instead of excel.. That way there can be separate spreadsheets for each computer in the same "book" with some basic formulas checking for any duplicates across sheets.
The point would be to highlight if an IP has been reassigned to another computer.
| The Following User Says Thank You to HolaAmigo For This Useful Post: | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |