CodeFaster

CodeFaster

Share this post

CodeFaster
CodeFaster
nmap as a networking sanity check

nmap as a networking sanity check

Tyler Adams's avatar
Tyler Adams
Jul 21, 2023
∙ Paid
2

Share this post

CodeFaster
CodeFaster
nmap as a networking sanity check
Share

Recently, someone sent me a db connection string, but I couldn’t connect. How do you debug this?

nmap

Thanks for reading CodeFaster! Subscribe for free to receive new posts and support my work.

nmap -p 5432 generic.postgres.database.azure.com -Pn

-p 5432 means port 5432 which is the standard postgres port

-Pn is what you do when a host doesn’t respond to ping

and the output

Starting Nmap 7.80 ( https://nmap.org ) at 2023-07-19 23:16 EDT
Nmap scan report for generic.postgres.database.azure.com (X.X.X.X)
Host is up.

PORT     STATE    SERVICE
5432/tcp filtered postgresql

Nmap done: 1 IP address (1 host up) scanned in 2.06 seconds

filtered is not open, which means, you’re probably getting firewalled.

For fun, compare that to checking I run a psql db on localhost:

$ nmap localhost -p 5432
Starting Nmap 7.80 ( https://nmap.org ) at 2023-07-19 23:16 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000075s latency).

PORT     STATE SERVICE
5432/tcp open  postgresql

Nmap done: 1 IP addre…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Tyler Adams
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share