Scan and Query Networks Fast with Nmap and Pgcli

Nmap is the fastest way to see what’s alive, open, and talking on any network. It scans hosts, detects services, and gives you live data to plan your next move. Run it against a single machine or thousands. Adjust the scan flags to tune speed and depth. Use nmap -sV to get service versions. Add -p to lock onto specific ports. Save output in all formats with -oA to feed into scripts or dashboards.

Pgcli is the sharpest tool for working with PostgreSQL from the command line. It has syntax highlighting, auto-completion, and structured output without extra setup. Log in with pgcli -h host -U user -d db and move fast. Use tab-complete to find tables and columns. Paginate results, format them as tables or CSV, and run meta-commands to explore schema without slowing down.

Combined, Nmap and Pgcli let you scan a network for database instances, then connect and verify them in seconds. Find open PostgreSQL ports with Nmap using nmap -p 5432 --open target-range. Pipe the host list into Pgcli and run targeted queries to check availability, roles, or data state. This workflow reduces blind spots and improves response time in audits, migrations, and incident response.

Make them part of your toolkit. Automate the scan-to-query loop. Monitor changes. Keep your map fresh and your data live.

See how this looks in action with live automation at hoop.dev and have it running in minutes.