Nmap scan
Youtube
If you missed the first part of setting up the virtual machines and ping, do this part first before attempting to scan the devices on the network.
https://toukeevang.blogspot.com/2023/10/3-vm-ping-connection-in-this-project-we.html
We first going to start with an ARP scan to get the device's IP address.
On your Kali virtual machine, open the terminal and type the following command.
> nmap -PR -sn 10.0.2.0/24
nmap = is the tool we are using followed by some options within the tool.
-PR = P is for ping, R is for randomize
-sn = ping scan no port
x.x.x.x = your target IP address
This next scan is to test websites and get the known IP address for the website. For this scan, you need to use the escalated privilege “ sudo “.
> sudo nmap -PE -sn scanme.nmap.org
sudo = escalated privilege
nmap = tool use
-PE = sends ICMP packet only to get responses back
-sn = ping scan no ports
Scanme.nmap.org = target
We are going to copy the IP addresses of the virtual machines and save them to a document or text file. Once you have saved the IP in the text document we can continue. This way you will not have to type the IP address on each command but to input the text.
In the terminal type:
> vim iplist2.txt
> i = to insert text
Copy and paste the 3 IP addresses into the text.
> : = options to save
> wq = write and quit text document
You already have the IP address of the 3 machines. It’s time to run a scan and look for any open ports.
> nmap -iL iplist2.txt
nmap = tool
-iL = insert a text document
Run this command to scan the specific IP in the list and look for any open ports.
You can also specify which ports you want to scan by using
“ -p { port number } “ and -iL to insert list. The image below specifies ports 80, 21, and 23.
To check the version of the operating system use “ -O “
Sometimes you may want to perform a slower scan to not get detected, use
“ -T { 1-5 } “ 3 is default,1 is slow, 5 is fast.
Nmap also allows you to use a decoy IP address when scanning. Use
-D RND:{ how many IP }
This will only show up if you have logs or wireshark open when running.
Nmap allows a randomized order of scanning ports.
> nmap -iL iplist.txt –randomize-hosts
Nmap also allows spoofing of your MAC address using the
“- - spoof-mac 0”
As you can see nmap sent a different MAC vs your MAC id using ip a
Nmap also has scripts that you can run to test different vulnerabilities your virtual machine may have. The location on Kali: /usr/share/nmap/scripts
To run scripts check the image below.
This completes the basics of Nmap scans. Hopefully, you have tested and learned something from these basic Nmap techniques.
Reference:
https://nmap.org/book/toc.html
https://nmap.org/nsedoc/scripts/
https://www.youtube.com/watch?v=wlqUO09J-nw
Comments
Post a Comment