0

I want to find out all my available routers with nmap.

Typing this in command line returns the expected output.

nmap --script=broadcast-dchp-discover -e eno1

But when I try to run this command in a short bash script nmap returns an error:

NSE: failed to initialize the script engine:
/usr/bin/../share/nmap/nse_main.lua:801: 'broadcast-dchp-discover' did not match a category, filename, or directory
stack traceback:
        [C]: in function 'error'
        /usr/bin/../share/nmap/nse_main.lua:801: in function 'get_chosen_scripts'
        /usr/bin/../share/nmap/nse_main.lua:1251: in main chunk
        [C]: in ?

What am I doing wrong?

  • Is broadcast-dchp-discover a file or directory? – muru Jul 7 '17 at 9:28
  • broadcast-dchp-discover is a file that came with the installation of nmap – user6679493 Jul 7 '17 at 9:38
  • Could it be a problem of running the script from the wrong working directory? Maybe try and add a cd to the script or use the full absolute path instead of relative. – Byte Commander Jul 7 '17 at 9:40
  • Using the absolute path /usr/share/nmap/scripts/broadcast-dchp-discover.nse didn't work. – user6679493 Jul 7 '17 at 9:45
  • We can't help you debug a script you don't show us. Please edit your question and include the script you are running and the command you use to execute your script. – terdon Jul 7 '17 at 11:30
1

Looks like you typed "dhcp" to me. Change this:

broadcast-dchp-discover

To use dhcpd:

broadcast-dchpd-discover

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.