Using AI to Build Tools
My primary scripting language is PowerShell. While I’m comfortable writing scripts from scratch, it can be time-consuming to take an idea all the way to a production-ready tool. Recently, I came across Warp IDE an AI powered editor and decided to give it a try to see how far I could push it, and how complex I could make a single tool that automates many of the tasks I typically perform manually at the command line.
I started with a simple prompt: “Build a PowerShell script with a GUI interface and combine each of these scripts into one.” The scripts I referenced already had GUI components, and I began with tools like LLDP Discovery, Port Finder, and Packet Capture. Warp did a solid job combining them, and when I launched the script, some parts worked as expected while others needed debugging. Using Warp, I was able to troubleshoot and refine the script until it was functioning well.
Encouraged by the results, I kept going. I added a local ARP table lookup and enhanced the Port Finder to run netstat -ano
, displaying active ports along with the associated executables. Warp generated a nearly complete script, and with a bit more debugging, it was production-ready.
I wanted to push the boundaries further, so I asked Warp to add a Passwords tab with fields for Server Admin and Domain Admin credentials, plus the ability to add or remove additional passwords. I also requested a tab to edit the HOSTS file using a DataGridView, with support for adding entries and saving in UTF-8 format. Another tab was added to manage the ARP table, allowing deletion of entries or clearing it entirely. Finally, I included functionality to export results to CSV for later review.
The final script does all of the above and includes a prompt to restart with administrative privileges, since many of the tasks require elevated access. Altogether, this took me about six hours to build. If I had done it manually, it would have easily taken a week or more.
The attached script does all of the above and since many of the things I will use it for require administrative command line privileges it prompts and restarts in that mode.
The script is a GUI, was built entirely in PowerShell and has the following functions.
- Passwords – This can be used to copy the store password in the tool and then copy it to your clipboard when you need to use it.
- Host File – Simple Editor so you don’t have to do it from elevating notepad and manually editing the file. You can add or remove lines as needed.
- ARP Table – See the ARP Table on the machine you are running the tool on, you can clear the whole table or just an individual entry.
- Packet Capture – Create PCAP files and a TXT file based to use in tooling, if you have WireShark or Notepad installed on your machine you can look at the logs without having to leave the tool. It will launch the tool and open the file.
- LLDP Discovery – This is used with LLDP enabled network gear to see what Ethernet port your machine is plugged into and basic switch information.
- Port Finder – Lookup all the open ports on your machine and what services started them.
- Port Scan – Scan an IP or machine for Open Ports
- Ping Scan – Scan a single IP or better yet a range of IP’s to see what is responding.
When launched it will ask if you want to reopen in an Administrative PowerShell Console, choose yes. If you are already using an elevated PowerShell Console it will just open without prompting.
It will create the export folders at launch if they don’t exist, these are used for default export locations to keep the C:\NetworkTools folder clean and give you a central location for all exports. If you don’t like the folder structure, you can always edit the script and choose your own. Having a single tool that can get me the information I need quickly is nice, it being PowerShell makes it so I can easily add more functionality as I need to. If you are looking for Swiss Army Knife for pulling data you might give this a try. Read through the code before you run it and feel free to use it as a baseline for other scripts.
Requirements:
- Powershell 5.1 or better
- WireShark Installed on the machine you are running it on. It will still do the .etl file generation and .pcap and .txt file conversion but the WireShark button won’t work.
- Windows with pktmon installed, it is by default but I created this on Windows 11 and haven’t tested on older operating systems.
- Local Admin privileges with the account running the tool.
- The ability to create folders on your C:\ root drive. I could have made this more in a user context and may later but it makes getting to the files easier this way and for my needs it worked perfectly.
- Once you run the script once you can copy it to C:\NetworkTools to keep everything contained as in the example below. At launch it will create the directory structure, or you can manually create a C:\NetworkTools folder and move the script in there before you launch. The script is self-contained and all tabs and code are in a single file.
- The link to the script is at the bottom of the page.
Screen Shots









Leave a Reply