Skip to main content

Nmap Scan

 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


  1. nmap = is the tool we are using followed by some options within the tool.

  2. -PR = P is for ping, R is for randomize 

  3. -sn = ping scan no port

  4. 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


  1. sudo = escalated privilege

  2. nmap = tool use

  3. -PE = sends ICMP packet only to get responses back

  4. -sn = ping scan no ports

  5. 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


  1. nmap = tool

  2. -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/

 

https://manage.accuwebhosting.com/knowledgebase/2609/How-to-Allow-Pingor-ICMP-Echo-Request-in-Windows-Firewall.html


http://scanme.nmap.org/


https://nmap.org/book/toc.html


https://nmap.org/nsedoc/scripts/


https://www.youtube.com/watch?v=wlqUO09J-nw 






Comments

Popular posts from this blog

Kali Installation

  Kali Installation Youtube In this blog, we are going how to install Kali on to virtual box. The first step is to go to the Kali website and download the ISO for installation.  https://www.kali.org/get-kali/#kali-virtual-machines Once you have downloaded the ISO, make sure you have a tool to unzip the compressed file. You down download 7-zip for free. https://www.7-zip.org/ Download the version for your operating system and install 7-zip. Once you have finished installing 7-zip you will be able to unzip the compressed file. Find the file you downloaded from Kali and right-click choose more option if you do not see 7-zip. You can choose where you would like your extracted file to be stored. In this case, I choose to extract the file in this location. Once you extract the compressed file you will see another file called kali-linux-XXX.Xvirtualbox-amd.ova Double-click on that file and it will import the Kali operating system into the virtual box.  Choose the RAM and CPU set...

Linux ls Command

  Linux ls Command Youtube Video: Linux ls command Description: ls lists the file that is in that directory along with file size, owner, and modification.  Syntax: ls [option] [file/location] Help / Manual: You can input “man” in front of the ls command to get help. You can also type “ ls –help “ to get the short version of the manual. Options: These are the options that you can use with the “ ls “ command to add additional features to your search. You can always check the reference below for more information on the “ ls “ command. Learning the basics of “ ls “ will get you started to list the files in that directory. References:  https://www.computerhope.com/unix/uls.htm https://www.linuxdoc.org/LDP/LG/issue48/fischer.html https://www.geeksforgeeks.org/ls-command-in-linux/