Exploring Artificial Intelligence and VPN Technologies
If artificial intelligence and private VPN technologies are not your thing, feel free to click away. But if they are, join me today on a nerdy adventure. Recently, I purchased a subscription to ChatGPT and got re-energized to fully understand as much as I can about artificial intelligence and how it can help me solve additional problems beyond just saving time with content creation.
As you know, this channel is all about solving problems that expats face while living abroad, whether those are technical problems, cultural problems, logistical problems, or otherwise. So today, we’re diving into the fascinating world of artificial intelligence and VPNs.
Remember when I talked about VPN services and the IP addresses of known VPN servers in the previous video about the ultimate VPN router solution? In that video, I briefly demonstrated two websites that have this information programmed into their code. Well, these two projects got me thinking: how in the heck did they code this into their websites? And could an IT security professional use ChatGPT to easily identify if a user is using a VPN server’s IP address?
Today, I want to explore ChatGPT and whether or not I can recreate the VPN detection function of those two websites on my own. But before we start, here’s a little bit about me that you may not know. I’ve been a network engineer and cybersecurity nerd for well over 20 years, and yes, I remember when the internet first went mainstream back in like 1994. I can remember asking my co-workers at a computer store that I worked at if they had heard about this thing called the World Wide Web. Shout out to Dave and James.
Well, AI systems like ChatGPT are about to become a part of our daily lives, just like searching on YouTube is today. And I am super excited. So what better time to start to understand how to use AI technology than now?
I should note that I am not, at least not yet, a software developer. So writing websites in JavaScript or sorting things in Perl are not skills that I possess. And I am certain that there are probably folks watching this video who are much farther along the AI path than I am. But my lack of knowledge in this area is what makes this video interesting. I am approaching this problem as a complete novice to modern programming and website creation. Therefore, if I can do it in a matter of hours with the help of AI, so can you.
The goal for this video is to create a web page that will take the input of an IP address (think of the IP address as your home mailing address of your computer) and determine whether or not it’s in a list of known public VPN services’ IP networks.
The f
irst thing we need to do is find a list of known IP addresses for public VPN servers. So, I started with a quick Google search to locate the list. When I located the file on GitHub, I discovered that the file is listed by IP network blocks. This is super helpful, but when you receive an IP address from a public VPN service provider, that IP address will be of an endpoint server and not the network. For instance, the IP address might be something like 192.168.1.1, but the network might be 192.168.0.0 with the subnet mask of 16.
So, for the second step, we need to identify all the IP addresses in the available network so we can compare the endpoint IP address to the networks provided in the file and see if there's a match.
Now, this is where ChatGPT comes in. What I love about AI is that it's like talking to a friend who knows how to code. I asked ChatGPT a question, and within minutes, I had code to work with. Sure, I needed some time to adjust it, but the hard part was done.
This conversation starts with a thing called a prompt. One trick of creating a good prompt is telling the AI to assume the role of a certain persona and give it as much detail as possible. The original prompt that I provided for this program was to play the role of a software developer who works for an IT security firm. You want to create a web page to identify the IP address of known VPN servers. You have a file that lists all the known networks of VPN servers, but you need to compare a single IP address to each network to determine if that IP address is a part of one of those networks. What is the best way to compare the file with networks to a single IP address?
You can see the results from this prompt on the screen. Now, this is where things got really interesting. Not only did ChatGPT understand my request, but it also provided a very usable version of the code that only needed slight tweaking. This all happened in a matter of seconds. Now, to be fair, it did take me several hours to tweak the code with additional prompts to get a good working version. But the beauty of this was once I had the framework, it was easy to request additional changes.
I will also note that it is very important to test between versions, and some of the new changes I requested broke the basic functionality of the main program. So, to avoid these issues, I started a note document to save the code that I accomplished each of the steps along the way.
Also, this is the second time that I've created this project. In the first attempt of this project, the code would take up to 90 seconds to compare the IP addresses. The problem with my previous version of the project was that I was reading from four huge files that I created of 500 megabits each that contain the actual IP addresses of the known networks. In the new version of the project, I started with only using AI and asking it to write the code in JavaScript and provide guidance on the best way to accomplish the task.
All of that to say, the moral of the story is to start with a good prompt, and the results will be drastically different. What I also found surprising is how much I learned about manipulating the Wix platform from uploading files, referencing those files, etc., with this project. Again, I am not a web developer, but with AI, I was given exact details on what to do to get this code working on the website.
In the past, if I wanted to learn how to do everything that I've done so far in this video, I would have had to go to Google and do a search or go to YouTube and watch videos to learn. But AI can guide us step by step, providing insights along the way that we didn't even know to ask. It's a whole new way of learning.
That's the difference of artificial intelligence.
At this point, let's take a look at the little program that we created in action. The first thing it does is gather the IP address of the user that is connected to the page. I'm using a VPN, as you can see in the upper corner, so I'm going to switch that IP address to several different servers. You can then enter that IP address or use another if you want to see if it's a known VPN server. All of this happens very quickly in this new version of code that uses JavaScript to create the array.
My final thoughts on this version of the code is it's not perfect. It's a simple proof of concept, but it shows how easily a public VPN server can be detected with AI. Did you enjoy this video and want to know more about how AI can help you solve expat problems? Leave me a comment below. Or if you have questions about how to remote work without using a public VPN service, hit the link in the channel profile.
Until next time, make some plans, Monty.