Finding rogue devices in your network using Nmap (2024)

Posted: December 1, 2020 | | by Michael Zamot (Red Hat)

Image

Finding rogue devices in your network using Nmap (1)

Nmap is a popular open-source network discovery tool used to discover and audit devices on a computer network. It can rapidly scan single hosts up to large computer networks, providing useful information about each host and its software.

Intruders in the network… Wait, what?

Every day, IoT products like smartwatches, fitness trackers, printers, smart cameras, and more are becoming part of our daily lives. Many of these devices are synchronized with our personal or work smartphones. Willfully or not, these devices may be connecting to your corporate network. At least half of the organizations have experienced this just in the last year, according to Infoblox.

But what is the risk? Most IoT devices don't have built-in security and, in many cases, lack firmware and security upgrades. This lack of security is a gold mine for cybercriminals attempting to breach your network security. However, thanks to Nmap discovery and auditing features, you can quickly discover and identify rogue hosts or devices on your network and the software running in it. Let's explore some scenarios.

[ Readers also liked:Running a quick NMAP scan to inventory my network ]

General network discovery

Just knowing what ports are open is not enough, as many times, these services may be listening on non-standard ports. You will also want to know what software and version are behind the port from a security perspective. Thanks to Nmap's Service and Version Detection capabilities, it is possible to perform a complete network inventory and host and device discovery, checking every single port per device or host and determining what software is behind each.

Nmap connects to and interrogates each open port, using detection probes that the software may understand. By doing this, Nmap can provide a detailed assessment of what is out there rather than just meaningless open ports.

To make use of this powerful feature, you should:

  1. Enable Service and Version Detection using the parameter -sV.
  2. Add the option --allports to scan every single port. By default, Nmap doesn't check port 9100. Many printers use this port, and in some rare cases, Nmap causes them to print.
  3. Use -T4 for faster execution, as this discovery may be time-consuming.
$ nmap -sV --allports -T4 10.1.0.0/24Nmap scan report for 10.1.0.1Host is up (0.0038s latency).Not shown: 995 filtered portsPORT STATE SERVICE VERSION53/tcp open domain Unbound80/tcp open http nginx2022/tcp open ssh OpenSSH 7.5 (protocol 2.0)5000/tcp open ssl/http-proxy HAProxy http proxy 1.3.1 or later8443/tcp open ssl/http nginxService Info: Device: load balancerNmap scan report for 10.1.0.2Host is up (0.82s latency).Not shown: 992 closed portsPORT STATE SERVICE VERSION22/tcp open ssh OpenSSH 8.3p1 Debian 1 (protocol 2.0)80/tcp open http nginx111/tcp open rpcbind 2-4 (RPC #100000)443/tcp open ssl/http nginx2049/tcp open nfs 3-4 (RPC #100003)3260/tcp open iscsi?6000/tcp open http aiohttp 3.6.2 (Python 3.8)8080/tcp open http Apache httpd 2.4.46 ((Debian) mpm-itk/2.4.7-04 OpenSSL/1.1.1g)Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

From the output above, Nmap found two hosts: 10.1.0.1 and 10.1.0.2.

The first host is detected as a load balancer—pretty close, as it is my router running pfSense. It also noticed several ports open and the software listening on each. It correctly detected the DNS server as Unbound; Nginx as the webserver behind port 80 (expected) and 8443 (a non-standard port); it also caught port 2022 open, with OpenSSH 7.5 behind it; and in port 5000, Nmap detected HAProxy, with a version of at least 1.3.1.

The second host runs Linux, and every software was identified correctly, except for the iSCSI server behind port 3260.

What do you do with this information? Save it! You will need a baseline to compare to the next time you scan the network for new hosts and services. Check the security vulnerabilities for each software detected. Make sure you recognize each device!

Rogue DHCP servers

DHCP servers are a fundamental component of every network. In essence, there should be only one DHCP server per network, providing all the necessary information required to configure the network properly.

Rogue DHCP servers are just like regular DHCP servers, but they are not managed by the IT or network staff. These rogue servers usually appear when users knowingly or unknowingly connect a router to the network. Another possibility is a compromised IoT device such as mobile phones, printers, cameras, tablets, smartwatches, or something worse, such as a compromised IT application or resource.

Rogue DHCP servers are frustrating, especially if you are trying to deploy a fleet of servers using PXE, as PXE depends heavily on DHCP. Not only that, it is a security risk, and you can start experiencing network outages as the rogue DHCP server can provide wrong network settings and routes.

To perform DHCP discoveries, Nmap includes a script called broadcast-dhcp-discover. This script will send a DHCP request to the broadcast address using the MAC address of DE:AD:CO:DE:CA:FE and report the results.

In the following example, the script broadcast-dhcp-discover is executed on the interface bond0 and discovers a rogue DHCP server:

$ sudo nmap --script broadcast-dhcp-discover -e bond0Starting Nmap 7.70 ( https://nmap.org ) at 2020-10-28 19:24 CDTPre-scan script results:| dhcp:| Response 1 of 2:| Interface: bond0| IP Offered: 10.1.0.78| DHCP Message Type: DHCPOFFER| Server Identifier: 10.1.0.1| IP Address Lease Time: 5m00s| Subnet Mask: 255.255.255.0| Router: 10.1.0.1| Domain Name Server: 10.1.0.1| Domain Name: lab.opencloud.io| Response 2 of 2:| Interface: bond0| IP Offered: 10.1.0.27| DHCP Message Type: DHCPOFFER| Server Identifier: 10.1.0.3| IP Address Lease Time: 2m00s| Renewal Time Value: 1m00s| Rebinding Time Value: 1m45s| Subnet Mask: 255.255.255.0| Broadcast Address: 10.1.0.255| Router: 10.1.0.3|_ Domain Name Server: 10.1.0.3WARNING: No targets were specified, so 0 hosts scanned.Nmap done: 0 IP addresses (0 hosts up) scanned in 10.31 seconds

From the output above, you can see two different responses corresponding to a reply from each DHCP server in the network.

The most important field to watch is Server Identifier, as this will show you the IP of the DHCP server, including the potential rogue one.

What do you do with this information? Every organization's security policies are different. However, in most cases, any rogue DHCP should be stopped and removed from the network.

UPnP devices

UPnP, also known as Universal Plug and Play, is a set of multiple protocols to allow any application to forward a port on your router, saving a lot of time in what would be a manual port forwarding configuration.

However, UPnP is dangerous and, if possible, should be disabled on a network. Imagine having a rogue device on the network running malicious applications. These applications could easily use UPnP to forward the port to the outside world and use it for malicious purposes.

UPnP has been exploited many times. Two of the most prominent cases are Mirai, targeting IP cameras and home routers, and Pinkslipbot, which uses infected machines as HTTPS-based proxies for the actual control servers.

Unfortunately, many home devices use UPnP nowadays, including video game consoles or streaming devices such as the Google Chromecast.

To scan the network 10.1.0.0/24 and discover devices using UPnP, the following command should be run to execute the plugin broadcast-upnp-info. Use -T4 to speed up the discovery:

% nmap -sV --script=broadcast-upnp-info -T4 10.1.0.0/24Starting Nmap 7.91 ( https://nmap.org ) at 2020-11-02 18:59 CSTPre-scan script results:| broadcast-upnp-info:| 239.255.255.250| Server: Linux/2.6.12, UPnP/1.0, NETGEAR-UPNP/1.0| Location: http://192.168.1.204:80/Public_UPNP_gatedesc.xml| Manufacturer: NETGEAR, Inc.| Name: WAN Device| Manufacturer: NETGEAR, Inc.| Name: WAN Connection Device| Manufacturer: NETGEAR, Inc.

The Nmap script detected only one device making use of UPnP, providing the necessary information such as the manufacturer, operating system, and software version.

What do you do with this information? If you don't need UPnP, it's better to disable it. If that's not possible, make sure you recognize the device and it's upgraded to the latest firmware version.

[ Want to learn more about security? Check out the IT security and compliance checklist. ]

Conclusion

In this article, we explored how to use Nmap to find potential rogue devices in our networks. With the advent and increasing popularity of IoT devices (many with no security mechanisms), it's crucial now more than ever to keep track of all the devices connected to the network. Nmap is a handy tool to use in these cases and more.

Topics: Linux Networking Security Linux administration

Finding rogue devices in your network using Nmap (2024)

FAQs

How do I see rogue access points on my network? ›

How to Physically Locate a Rogue Access Point
  1. Hold the laptop close to the body at stomach level. ...
  2. Use a WiFi scanner to identify the rogue APs BSSID and track its WiFi signal.
  3. Stand in one specific direction long enough to note the exact WiFi signal.
  4. From the same spot, turn 90 degrees and note the exact WiFi signal.
1 Dec 2017

How do I find out what devices are on my Nmap network? ›

Find Devices Connected to Your Network with nmap on Ubuntu 22.04
  1. Step 1: Open the Ubuntu command line. ...
  2. Step 2: Install the network scanning tool Nmap. ...
  3. Step 3: Determine the IP range/subnet mask of your network. ...
  4. Step 4: Scan the network for the connected device(s) with Nmap. ...
  5. Step 5: Exit the terminal.
30 Aug 2022

Where is the rogue router on my network? ›

You can capture info on the rogue router with sniffing tools like AirMagnet or NetStumber. Try this, If it's acting like a DHCP server, do an ipconfig to see the ip address of it. Then open a browser punch in that IP and you should be presented with the login prompt.

What is a rogue device on a network? ›

A rogue wireless device is a wireless device that remains connected to a system but does not have permission to access and operate in a network. Rogue wireless devices may be access points (rogue access points or rogue APs) or end user computers (rogue peers).

What approaches can be used to detect rogue APs? ›

The approaches to detecting rogue APs fall into three categories: wireless approaches, hybrid wired and wireless approaches, and wired- only approaches.

What is wireless rogue detection? ›

When you enable rogue access point detection on your wireless Firebox , the wireless radio in the device scans wireless channels to identify unknown wireless access points. You can configure the scan to run continuously, or to run at a scheduled interval and time of day.

How do I identify an unknown device on my network? ›

How to manually identify unknown devices on a network
  1. Open the Command prompt or Terminal in your Windows, Linux, or macOS system.
  2. Search all the network settings, such as default gateway and IP address, through the command prompt.
  3. Type the command "arp -a" to view the list of all IP addresses connected to your network.

How do I see devices on my network Linux? ›

A. Using Linux command to find devices on the network
  1. Step 1: Install nmap. nmap is one of the most popular network scanning tool in Linux. ...
  2. Step 2: Get IP range of the network. Now we need to know the IP address range of the network. ...
  3. Step 3: Scan to find devices connected to your network.

Can you identify a device by its MAC address? ›

MAC addresses can sometimes be used to identify the maker and potentially model of the device even without the device in hand. This is called the OUI (organizationally unique identifier).

How do I track a rogue DHCP server? ›

If you're looking to be more proactive in your search for rogue DHCP servers, use a network (packet) sniffer or look in the sFlow data collected by your network traffic analysis tool for packets coming from UDP port 67 (the standard DHCP port) on servers other than your approved DHCP server.

How do I find the unknown DHCP server on my network? ›

One of the easiest ways to find DHCP servers on your network is to monitor network traffic via a SPAN, mirror port, or TAP. Once you have your packet data source, watch out for DHCP offer packets. These are sent by DHCP servers when a client sends out a broadcast packet looking to discover a DHCP server.

How do I find the physical location of a hidden wireless router? ›

How to Find Physical Location of Hidden Wireless Router
  1. Grab a Windows or Mac laptop and charge the battery.
  2. Download and install InSSIDer on the laptop. ...
  3. Launch inSSIDer on the laptop and walk to a place in range of the rogue network. ...
  4. The Amplitude should grow as you get closer to the router.

Which tool is used to detect rogue services? ›

Getting started with OpUtils Rogue detection tool. OpUtils offers features like switch port management, IP address tracker, IP scanning, and 30+ network tools such as IP tools ,along with Rogue Detection tool. These help you to effectivly monitor, scan, track, and troubleshoot your network environment.

How do I prevent unauthorized devices on my network? ›

You can protect your home or work network by ensuring you have a password set up, creating a network security key, changing the advanced settings, and turning on Windows firewall protection. Learn how to prevent unauthorized network access to keep your home or company network safe and protected.

What identifies an unauthorized network connection? ›

Poorly coded or unsanitized web applications. Poor network segmentation. Insecure vendor remote access. Lack of email and web browser protections.

How do I stop rogue access points? ›

Establish a no-exceptions policy against the use of wireless LANs without approval of the IT department. Set up an amnesty program that will allow employees to disclose their self-installed APs to the IT department within a one-month period.

How do you deal with AP rogue? ›

Use network-wide intrusion detection and prevention systems (IDS/IPS): IDS and IPS technologies can also help protect the network from malicious rogue access points. In particular, wireless intrusion prevention systems can be used to identify the presence of unregistered access points plugged into your network.

What's the best way for him to avoid the risks of a rogue access point? ›

What's the best way for him to avoid the risks of a rogue access point? Use a wired connection instead of a wireless connection.

What is an example of a rogue access point? ›

A rogue access point could be a small wireless access point plugged into an existing firewall or switch, or into an unused wall network connector (like at a personal desk), etc. It could be a mobile device attached to a USB that creates a wireless access point, or even a wireless card plugged into a server.

What is a rogue router? ›

Typically, this device is a simple, cheap router that was improperly installed into a network without alerting anyone in management about it. Typically, an employee installed with positive intent to extend a wireless signal or to help other employees in the area connect their personal devices to the network wirelessly.

How do you test an access point? ›

First, you should perform a communications test to see if the access point is responding. Open a Command Prompt window on a PC on your wired network and ping your wireless access point's IP address. The wireless access point should respond to the ping.

Why do I see random devices on my network? ›

If you see strange devices on your network manager, it is likely that your Wi-Fi is protected using a WPA (Wi-Fi Protected Access) protocol.

How do I find a device name from an IP address? ›

Querying DNS

Click the Windows Start button, then "All Programs" and "Accessories." Right-click on "Command Prompt" and choose "Run as Administrator." Type "nslookup %ipaddress%" in the black box that appears on the screen, substituting %ipaddress% with the IP address for which you want to find the hostname.

Why are there so many unknown devices connected to my Wi-Fi? ›

As standard, all routers have a unique Wi-Fi password these days, and it's virtually impossible to hack. It means your unknown devices are probably gadgets you've forgotten about, such as your DVR (maybe a Freeview or Sky box), a smart thermostat, plug or another smart home gadget.

How do I list all devices on my network? ›

To see all of the devices connected to your network, type arp -a in a Command Prompt window. This will show you the allocated IP addresses and the MAC addresses of all connected devices.

What is the netstat command? ›

The netstat command generates displays that show network status and protocol statistics. You can display the status of TCP and UDP endpoints in table format, routing table information, and interface information. netstat displays various types of network data depending on the command line option selected.

What is arp scan? ›

arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network. It is available for Linux and BSD under the GPL licence.

How can I see what devices are connected to my router? ›

About This Article
  1. Open a web browser and type the IP address for your router in the address bar.
  2. Enter the username and password for the router.
  3. Click Connected devices, Attached devices, or something similar.
  4. Check the list of devices connected to your wireless network.
23 Jul 2022

What is a wlan0 device? ›

wlan0 is your wifi card. wlan is wireless lan and 0 is the number of your card. The count starts from 0 and goes up (0,1,2,3,etc..). So if you had 2 wifi cards plugged in they would be represented by wlan0 and wlan1. There are some other naming schemes for wireless lan but that should explain it a little.

How do I trace a MAC address on my network? ›

Windows
  1. Type cmd into the Search bar, then press enter.
  2. Enter ipconfig /all into the Command Prompt window and press enter.
  3. The wireless MAC address will be listed under Wireless LAN adapter Wi-Fi next to Physical Address. The wired MAC address will be listed under Ethernet adapter Ethernet next to Physical Address.
28 Jun 2022

Where is rogue DHCP server Wireshark? ›

Finding the Rogue DHCP server With Wireshark - YouTube

What is a 169.254 IP address? ›

If you see a 169.254. x.x address, it means that the DHCP server is not reachable. The PC will not work because there is not a router to or from that PC. Troubleshoot this by finding out why the PC cannot see the DHCP server.

What will happen if there are multiple DHCP servers on a network? ›

If you are considering multiple DHCP servers, remember that multiple DHCP servers cannot share any of the same addresses. If you use more than one DHCP server in your network, each server must be configured with their own unique IP address ranges.

How do I find DHCP in Wireshark? ›

To view only DHCP traffic, type udp. port == 68 (lower case) in the Filter box and press Enter. In the top Wireshark packet list pane, select the first DHCP packet, labeled DHCP Request. Observe the packet details in the middle Wireshark packet details pane.

How do I find the IP address of a DHCP server for free? ›

On Windows, type the command “ipconfig” and press Return. Get more information by typing the command “arp -a.” You should now see a basic list of the IP addresses for devices connected to your network.

How do I find my DHCP IP address in Linux? ›

The procedure to find out your DHCP IP address in Linux is as follows:
  1. Open the terminal application.
  2. Run less /var/lib/dhcp/dhclient. ...
  3. Another option is to type grep dhcp-server-identifier /var/lib/dhcp/dhclient. ...
  4. One can use ip r Linux command to list default route which act as the DHCP Server on most home networks.
14 Oct 2019

Can Wireshark find hidden SSID? ›

Using Wireshark, if we monitor Beacon frames in the Wireless Lab network, we are able to see the SSID in plain text. You should see Beacon frames, as shown in the following screenshot: Configure your access point to set the Wireless Lab network as a hidden SSID.

How do I scan a hidden wireless network? ›

Windows 10:
  1. In the lower-right corner of your screen, click the WiFi icon.
  2. Click Network Settings > Wi-Fi > Hidden Network > Connect.
  3. Enter the SSID (network name).
  4. Click Next.
  5. Enter the network security key (password).
  6. Click Next. Your computer connects to the network.
30 Jul 2019

Can a device be tracked through WiFi? ›

Wi-Fi location tracking is a very effective way to pinpoint device locations using existing, widespread Wi-Fi infrastructure. It's been in use for years, and it's very effective at geolocation indoors, as well as in other places where GPS doesn't have good coverage.

How do I find a hidden WiFi access point? ›

Click Wi-Fi Settings. Press the menu button in the top-right corner of the window and select Connect to Hidden Network…. In the window that appears, select a previously-connected hidden network using the Connection drop-down list, or New for a new one.

How do you tell what access point you're connected to? ›

Press Windows-Key+R to bring up a Run prompt. Then enter "cmd" and press enter. Then type in "netsh wlan show interfaces". This will display the wireless network the client is currently associated with and information about it.

How do I find my WiFi access point? ›

If you're already connected to the network via WiFi or Ethernet, you can head into your adapter settings menu to find out your wireless access point IP address. Right-click on the network icon in the system tray and select Open Network & Internet settings.

How can I monitor my wireless access point? ›

10 Best Tools for Monitoring Wireless Access Points
  1. NetStumbler.
  2. Solarwinds NPM Wifi Analyzer.
  3. Datadog Network Monitoring.
  4. PRTG Network Monitor.
  5. NetSpot.
  6. Acrylic Wireless.
  7. SolarWinds Remote Monitoring and Management.
  8. inSSIDer.
23 Mar 2021

How do I scan a hidden wireless network? ›

Windows 10:
  1. In the lower-right corner of your screen, click the WiFi icon.
  2. Click Network Settings > Wi-Fi > Hidden Network > Connect.
  3. Enter the SSID (network name).
  4. Click Next.
  5. Enter the network security key (password).
  6. Click Next. Your computer connects to the network.
30 Jul 2019

Can Wireshark find hidden SSID? ›

Using Wireshark, if we monitor Beacon frames in the Wireless Lab network, we are able to see the SSID in plain text. You should see Beacon frames, as shown in the following screenshot: Configure your access point to set the Wireless Lab network as a hidden SSID.

Do access points have IP addresses? ›

The default IP address of the Access Point or Range Extender is 192.168. 1.1 or 192.168. 1.254 or 192.168. 0.254.

What do wireless clients use to identify a specific wireless access point? ›

BSSIDs Identify Access Points and Their Clients

This identifier is called a basic service set identifier (BSSID) and is included in all wireless packets.

What is a MAC address of a device? ›

A MAC (Media Access Control) address, sometimes referred to as a hardware or physical address, is a unique, 12-character alphanumeric attribute that is used to identify individual electronic devices on a network. An example of a MAC address is: 00-B0-D0-63-C2-26.

Can you trace a Wi-Fi signal? ›

By itself, there is no way to get that information from a wifi signal. Google, however, has indexed wifi access points with their locations. So they are able to tell where you are based on the wifi AP you are connected to. In a case like that, it is possible to get a location based on wifi.

How can I find the IP address of unknown Wi-Fi using cmd? ›

To see all of the devices connected to your network, type arp -a in a Command Prompt window. This will show you the allocated IP addresses and the MAC addresses of all connected devices.

What can I do with a wireless access point? ›

Wireless Access Points Fully Explained - YouTube

What is wireless network monitoring? ›

Using a wireless network monitor, you can collect and analyze wireless network health and performance data, including wireless coverage, signal strength, connected clients, and performance statistics for wireless access points.

What is wireless monitoring? ›

Wireless monitoring is the process of discovering, monitoring, and analyzing the performance of wireless devices in a network.

What is WiFi monitoring? ›

WiFi monitoring is the act of analyzing wireless networks to see the status, load, traffic, speed, and signal strength of each network.

Top Articles
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 6369

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.