nmap-vulners icon indicating copy to clipboard operation
nmap-vulners copied to clipboard

Nmap 7.70 Cannot run the script...

Open Mod233 opened this issue 6 years ago • 20 comments

when I use:

➜  Scanner-Tool nmap -v
Starting Nmap 7.70SVN ( https://nmap.org ) at 2018-05-31 10:18 CST
Read data files from: /usr/local/bin/../share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.02 seconds

➜  Scanner-Tool sudo nmap -sV --script vulners 95.163.200.165         
Starting Nmap 7.70SVN ( https://nmap.org ) at 2018-05-31 10:19 CST
NSE: failed to initialize the script engine:
/usr/local/bin/../share/nmap/nse_main.lua:823: 'vulners' did not match a category, filename, or directory
stack traceback:
	[C]: in function 'error'
	/usr/local/bin/../share/nmap/nse_main.lua:823: in local 'get_chosen_scripts'
	/usr/local/bin/../share/nmap/nse_main.lua:1315: in main chunk
	[C]: in ?

QUITTING!

...

Mod233 avatar May 31 '18 02:05 Mod233

Hi!

Can you make sure you have actually located the script in the required directory? Like you might be using another installation of nmap, perhaps.

GMedian avatar Jun 08 '18 14:06 GMedian

Hi There :-) I would love to be able to use the vulners script but so far i am having the same issues as the previous comment above with the same output error. I have placed the script in the correct directory and using latest nmap 7.70 version.

Have you been able to replicate this error using nmap version 7.70?

Cheers

safir2306 avatar Jul 10 '18 05:07 safir2306

Found a workaround for it. Seems like i need to cd directly to the nmap/scripts/ directory and launch vulners directly from the directory for the script to work.

Hope this helps

Cheers

safir2306 avatar Jul 10 '18 06:07 safir2306

@safir2306 thx for your great help. I fixed the problem. It's all my fault that i did not cd in the right directory.

Mod233 avatar Jul 10 '18 23:07 Mod233

Did you guys run --script-updatedb ? For me (Linux) it just worked then

drwetter avatar Jul 11 '18 09:07 drwetter

Hey mate,

No worries glad i could help out.

Cheers

2018-07-11 17:34 GMT+08:00 Dirk Wetter [email protected]:

Did you guys run --script-updatedb ? For me (Linux) it just worked then

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vulnersCom/nmap-vulners/issues/13#issuecomment-404107249, or mute the thread https://github.com/notifications/unsubscribe-auth/Ag6AYhn7lF1IfM8zvY0LFWkZHj-ukXyAks5uFcadgaJpZM4UUT_y .

safir2306 avatar Jul 16 '18 08:07 safir2306

@safir2306 @drwetter @Mod233 @GMedian

nmap --script-updatedb
Starting Nmap 7.70 ( https://nmap.org ) at 2018-11-18 16:28 CST
NSE: Updating rule database.
NSE: Failed to load /usr/bin/../share/nmap/scripts//ajp-methods.nse:
/usr/bin/../share/nmap/scripts//ajp-methods.nse:4: module 'stringaux' not found:
	NSE failed to find nselib/stringaux.lua in search paths.
	no field package.preload['stringaux']
	no file '/usr/local/share/lua/5.3/stringaux.lua'
	no file '/usr/local/share/lua/5.3/stringaux/init.lua'
	no file '/usr/local/lib/lua/5.3/stringaux.lua'
	no file '/usr/local/lib/lua/5.3/stringaux/init.lua'
	no file '/usr/share/lua/5.3/stringaux.lua'
	no file '/usr/share/lua/5.3/stringaux/init.lua'
	no file './stringaux.lua'
	no file './stringaux/init.lua'
	no file '/usr/local/lib/lua/5.3/stringaux.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.3/stringaux.so'
	no file '/usr/lib/lua/5.3/stringaux.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './stringaux.so'
stack traceback:
	[C]: in function 'require'
	/usr/bin/../share/nmap/scripts//ajp-methods.nse:4: in function </usr/bin/../share/nmap/scripts//ajp-methods.nse:1>
NSE: failed to initialize the script engine:
/usr/bin/../share/nmap/nse_main.lua:619: could not load script
stack traceback:
	[C]: in function 'error'
	/usr/bin/../share/nmap/nse_main.lua:619: in field 'new'
	/usr/bin/../share/nmap/nse_main.lua:1296: in main chunk
	[C]: in ?

QUITTING!

hktalent avatar Nov 18 '18 08:11 hktalent

I am sorry but what is the fix here? I am getting the same issue as the original posters. I have ls'd my way into the /usr/share/nmap/scripts directory and found all the scripts but it does not work when I try to load it.

Kristoff-Slayer avatar Feb 25 '19 00:02 Kristoff-Slayer

I have tryed what all of you said such as upgrade db but no use.

my env:

  • kali3 2019.1
  • nmap 7.70
  • target(192.168.3.214) is rapid7/metasploitable3-ub1404

what such that i have runed. 截图

xx-zhang avatar Mar 14 '19 02:03 xx-zhang

Following : https://null-byte.wonderhowto.com/how-to/easily-detect-cves-with-nmap-scripts-0181925/ is probably what you did there tutorial is awful in my opinion you will run into the error "/usr/local/bin/../share/nmap/nse_main.lua:823: 'vulners' did not match a category, filename, or directory stack traceback: [C]: in function 'error' /usr/local/bin/../share/nmap/nse_main.lua:823: in local 'get_chosen_scripts' /usr/local/bin/../share/nmap/nse_main.lua:1315: in main chunk [C]: in ?

QUITTING!" the way I fixed this was by using the command: cd /usr/share/nmap/scripts nmap -sV --script=vulscan/vulscan.nse nmap -sV --script=vulscan/vulscan.nse -sV -p22 50...** (*or what ever command you desire)

If it still isn't make sure you installed it correctly: cd /usr/share/nmap/scripts git clone https://github.com/scipag/vulscan scipag_vulscan ln -s pwd/scipag_vulscan /usr/share/nmap/scripts/vulscan

Have a good day m8 cheers

40withabeam avatar Apr 24 '19 17:04 40withabeam

Following : https://null-byte.wonderhowto.com/how-to/easily-detect-cves-with-nmap-scripts-0181925/ is probably what you did there tutorial is awful in my opinion you will run into the error "/usr/local/bin/../share/nmap/nse_main.lua:823: 'vulners' did not match a category, filename, or directory stack traceback: [C]: in function 'error' /usr/local/bin/../share/nmap/nse_main.lua:823: in local 'get_chosen_scripts' /usr/local/bin/../share/nmap/nse_main.lua:1315: in main chunk [C]: in ?

QUITTING!" the way I fixed this was by using the command: cd /usr/share/nmap/scripts nmap -sV --script=vulscan/vulscan.nse nmap -sV --script=vulscan/vulscan.nse -sV -p22 50...** (*or what ever command you desire)

If it still isn't make sure you installed it correctly: cd /usr/share/nmap/scripts git clone https://github.com/scipag/vulscan scipag_vulscan ln -s pwd/scipag_vulscan /usr/share/nmap/scripts/vulscan

Have a good day m8 cheers

Following : https://null-byte.wonderhowto.com/how-to/easily-detect-cves-with-nmap-scripts-0181925/ is probably what you did there tutorial is awful in my opinion you will run into the error "/usr/local/bin/../share/nmap/nse_main.lua:823: 'vulners' did not match a category, filename, or directory stack traceback: [C]: in function 'error' /usr/local/bin/../share/nmap/nse_main.lua:823: in local 'get_chosen_scripts' /usr/local/bin/../share/nmap/nse_main.lua:1315: in main chunk [C]: in ?

QUITTING!" the way I fixed this was by using the command: cd /usr/share/nmap/scripts nmap -sV --script=vulscan/vulscan.nse nmap -sV --script=vulscan/vulscan.nse -sV -p22 50...** (*or what ever command you desire)

If it still isn't make sure you installed it correctly: cd /usr/share/nmap/scripts git clone https://github.com/scipag/vulscan scipag_vulscan ln -s pwd/scipag_vulscan /usr/share/nmap/scripts/vulscan

Have a good day m8 cheers

I did these and still doesnt work

thaRealMrMeeseks avatar Oct 23 '19 13:10 thaRealMrMeeseks

having the same problem on windows. I tried to update it and this error shows up: C:\Program Files (x86)\Nmap/nse_main.lua:823: 'updatedb' did not match a category, filename, or directory

Aholicknight avatar Dec 25 '19 18:12 Aholicknight

I followed the above mentioned tutorial and had exactly the same problem. To get this to work "as expected" (i.e. no dependency on what directory i was in, etc, etc). I did the following;

  1. (as root) removed the "vulns" symlink in /usr/share/nmap/scripts
  2. (as root) cd to where my git clone resided and did a "cp -r scipag_vulscan /usr/share/nmap/scripts/vulscan. (eliminate any potential file ownership conflicts, since the tutorial didn't mention being root when doing the git-clone or re-setting ownership afterwords, but EVERYTHING in the scripts directory has root ownership, at least on Fedora based systems using yum/rpm to install nmap).
  3. cd /usr/share/nmap/scripts
  4. cp vulscan/vulscan.nse . (We now have a copy of the actual script inside the "official" scripts directory that nmap searches, which was the core error most people were seeing: w/o that script in the proper directory or some override on the command line, you get the "script doesn't meet some criteria" snotgram.
  5. (still as root), ran "nmap --script-updatedb"

I am now able to run this script W/O root privileges, regardless of what directory I'm in. ex: ]$ whoami

]$ nmap -sV --script=vulscan.nse <my.target>

Starting Nmap 6.47 ( http://nmap.org ) at 2020-05-22 10:44 PDT Nmap scan report for <my.target> (target.ip.address) Host is up (0.00051s latency). Not shown: 996 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.4 (protocol 2.0) | vulscan: VulDB - https://vuldb.com: ...etc, etc, etc...

Hope this is helpful/useful.

tpa10 avatar May 22 '20 17:05 tpa10

Found a workaround for it. Seems like i need to cd directly to the nmap/scripts/ directory and launch vulners directly from the directory for the script to work.

Hope this helps

Cheers

This worked like magic, thanks for noting this.

vanilla-unicorn avatar Aug 20 '20 02:08 vanilla-unicorn

Have you tried to add that directory to the path?

On 8/19/2020 10:54 PM, Joel Santiago wrote:

Found a workaround for it. Seems like i need to cd directly to the
nmap/scripts/ directory and laHunch vulners directly from the
directory for the script to work.

Hope this helps

Cheers

This worked like magic, thanks for noting this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vulnersCom/nmap-vulners/issues/13#issuecomment-676890844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMIZGPQQHSG35WSHBVCWNFDSBSF7DANCNFSM4FCRH7ZA.

--

Respectfully,

Paul Bugeja

802-373-0586

Native Fish Coalition, Vice-Chair Vermont Chapter

https://nativefishcoalition.org/

https://nativefishcoalition.org/

pawlub422 avatar Aug 20 '20 11:08 pawlub422

I met the same issue.You should go to this directory /usr/share/nmap/script or /usr/local/share/nmap/script to check if there exists vulners.nse file. If no, copy it to this path. then it works

rainishjj avatar Sep 25 '20 01:09 rainishjj

If you still have the same error after this:

cd /usr/share/nmap/scripts git clone https://github.com/scipag/vulscan scipag_vulscan ln -s pwd/scipag_vulscan /usr/share/nmap/scripts/vulscan

you have to copy the script vulscan.nse (you'll find it in scipag_vulscan) in /usr/share/nmap/scripts

cp vulscan.nse /usr/share/nmap/scripts

Hakim1195 avatar Dec 28 '20 16:12 Hakim1195

If you still have the same error after this:

cd /usr/share/nmap/scripts git clone https://github.com/scipag/vulscan scipag_vulscan ln -s pwd/scipag_vulscan /usr/share/nmap/scripts/vulscan

you have to copy the script vulscan.nse (you'll find it in scipag_vulscan) in /usr/share/nmap/scripts

cp vulscan.nse /usr/share/nmap/scripts

this working 100 % , thank you sir.

SirKnightV avatar Jan 18 '21 16:01 SirKnightV

when I use:

➜  Scanner-Tool nmap -v
Starting Nmap 7.70SVN ( https://nmap.org ) at 2018-05-31 10:18 CST
Read data files from: /usr/local/bin/../share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.02 seconds

➜  Scanner-Tool sudo nmap -sV --script vulners 95.163.200.165         
Starting Nmap 7.70SVN ( https://nmap.org ) at 2018-05-31 10:19 CST
NSE: failed to initialize the script engine:
/usr/local/bin/../share/nmap/nse_main.lua:823: 'vulners' did not match a category, filename, or directory
stack traceback:
	[C]: in function 'error'
	/usr/local/bin/../share/nmap/nse_main.lua:823: in local 'get_chosen_scripts'
	/usr/local/bin/../share/nmap/nse_main.lua:1315: in main chunk
	[C]: in ?

QUITTING!

...

try nmap -sV --script vuln

jayakrishnanvkm avatar Jun 28 '21 13:06 jayakrishnanvkm

when I use:

➜  Scanner-Tool nmap -v
Starting Nmap 7.70SVN ( https://nmap.org ) at 2018-05-31 10:18 CST
Read data files from: /usr/local/bin/../share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.02 seconds

➜  Scanner-Tool sudo nmap -sV --script vulners 95.163.200.165         
Starting Nmap 7.70SVN ( https://nmap.org ) at 2018-05-31 10:19 CST
NSE: failed to initialize the script engine:
/usr/local/bin/../share/nmap/nse_main.lua:823: 'vulners' did not match a category, filename, or directory
stack traceback:
	[C]: in function 'error'
	/usr/local/bin/../share/nmap/nse_main.lua:823: in local 'get_chosen_scripts'
	/usr/local/bin/../share/nmap/nse_main.lua:1315: in main chunk
	[C]: in ?

QUITTING!

...

try nmap -sV --script vuln

thank you! this worked for me

sarah-albassam avatar Aug 19 '21 17:08 sarah-albassam