A keyboard-driven TUI application for Windows to inspect and kill processes bound to specific TCP/UDP ports.
- Port Lookup: View all active listening ports with process information
- Process Kill: Kill processes with confirmation dialog
- Safety Layer: Protects critical system processes (System, lsass, wininit, etc.)
- Real-time Search: Filter by port or process name instantly
- Pagination: Navigate through large lists easily
- CLI Mode: Use from command line for scripting
- Admin Detection: Warns when not running with administrator privileges
Download the latest release from GitHub Releases
git clone https://github.com/DFanso/PortExec.git
cd PortExec
go build -o portexec.exe ./cmd/main.go- Create a folder for your executables (e.g.,
C:\Bin) - Move
portexec.exeto that folder - Add to PATH:
- Press
Win + R, typesysdm.cpl, press Enter - Go to Advanced > Environment Variables
- Under User variables, find Path and click Edit
- Click New and add
C:\Bin - Click OK on all dialogs
- Press
- Open a new terminal and run
portexec
- Download the release and extract to a folder (e.g.,
C:\Program Files\PortExec) - Right-click the
.exefile > Create shortcut - Right-click the shortcut > Properties
- In the Shortcut tab, click Advanced
- Check Run as administrator
- Move the shortcut to your Desktop or Start Menu
winget install --id DFanso.PortExec --source wingetPortExec requires administrator privileges to kill protected system processes.
- Right-click on
portexec.exe - Select Run as administrator
Start-Process -FilePath "portexec.exe" -Verb RunAs- Click the dropdown arrow in the terminal tab
- Select Run as administrator
Run portexec check to verify admin status:
- If admin: Shows "Running with administrator privileges"
- If not admin: Shows "NOT running with administrator privileges" and some processes cannot be killed
portexec# List all listening ports
portexec list
# List specific port
portexec list 3000
# Kill process on port
portexec kill 8080
# Check admin privileges
portexec check| Key | Action |
|---|---|
| ↑/↓ or j/k | Navigate list |
| PgUp/PgDn | Change page |
| Enter | View process details |
| k | Kill selected process |
| r | Refresh port list |
| / | Search/filter mode |
| h | Show help |
| q | Quit |
- Windows 10+
- Go 1.22+ (for building from source)
- Administrator privileges for killing protected processes
- Bubble Tea - TUI framework
- Lipgloss - Styling
- gopsutil - Process/Network info
- Cobra - CLI
MIT License - see LICENSE for details.