Exploring Your Network with Virtual Machines and Nmap


If you're curious about how networks work—or more importantly, how to keep them secure—learning to use tools like Nmap inside a virtual machine is a great place to start. Whether you're just getting into cybersecurity or already working in tech, this combo gives you a safe and powerful way to explore and analyze networks without risking any real systems.
What’s a Virtual Machine, Anyway?
A virtual machine (VM) is like a computer inside your computer. It runs just like a real system, but it’s isolated—so if something breaks, it doesn’t affect your actual device. This makes it perfect for testing tools, running security scans, or experimenting without consequences.
Popular tools like VirtualBox and VMware let you create these virtual environments easily. You can run operating systems like Kali Linux, which is loaded with cybersecurity tools, all within your main machine.
What Is Nmap and Why Use It?
Nmap (short for Network Mapper) is a free tool that lets you scan and explore networks. Think of it like sonar for your network—it “pings” devices, checks which ports are open, and even tries to figure out what services or operating systems are running on them.
Here’s what Nmap helps you do:
See what devices are connected to your network.
Find open ports (which might be doors for attackers).
Detect outdated or vulnerable software running on devices.
How to Get Started
Step 1: Set Up Your Virtual Machine
Download a tool like VirtualBox and install Kali Linux (or any Linux distro you like). Give the VM network access—either through a bridged connection or a host-only adapter—so it can scan your local network.
Step 2: Install or Launch Nmap
Kali Linux already comes with Nmap installed. If you're using a different OS, just run:
sudo apt install nmap
To check that it works, run:
nmap -v
Step 3: Scan the Network for Live Devices
Start simple by checking which devices are online in your network:
nmap -sP 192.168.1.0/24
This will return a list of active devices—maybe your router, phone, printer, or other computers.
Step 4: Look for Open Ports and Services
Pick an IP address and run:
nmap -sV 192.168.1.10
This will show what services (like web servers, SSH, etc.) are running on that device and what versions they are.
Step 5: Check the Operating System
If you're curious about what OS the device is using:
nmap -O 192.168.1.10
Nmap will make an educated guess based on how the device responds.
Step 6: Go Deeper
If you want to go all-in and get as much info as possible, try:
nmap -A 192.168.1.10
But be careful—this kind of aggressive scan might alert network security systems or slow things down.
Why Use a VM for This?
Safety: You can scan and experiment without affecting your real system.
Reset Button: Snapshots let you go back if something breaks.
Flexibility: Try different tools or OSes without needing more hardware.
Real-World Practice: It’s a great way to learn cybersecurity hands-on.
Good to Know
Always get permission before scanning a network you don’t own. Unauthorized scanning can get you into legal trouble.
Keep your VM updated to stay secure.
Combine tools—Nmap is powerful, but pairing it with something like Wireshark can show you even more.
Using virtual machines and Nmap together is like giving yourself a lab to explore the hidden parts of a network. That’s it for now. Till next time folks happy coding.
Subscribe to my newsletter
Read articles from kelvin beno directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

kelvin beno
kelvin beno
I am a developer from Kenya, passionate about Building software that can shape and change lives for the better