nmap script engine error

Bug #319656 reported by stop
98
This bug affects 16 people
Affects Status Importance Assigned to Milestone
nmap (Ubuntu)
Fix Released
High
Alexander Sack
Nominated for Karmic by John Haitas
Jaunty
Fix Released
High
Jonathan Davies

Bug Description

Description: Ubuntu jaunty (development branch)
Release: 9.04

Nmap 4.76

nmap threw script engine errors when attempting to probe a local ip: sudo nmap -A <localipaddress>

errors:
SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/skype_v2-version.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:18: UPnP-info.nse is not a file!
stack traceback:
 [C]: in function 'Entry'
 /usr/share/nmap/scripts/script.db:18: in main chunk
 [C]: ?
 [C]: ?

SCRIPT ENGINE: Aborting script scan.

Related branches

Revision history for this message
Jonathan Davies (jpds) wrote :

I'll work on getting a fixed package to Jaunty.

Changed in nmap:
assignee: nobody → jpds
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Jonathan Davies (jpds) wrote :

OK; here's the patch which should fix this problem, awaiting upload.

Revision history for this message
Alexander Sack (asac) wrote :

+usr/share/nmap/*
+usr/lib/nmap/*

Could we please try to not refactor the packaging until we have sorted out debian? e.g. here its that debian package explicitly lists all files; changing that to wildcard changes the spirit of package.

Also the indentation change of Build-Depends is a similar packaging refactoring that will eventual future merges unnecessary hard.

Adding Homepage: entry in ubuntu is similarly not the way to go until its sorted that debian will accept something like this.

Same for dropping maintainer scripts that do nothing.

In short: could you come up with a patch that fixes this bug in a minimal fashion?

Thanks!

Changed in nmap:
importance: Medium → High
Revision history for this message
Alexander Sack (asac) wrote :

lets try to get this fixed for alpha 4. milestoning, targetting.

Changed in nmap:
milestone: none → jaunty-alpha-4
Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 319656] Re: nmap script engine error

On Wed, Jan 21, 2009 at 09:18:52PM -0000, Alexander Sack wrote:
>
> +usr/share/nmap/*
> +usr/lib/nmap/*
>
> Could we please try to not refactor the packaging until we have sorted
> out debian? e.g. here its that debian package explicitly lists all
> files; changing that to wildcard changes the spirit of package.
>
> Also the indentation change of Build-Depends is a similar packaging
> refactoring that will eventual future merges unnecessary hard.
>
> Adding Homepage: entry in ubuntu is similarly not the way to go until
> its sorted that debian will accept something like this.
>
> Same for dropping maintainer scripts that do nothing.
>
> In short: could you come up with a patch that fixes this bug in a
> minimal fashion?

Any update? Can we get a minimal fix now for alpha 4?

 - Alexander

Revision history for this message
Alexander Sack (asac) wrote :

Update: jonathen said he would prepare a minimal diff to fix this.

Revision history for this message
Jonathan Davies (jpds) wrote :

Minimal patch: include missing usr/share/nmap/scripts/UPnP-info.nse file.

Steve Langasek (vorlon)
Changed in nmap:
milestone: jaunty-alpha-4 → none
Revision history for this message
Alexander Sack (asac) wrote :

uploaded. thanks!

Changed in nmap:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nmap - 4.76-0ubuntu2

---------------
nmap (4.76-0ubuntu2) jaunty; urgency=low

  * debian/nmap.files: Included missing 'UPnP-info.nse' file needed to fix
    script scan (LP: #319656).

 -- Jonathan Davies <email address hidden> Fri, 30 Jan 2009 10:03:03 +0000

Changed in nmap:
status: Fix Committed → Fix Released
Revision history for this message
Augusto Santos (mkhaos7) wrote :

this bug (or a variant of it) is still present in nmap-4.76-0ubuntu4. See output below:

------------
Starting Nmap 4.76 ( http://nmap.org ) at 2009-03-29 06:46 BRT
SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/skype_v2-version.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:20: rpcinfo.nse is not a file!
stack traceback:
        [C]: in function 'Entry'
        /usr/share/nmap/scripts/script.db:20: in main chunk
        [C]: ?
        [C]: ?

SCRIPT ENGINE: Aborting script scan.
-----------

The rest of the scan finishes with success.
My machine was upgraded from 8.10 to 9.04, if this matter.

Revision history for this message
Michael Wigle (michaelwigle) wrote :

I can confirm that. I'm running nmap-4.76-0ubuntu4 as well and received the following output:

---------------
SCRIPT ENGINE: Initiating script scanning.
SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/skype_v2-version.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:20: rpcinfo.nse is not a file!
stack traceback:
 [C]: in function 'Entry'
 /usr/share/nmap/scripts/script.db:20: in main chunk
 [C]: ?
 [C]: ?

SCRIPT ENGINE: Aborting script scan.
----------------

Will the case be re-opened then as I'm seeing that it's marked as "Fix released" up above. As a side note, I'm new to using launchpad so forgive me (and teach me) if I am misunderstanding the process here.

Revision history for this message
Kevin Chang (iprefermuffins) wrote :

Here's a patch which I think should eliminate all the script engine errors...at least all the ones I saw. It seemed like there were a bunch of other files besides UPnP-info.nse which needed to be included, so I added them in the same way Jonathan's last patch did.

(P.S. - I'm very new to submitting patches so please let me know if there's something I didn't do right.)

Revision history for this message
Kevin Chang (iprefermuffins) wrote :

I just figured out how to reopen this - hopefully it's an appropriate action since this is technically not completely resolved yet (though see my submission above).

Changed in nmap (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Augusto Santos (mkhaos7) wrote :

Just tried Kevin changes (rebuilding nmap), and everything seens to work as expected.
Did a couple of scans and didn't find any problem.
One special way to test it might be: nmap -A --script=/usr/share/nmap/scripts <host>
Which will run all scripts installed.

Revision history for this message
Michael Wigle (michaelwigle) wrote :

The debdiff worked for me as well. Thanks so much for that! It's my first attempt at installing a patch. The Ubuntu Packaging guide wiki had the steps perfectly laid out for applying a debdiff and now my Zenmap works properly! So, will this patch work it's way into the update manager as an update to fix the bug now?

Revision history for this message
Jens Maucher (jensmaucher) wrote :

I rebuild nmap with this patch, but it didn't work.
The errors are still available.

Revision history for this message
John Haitas (jhaitas) wrote :

I can confirm this bug in Karmic

Revision history for this message
Anjue (nataoh) wrote :

I tried Kevin Chang pathes it's working but after I build the deb file I got this error after install

Setting up nmap (4.76-0ubuntu5) ...
dpkg (subprocess): unable to execute post-installation script: Exec format error
dpkg: error processing nmap (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 nmap

any ideas?

Revision history for this message
Dylan Reviczky (dreviczky) wrote :

Kevin Chang's debdiff resolved all issues for me on 9.04 Jaunty - thank you for creating it.

Revision history for this message
Chris Jean (gaarai) wrote :

Thanks Kevin Chang, your debdiff worked for me as well. Great work.

Ubuntu 9.04 Jaunty

Revision history for this message
Jay Zeng (jiezeng03) wrote :
Download full text (3.6 KiB)

I haven't try the diff yet, but the (current) package is obvious broken I am running ubuntu jaunty (9.0.4), with nmap version (downloaded from the ubuntu repo) :

/usr/bin/nmap -v

Starting Nmap 4.76 ( http://nmap.org ) at 2009-07-14 22:29 PDT
Read data files from: /usr/share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.16 seconds

The following is produced by:
/usr/bin/nmap --script ALL 127.0.0.1 -d

Scanning 127.0.0.1 [1000 ports]
Discovered open port 80/tcp on 127.0.0.1
Increased max_successful_tryno for 127.0.0.1 to 1 (packet drop)
Discovered open port 139/tcp on 127.0.0.1
Completed Connect Scan at 22:27, 1.17s elapsed (1000 total ports)
Overall sending rates: 930.44 packets / s.
SCRIPT ENGINE: Initiating script scanning.
SCRIPT ENGINE: Script scanning 127.0.0.1.
SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
/usr/share/nmap/scripts/dns-test-open-recursion.nse:12: module 'comm' not found:
        no field package.preload['comm']
        no file '/usr/share/nmap/nselib/comm.lua'
        no file './comm.lua'
        no file '/usr/local/share/lua/5.1/comm.lua'
        no file '/usr/local/share/lua/5.1/comm/init.lua'
        no file '/usr/local/lib/lua/5.1/comm.lua'
        no file '/usr/local/lib/lua/5.1/comm/init.lua'
        no file './comm.so'
        no file '/usr/local/lib/lua/5.1/comm.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:6: dns-safe-recursion-port.nse is not a file!
stack traceback:
        [C]: in function 'Entry'
        /usr/share/nmap/scripts/script.db:6: in main chunk
        [C]: ?
        [C]: ?

SCRIPT ENGINE: Script scanning completed.
SCRIPT ENGINE: Aborting script scan.
Host 127.0.0.1 appears to be up ... good.
Scanned at 2009-07-14 22:27:07 PDT for 1s
Interesting ports on 127.0.0.1:
Not shown: 993 closed ports
Reason: 993 conn-refused
PORT STATE SERVICE REASON
---edited result ---
Final times for host: srtt: 496 rttvar: 232 to: 100000

Read from /usr/share/nmap: nmap-services.
Nmap done: 1 IP address (1 host up) scanned in 1.43 seconds

I also tried to download source from svn (version 4.90RC2, svn r12639) and made a new build, another (similar) error message appears:
nmap --script ALL 127.0.0.1 -d

NSE: SMB: Login as \<blank> succeeded
NSE: MSRPC: Failed to enumerate users through SAMR: NT_STATUS_ACCESS_DENIED (samr.connect4)
NSE: smb-brute: Couldn't enumerate users (normal for Windows XP and higher), using unpwdb initially
NSE: smb-brute: Opening password list
NSE: smb-brute: Starting the initial SMB session
NSE: smb-brute against 192.168.2.3 threw an error!
/usr/local/share/nmap/nselib/smb.lua:214: bad argument #2 to 'format' (number expected, got nil)
stack traceback:
        [C]: in function 'format'
        /usr/local/share/nmap/nselib/smb.lua:214: in function 'get_status_name'
        /usr/local/share/nmap/nselib/smb.lua:1233: in function </usr/local/share/nmap/nselib/smb.lua:1115>
        (tail call): ?
        /usr/local/share/nmap/scripts/smb-brute.nse:325: in...

Read more...

Revision history for this message
Federico Di Giacomo (federico-digiacomo) wrote :

Kevin Chang's debdiff resolved all issues for me on 9.04 Jaunty. Remember that after applying .debdiff you must compile with:

./configure
sudo make
sudo make install

Revision history for this message
Eduardo Sánchez (dev-eddie) wrote :
Download full text (3.4 KiB)

The package is still broken in Jaunty (ie: no update in -proposed), running nmap 4.76-0ubuntu4

Output after running all available scripts was:
eddie@quevedo:~$ nmap -A --script=/usr/share/nmap/scripts 192.168.0.1

Starting Nmap 4.76 ( http://nmap.org ) at 2009-07-20 16:29 CEST
SCRIPT ENGINE: '/usr/share/nmap/scripts/skype_v2-version.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/iax2Detect.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/PPTPversion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/PPTPversion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/skype_v2-version.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/showHTMLTitle.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/ripeQuery.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/finger.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/HTTPtrace.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/HTTP_open_proxy.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/chargenTest.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/showSMTPVersion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/ircZombieTest.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/echoTest.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/zoneTrans.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/nbstat.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/daytimeTest.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/iax2Detect.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/HTTPpasswd.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/robots.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/HTTPAuth.nse' threw a run time error and could not be loaded.
Interesting ports on Neruda.mshome.net (192.168.0.1):
Not shown: 995 closed ports
PORT STATE SERVICE VERSION
21/tcp open tcpwrapped
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn
445/tcp open microsoft-ds Microsoft Windows XP microsoft-ds
2869/tcp open http Microsoft HTTPAPI httpd 1.0 (SSDP/UPnP)
Service Info: OS: Windows

Host script results:
| Discover OS Version over NetBIOS and SMB: OS version cannot be determined.
|_ Never received a response to SMB Setup AndX Request
| Discover OS Version over NetBIOS and SMB: Windows XP
|_ ...

Read more...

Revision history for this message
Doctor P (coffeeonmars) wrote :

Installed Chang's patch, confirming it works for me on Jaunty.

Revision history for this message
hhzuoguoyou (hhzuoguoyou) wrote : 回复: [Bug 319656] Re: nmap script engine error

retrying...

--- 09年7月25日,周六, Doctor P <email address hidden> 写道:

发件人: Doctor P <email address hidden>
主题: [Bug 319656] Re: nmap script engine error
收件人: <email address hidden>
日期: 2009年7月25日,周六,下午5:53

Installed Chang's patch, confirming it works for me on Jaunty.

--
nmap script engine error
https://bugs.launchpad.net/bugs/319656
You received this bug notification because you are subscribed to Jaunty.

Status in “nmap” package in Ubuntu: In Progress
Status in nmap in Ubuntu Jaunty: Fix Released

Bug description:
Description:    Ubuntu jaunty (development branch)
Release:    9.04

Nmap 4.76

nmap threw script engine errors when attempting to probe a local ip: sudo nmap -A <localipaddress>

errors:
SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: '/usr/share/nmap/scripts/skype_v2-version.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:18: UPnP-info.nse is not a file!
stack traceback:
    [C]: in function 'Entry'
    /usr/share/nmap/scripts/script.db:18: in main chunk
    [C]: ?
    [C]: ?

SCRIPT ENGINE: Aborting script scan.

      ___________________________________________________________
  好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/

Revision history for this message
Sebastien Bacher (seb128) wrote :

hi asac, could you have a look to the debdiff there?

Changed in nmap (Ubuntu):
assignee: Jonathan Davies (jpds) → Alexander Sack (asac)
Revision history for this message
Alexander Sack (asac) wrote :

guys, can we really open _new_ bugs for variants not covered by a patch landed for a bug ;)... thanks! anyway, this is ok now and I will check this tomorrow.

Revision history for this message
Kevin Chang (iprefermuffins) wrote :

Ack, that reminds me...I had found a few things I missed and made a new patch, but forgot to submit it. I only tested the first time around with -A, which does --script=default, but --script=all brings up a few more missing file errors. I threw those into nmap.files as well, and checked that it matches the actual full set of nse/lua files in the src, so it should be good now hopefully.

I don't know if the list in nmap.files was ordered in any particular way - it looked fairly random to me, so I took the liberty of sorting the nse and lua files in there...

Revision history for this message
Alexander Sack (asac) wrote :

Thanks Kevin, can you add introductions to reproduce the issues discovered after the initial upload to summary, so i can do some happy testing?

Also, could someone also forward this to debian? maybe even one of the first that had the wildcard install rather than listing all scripts individually. in any case, a debian bug would be good.

Revision history for this message
Kevin Chang (iprefermuffins) wrote :

I'm assuming that by "the initial upload", you mean my first upload? In any case, to summarize -

nmap 4.76-0ubuntu4 (the newest version in the repo):
Running `nmap --script=default localhost` (or `nmap -A localhost`, which does the same level of script scanning) produces the following errors:

SCRIPT ENGINE: '/usr/share/nmap/scripts/dns-test-open-recursion.nse' threw a run time error and could not be loaded.
SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:20: rpcinfo.nse is not a file!
stack traceback:
        [C]: in function 'Entry'
        /usr/share/nmap/scripts/script.db:20: in main chunk
        [C]: ?
        [C]: ?

SCRIPT ENGINE: Aborting script scan.

My first patch:
`nmap --script=default localhost` completes successfully.
`nmap --script=all localhost` produces the following error (which also happens with --script=all on 0ubuntu4):

SCRIPT ENGINE: error while initializing script rules:
/usr/share/nmap/scripts/script.db:6: dns-safe-recursion-port.nse is not a file!
stack traceback:
        [C]: in function 'Entry'
        /usr/share/nmap/scripts/script.db:6: in main chunk
        [C]: ?
        [C]: ?

My second patch resolves this as well.

Does this cover the info you need?

Revision history for this message
Kevin Chang (iprefermuffins) wrote :

Is there anything else I can or should be doing to help this bug along? I don't know if it's still present in Karmic, but it would be nice to get it stamped out there if it is.

tibibo (tibibo)
Changed in nmap (Ubuntu Jaunty):
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Jens Janssen (jayjay) wrote :

Karmic working.

Revision history for this message
Michael Wigle (michaelwigle) wrote :

Confirmed here too. Looks like it's all good now. Big thanks to those who worked on this and got it committed!

Revision history for this message
Derek Simkowiak (ubuntu-cool-st) wrote :

The latest 9.04 package 4.76-0ubuntu4 is still broken.

Can we get a backport? I'm not moving to 9.10 because of all the new bugs it introduced... (I can't use 8.04 LTS because I need some of the newer 9.04 packages.)

Revision history for this message
Dexter72 (cdef72) wrote :

Hello I am new to Linux and nmap and I am getting the same bug as Whoop at the top of the page. I have read through the posts on this page and see the proposed patches but I am not sure how to apply the patches. They are in text format and I am not sure where to apply them. I am using Ubuntu client/desktop. I could use some instructions on how to apply the necessary patch as I need to learn how to use nmap.

A bit confused.

Revision history for this message
Mathias Gug (mathiaz) wrote :

However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - Lucid Lynx.

Changed in nmap (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.