DEV Community

Cover image for Explore, Scan, Secure: Nmap for Network Ninjas
KARAN JAIN
KARAN JAIN

Posted on

2 1 1 1 1

Explore, Scan, Secure: Nmap for Network Ninjas

Disclaimer:
This post is for educational purposes only. Unauthorized scanning or hacking of websites or networks is illegal and can lead to severe consequences. Always ensure you have proper permission before performing any scans or security tests.

"Want to Hack a Website? Here’s Where It All Begins!"

The first step is finding all the open ports on the website. These ports act as entry points, and discovering them is crucial.

To do this, we use a powerful tool called Nmap. It scans and reveals all the open ports, giving you a map of what’s accessible.

Image description

Nmap, which stands for Network Mapper, is a free tool that helps you explore networks and check for security issues. It's really helpful for system admins and those interested in cybersecurity.
Common Uses:
Scanning networks, Detecting open ports, Identifying running services, Checking for vulnerabilities

Step.1: Installing Nmap
For Linux:
Most Linux distributions include Nmap in their repositories. Install it using:

sudo apt install nmap 
Enter fullscreen mode Exit fullscreen mode

For Windows:

Nmap official website

Step.2:Give commands:
0.For summary of options

nmap -h
Enter fullscreen mode Exit fullscreen mode

1.Scan a Single Host

nmap 192.168.1.1

nmap www.google.com

Enter fullscreen mode Exit fullscreen mode

2.Scan All Ports

nmap -p- 192.168.1.1

Enter fullscreen mode Exit fullscreen mode

3.Scanning Your Local Network

nmap -sn 192.168.1.0/24

Enter fullscreen mode Exit fullscreen mode
  1. For Aggressive scanning
nmap -A www.google.com
Enter fullscreen mode Exit fullscreen mode

5.To scan UDP ports

nmap -sU www.google.com
Enter fullscreen mode Exit fullscreen mode

6.To scan TCP ports

nmap -sT www.google.com
Enter fullscreen mode Exit fullscreen mode

7.To scan top ports

nmap --top-ports <number> www.google.com
Enter fullscreen mode Exit fullscreen mode

8.Scan Excluding the range of port

nmap --exclude-ports 1-100 www.google.com
Enter fullscreen mode Exit fullscreen mode

9.To increase the scanning speed

nmap -F www.google.com
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay