Nmap broadcast-wake-on-lan NSE Script
This page contains detailed information about how to use the broadcast-wake-on-lan NSE script. For list of all NSE scripts, visit the Nmap NSE Library.
Select: |
---|
Script Overview
Script source code: https://github.com/nmap/nmap/tree/master/scripts/broadcast-wake-on-lan.nse
Script categories: broadcast, safe
Target service / protocol: -
Target network port(s): -
List of CVEs: -
Script Description
The broadcast-wake-on-lan.nse script wakes a remote system up from sleep by sending a Wake-On-Lan packet.
Broadcast-wake-on-lan NSE Script Arguments
This is a full list of arguments supported by the broadcast-wake-on-lan.nse script:
broadcast-wake-on-lan.addressThe broadcast address to which the WoL packet is sent.
broadcast-wake-on-lan.MACThe MAC address of the remote system to wake up
- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..]
syntax. For example:
nmap --script=broadcast-wake-on-lan --script-args broadcast-wake-on-lan.address=value,broadcast-wake-on-lan.MAC=value <target>
Broadcast-wake-on-lan NSE Script Example Usage
Here's an example of how to use the broadcast-wake-on-lan.nse script:
nmap --script broadcast-wake-on-lan --script-args broadcast-wake-on-lan.MAC='00:12:34:56:78:9A'
Broadcast-wake-on-lan NSE Script Example Output
Here's a sample output from the broadcast-wake-on-lan.nse script:
Pre-scan script results:
| broadcast-wake-on-lan:
|_ Sent WOL packet to: 10:9a:dd:a8:40:24
Broadcast-wake-on-lan NSE Script Example XML Output
There is no sample XML output for this module. However, by providing the -oX <file>
option, Nmap will produce a XML output and save it in the file.xml
file.
Author
- Patrik Karlsson
References
- https://nmap.org/nsedoc/scripts/broadcast-wake-on-lan.html
- https://github.com/nmap/nmap/tree/master/scripts/broadcast-wake-on-lan.nse
See Also
Related NSE scripts to the broadcast-wake-on-lan.nse script:
- broadcast-ataoe-discover.nse
- broadcast-avahi-dos.nse
- broadcast-bjnp-discover.nse
- broadcast-db2-discover.nse
- broadcast-dhcp6-discover.nse
- broadcast-dhcp-discover.nse
- broadcast-dns-service-discovery.nse
- broadcast-dropbox-listener.nse
- broadcast-eigrp-discovery.nse
- broadcast-hid-discoveryd.nse
- broadcast-igmp-discovery.nse
- broadcast-jenkins-discover.nse
- broadcast-listener.nse
- broadcast-ms-sql-discover.nse
- broadcast-netbios-master-browser.nse
- broadcast-networker-discover.nse
- broadcast-novell-locate.nse
- broadcast-ospf2-discover.nse
- broadcast-pc-anywhere.nse
- broadcast-pc-duo.nse
- broadcast-pim-discovery.nse
- broadcast-ping.nse
- broadcast-pppoe-discover.nse
- broadcast-rip-discover.nse
- broadcast-ripng-discover.nse
- broadcast-sonicwall-discover.nse
- broadcast-sybase-asa-discover.nse
- broadcast-tellstick-discover.nse
- broadcast-upnp-info.nse
- broadcast-versant-locate.nse
- broadcast-wpad-discover.nse
- broadcast-wsdd-discover.nse
- broadcast-xdmcp-discover.nse
Visit Nmap NSE Library for more scripts.
The broadcast-wake-on-lan.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.
Failed to process MAC address
Here is a relevant code snippet related to the "Failed to process MAC address" error message:
46: if ( MAC:match("%x%x:%x%x:%x%x:%x%x:%x%x:%x%x") ) then
47: MAC_hex = MAC:gsub(":", "")
48: elseif( MAC:match("%x%x%-%x%x%-%x%x%-%x%x%-%x%x%-%x%x") ) then
49: MAC_hex = MAC:gsub("-", "")
50: else
51: return fail("Failed to process MAC address")
52: end
53:
54: local host = { ip = address or "255.255.255.255" }
55: local port = { number = 9, protocol = "udp" }
56: local socket = nmap.new_socket("udp")
Failed to send packet
Here is a relevant code snippet related to the "Failed to send packet" error message:
58: -- send two packets, just in case
59: for i=1,2 do
60: local packet = createWOLPacket(MAC_hex)
61: local status, err = socket:sendto(host, port, packet)
62: if ( not(status) ) then
63: return fail("Failed to send packet")
64: end
65: end
66: return stdnse.format_output(true, ("Sent WOL packet to: %s"):format(MAC))
67: end
68:
Version
This page has been created based on Nmap version 7.92.
Go back to menu.