DEV Community

Saarathi Academy for Saarathi Academy

Posted on Edited on Originally published at linkedin.com

Nmap explained, before your ethical hacking course in Nepal

Nmap is a free program that asks a computer which network doors are open, and which software answers behind each one. Learn it before any other hacking tool, alone or in an ethical hacking course in Nepal, because you cannot test a system until you know what it exposes.

You can install it tonight on an old Windows laptop and run your first legal scan in 30 minutes. This article shows how, and how to read what comes back.

What is Nmap, in plain words?

Every computer on a network has numbered doors called ports. A website usually answers on port 80 or 443. Remote login for admins usually answers on port 22.

Nmap knocks on these doors and writes down what happens. Some doors answer, some stay silent, and some are blocked by a firewall. Nmap can also ask the software behind an open door for its name and version.

Pay the most attention to that version. An old web server or login service is often where a real test begins.

Where does Nmap fit in an ethical hacking course in Nepal?

Ethical hacking follows an order. First you collect public information about the target. Then you scan it to list what it exposes. Only then do you test each thing you found, and write a report.

Nmap is the scanning step. Everything after it depends on that list. If you skip a port, you never test the service behind it. So Nmap comes before the other ethical hacking tools.

We put it early in our course for the same reason. At Saarathi Academy in Old Baneshwor, Kathmandu, Week 1 of the cybersecurity course covers how the internet works, and what ports and protocols are. Week 3 is Nmap: scan types, service detection and safe defaults. In the same week you check Nmap's results against the raw traffic in Wireshark, and wrap your scan in a small Bash script that saves a list of services.

Week 9 then returns to the services you listed in Week 3, and tests them. A weak scan in Week 3 means less to test in Week 9.

Is it legal to use Nmap in Nepal?

Testing a computer without permission can be a crime in Nepal. Section 45 of the Electronic Transactions Act 2063 covers unauthorised access to a computer, with up to three years in prison. Nmap's own guide says there is no simple answer to whether port scanning is legal. So treat any scan without permission as a real risk.

Only scan your own laptop, scanme.nmap.org, or a free practice lab that gives you a target on purpose. The second one is a machine the Nmap project set up for practice.

Nmap's own page on legal issues gives permission to scan scanme.nmap.org with Nmap only. It does not allow attacks on it. It also asks you to keep to about a dozen scans a day. The same page says to get written permission before you scan any other network.

Do not scan your college network, your office Wi-Fi or a friend's website "just to see". If a teacher or course tells you to, ask for the written permission first.

How do you try Nmap in 30 minutes?

Download it from the official Nmap download page. On Windows, the installer includes Zenmap, a window where you type the target and see the result. It supports Windows 7 and newer, so a slow college laptop is fine. On Linux, it is usually one install command away.

Then run these, one at a time. Type them in the Command Prompt, or in the command box inside Zenmap.

First, scan your own laptop with nmap localhost. This is the safest first scan, and it shows which doors your own machine leaves open.

Next, run nmap -F scanme.nmap.org. The -F option is fast mode, so it checks fewer ports than a normal scan.

Then run nmap -sV -F scanme.nmap.org -oN scan1.txt. The -sV option asks each open port for its software name and version. The -oN option saves the result in a text file, so you can read it again later.

That is two of your dozen scans of scanme.nmap.org for the day. Stop there.

How do you read the result?

The main part of the result has three columns: the port, its state and the service name. Most beginners only look for the word "open". Read every state, because each one tells you something.

Nmap's guide to port states explains them. The three you will see most:

  • open: a program is listening and accepting connections on that port.
  • closed: the port can be reached, but no program is listening.
  • filtered: a firewall or filter blocks Nmap, so it cannot tell if the port is open.

A filtered port may still have a program behind it, so write it down in your notes, the same as an open port.

Now pick one open port from your scan. Write the service name and version next to it. Then search that version name with the word "documentation" and read what the software does. You have just done a small part of the enumeration step that real tests depend on.

Which Nmap habits should you skip?

It is tempting to run nmap -A with the fastest timing on every target. The -A option turns on system detection, version detection, scripts and a route trace, all at once. Nmap's own legal page advises default timing, and no heavy features unless you need them.

We agree, so learn to read a plain scan first.

Keep a note for every scan: the date, the target, the exact command and what you found. Real test reports are written from notes like these.

Your next step

Tonight, install Nmap, scan your own laptop, and run your three scans on scanme.nmap.org. Then read Nmap's port states page once more with your own result open next to it.

If you want to know what an ethical hacking course in Nepal should really cover, we wrote about that in why ethical hacking training in Nepal is growing. Nmap is one tool of many, and our overview of the cybersecurity training tools we teach at Saarathi Academy shows where the others fit.

The page for our ethical hacking classes in Kathmandu shows how the course runs, and the full week-by-week syllabus is public before you pay.

Common questions

Is Nmap free to use?

Yes, Nmap costs nothing, and you get it from the official Nmap download page. It runs on Windows 7 and newer and on Linux, so an old college laptop is enough.

What other cybersecurity tools for beginners come after Nmap?

Wireshark comes right next to Nmap, so you can see the raw traffic your scan sends. Web testing then uses Burp Suite, and the Metasploit framework only comes once you have proved a service is weak. Each tool depends on the list of services your Nmap scan gave you.

Does an ethical hacking course in Kathmandu teach Nmap early?

At Saarathi Academy in Old Baneshwor, Nmap is Week 3, after ports, protocols and network traffic in Weeks 1 and 2. Week 9 returns to the services you listed with Nmap and tests them. A good ethical hacking course in Nepal should put scanning before attacks in the same way.

Top comments (0)