Key Nmap Commands and Basic Concepts
Confidence Daniel
Junior Testing Engineer @ Monty Mobile | Red Team Engineer @ Virtually Testing Foundation | Building Secure Systems & Bridging the Gap Between Tech & English | VA/PT, Communication & Collaboration @ CyberGirl 3.0
This week I learned the use of Nmap, Hydra, Nessus, and Metasploit. I hope to write about each of these.
Shortly, I will be sharing a few key commands in Nmap.?
Let me stop here. Don't hesitate to add your own in the comment section.?
Nmap short for Network Mapper is a vital scanning tool for pentesters. Just from the syntax, you could guess almost immediately what the commands will do. My week's learning on Tryhackme includes:
Nmap Live Host Discovery
Nmap Basic Port Scans
Nmap Advanced Port Scans
Nmap Post Port Scans
Just the way you can't just carry your hooks to just any stream and start fishing, you can't just start scanning for ports on the network.
First, check which system is up and which is down. This will prevent you from wasting your time.?Then, go further to check the services running on the system. By services here I mean if we could log in to the target system using SSH, transfer files using FTP, be connected via telnet, or even browse on the target's web by connecting to HTTP. Now I know what it means when I hear 'ports'.?
Take for instance, we have a big house (system) with doors (FTP) and windows (HTTP) and ceilings (SSH) and floors (telnet) and fences (firewalls) and there are fierce masquerades outside. Ideally, everywhere should be locked. The features of our house are the various 'ports'. The masquerades are the hackers and threat actors out there. Imagine you forgot to lock one of the windows. That simply means the port is up!??
This is what port scanning does. Checking whether the house is locked or not. Which side is open? Is the key to the house a good one? (Was a strong password used?). But in this case, it is referred to as discovering live hosts.
There are different methods to scan for these ports.
ARP scan
ICMP scan
TCP/UDP scan
领英推荐
ARP refers to Address Resolution Protocol. Each system in a network has two id numbers: IP/Logical address and MAC/Hardware address. Imagine you have two names. One is a nickname (IP address) and the other is your baptismal /birth name (MAC address).
You like using your nickname everywhere but once you want to collect a special gift, to avoid any missed-up, you asked that it should be directed to you in particular using your birthname. This is simply what IP address and MAC address do.?In a network, once there is a packet to the IP address of a particular system, the system responds quickly with its MAC address to claim the packet.?
But what if a kidnapper pretends to have a gift for you and he calls you by your nickname and you, innocently and quickly, shout out your original name so that the rest friends won't drag the gift from you??
This is part of what ARP Scan does.?
As a penetration tester, you can use Nmap to carry out an ARP scan to detect all those hidden IP addresses on your network.?
ICMP scan: ICMP refers to Internet Control Message Protocol. This is a method of checking if the systems in the network can communicate and also check how fast they can communicate.?Scanning with this protocol means depending on the ping request and reply to detect live hosts. If you ping a system in a network using an echo request, if the network replies, it means the host is up
Echo request in this sense is the same as calling someone's name to know if they are dead, asleep, alive, or irresponsive. If the host is up, it replies with an echo reply. However, these request and reply methods are sometimes blocked by firewalls.
Another type of Nmap scan is the TCP/UDP scan
The TCP scan is also seen as the SYN scan. A pentester using Nmap can establish a connection to a target system by conducting a three-way handshake.?You can have an idea of the three-way handshake by reading my previous article
Note that your scanning can be loud and easily detected based on the timing. Hence, you can make the scanning go slow by scanning stealthily or go very aggressive and intrusive by using the 'insane' timing. The timing goes from 0 - 5
paranoid 0
sneaky 1
polite 2
normal 3
aggressive 4
insane 5
Here is a pinch of what I have been up to.
Lots of thanks to Confidence Staveley and Dr. Victor Monga for these privileges and for giving me the space to become wiser.
IT Security and Networks student
1 年Thank you Confidence Daniel