Nmap is legal to download and learn. Pointing it at networks you don't own is a different story.
Why permission comes first
A port scan is the first step of almost every attack, so defenders treat it seriously. Scanning a company, college or website without permission can get your IP blocked, get you reported, and in India it can fall under the IT Act 2000 (Sections 43 and 66) if it leads to unauthorised access or damage.
Rule: only scan what you own, or what you have written permission to test.
Safe places to practise
| Target | Why it's safe |
|---|---|
| Your own home lab | Your machines, your rules. See the Home Lab path. |
| Metasploitable 2 | A deliberately vulnerable VM made for practice. |
| scanme.nmap.org | Run by the Nmap project so learners can test scans. |
| TryHackMe / Hack The Box | Legal targets inside their own networks. |
Respect scanme.nmap.org
The Nmap team lets you scan scanme.nmap.org, but only lightly: a few scans a day, no brute-forcing, no attacking its services.
nmap scanme.nmap.org
If you're not sure you're allowed to scan something, you're not allowed.