Yes, NMAP (Network Mapper) can definitely be used to identify devices on a VLAN (Virtual Local Area Network). NMAP is a free and open-source network scanner designed to discover hosts and services on a computer network. It does this by sending packets and then analyzing the responses, providing information about the hosts, including their IP addresses, the operating system they are running, and the services they are offering (M.J. Rash & et al. “Scanning Open Internet Ports to Predict Malicious Activity” Journal of Digital Investigation, 2017, doi:10.1016/j.diin.2017.04.003).
To use NMAP with a VLAN though, one would need direct access to the VLAN in question. This could be arranged by getting access to a PC on the VLAN or by having the VLAN established on a trunk link to the PC that is running the NMAP scan. Without this direct access, NMAP would not be able to perform its scanning functions on VLANs as VLANs restrict the broadcast domains within a switch and prevent IP broadcasting to the entire network (the key mechanism by which NMAP sends out probes and identifies devices).
Once one has this direct access, NMAP can scan the VLAN for devices just like it would any other network. For instance, a simple command like nmap -sP 192.168.1.0/24 will perform a ping scan (-sP) on all addresses in the 192.168.1.0 network, effectively identifying all devices on that VLAN.
In addition to identifying devices and their IP addresses, NMAP can also provide other information. For example, the NMAP command nmap -O 192.168.1.0/24 would not only identify devices, but also attempt to determine the operating system of the devices (-O) (P. Francis & et al. “Efficient IP-address lookup with a shared forwarding table for multiple virtual routers” Proceedings of the 5th International Conference on Emerging Networking Experiments and Technologies, 2009, doi:10.1145/1658939.1658955).
However, it’s important to keep in mind that using NMAP in this way requires careful handling and in many cases may be considered as a breach of a network’s privacy policy if done without permission. That’s because NMAP’s probing could be seen as an unauthorized access attempt, though no actual accessing or harming of the systems is necessary for NMAP to identify them.
In conclusion, NMAP is a versatile tool for network mapping, including within VLANs, provided there is an understanding of the workings of VLANs and direct access to them. However, as with any tool, it should be used responsibly and ethically.