为什么 Nmap 脚本引擎返回错误?

Why is Nmap Scripting Engine returning an error?

每当我尝试 运行 以下 Nmap 命令时: nmap -sA -sV -T5 -O -A -v -Pn --script afp-brute,ajp-brute,backorifice-brute,cassandra-brute,cvs-brute,dns-brute,domcon-brute,dpap-brute,drda-brute,ftp-brute,http-adobe-coldfusion-apsa1301,http-affiliate-id,http-apache-negotiation,http-apache-server-status,http-aspnet-debug,http-auth-finder,http-auth,http-avaya-ipoffice-users,http-awstatstotals-exec,http-axis2-dir-traversal,http-backup-finder,http-barracuda-dir-traversal,http-brute,http-cakephp-version,http-chrono,http-cisco-anyconnect,http-coldfusion-subzero,http-comments-displayer,http-config-backup,http-cors,http-cross-domain-policy,http-csrf,http-date,http-default-accounts,http-devframework,http-dlink-backdoor,http-dombased-xss,http-domino-enum-passwords,http-drupal-enum-users,http-drupal-enum,http-enum,http-errors,http-exif-spider,http-favicon,http-feed,http-fetch,http-fileupload-exploiter,http-form-brute,http-form-fuzzer,http-frontpage-login,http-generator,http-git,http-gitweb-projects-enum,http-google-malware,http-grep,http-headers,http-huawei-hg5xx-vuln,http-icloud-findmyiphone,http-icloud-sendmsg,http-iis-short-name-brute,http-iis-webdav-vuln,http-internal-ip-disclosure,http-joomla-brute,http-litespeed-sourcecode-download,http-ls,http-majordomo2-dir-traversal,http-malware-host,http-mcmp,http-method-tamper,http-methods,http-mobileversion-checker,http-ntlm-info,http-open-proxy,http-open-redirect,http-passwd,http-php-version,http-phpmyadmin-dir-traversal,http-phpself-xss,http-proxy-brute,http-put,http-qnap-nas-info,http-referer-checker,http-rfi-spider,http-robots.txt,http-robtex-reverse-ip,http-robtex-shared-ns,http-server-header,http-shellshock,http-sitemap-generator,http-slowloris-check,http-slowloris,http-sql-injection,http-stored-xss,http-svn-enum,http-svn-info,http-title,http-tplink-dir-traversal,http-trace,http-traceroute,http-unsafe-output-escaping,http-useragent-tester,http-userdir-enum,http-vhosts,http-virustotal,http-vlcstreamer-ls,http-vmware-path-vuln,http-vuln-cve2006-3392,http-vuln-cve2009-3960,http-vuln-cve2010-0738,http-vuln-cve2010-2861,http-vuln-cve2011-3192,http-vuln-cve2011-3368,http-vuln-cve2012-1823,http-vuln-cve2013-0156,http-vuln-cve2013-6786,http-vuln-cve2013-7091,http-vuln-cve2014-2126,http-vuln-cve2014-2127,http-vuln-cve2014-2128,http-vuln-cve2014-2129,http-vuln-cve2014-3704,http-vuln-cve2014-8877,http-vuln-cve2015-1427,http-vuln-cve2015-1635,http-vuln-misfortune-cookie,http-vuln-wnr1000-creds,http-waf-detect,http-waf-fingerprint,http-webdav-scan,http-wordpress-brute,http-wordpress-enum,http-wordpress-users,http-xssed,iax2-brute,imap-brute,informix-brute,ip-forwarding,ip-geolocation-geoplugin,ip-geolocation-ipinfodb,ip-geolocation-map-bing,ip-geolocation-map-google,ip-geolocation-map-kml,ip-geolocation-maxmind,ip-https-discover,ipidseq,ipmi-brute,ipmi-cipher-zero,ipmi-version,ipv6-multicast-mld-list,ipv6-node-info,ipv6-ra-flood,irc-brute,irc-sasl-brute,iscsi-brute,ldap-brute,membase-brute,metasploit-msgrpc-brute,metasploit-xmlrpc-brute,mikrotik-routeros-brute,mmouse-brute,mongodb-brute,ms-sql-brute,mysql-brute,nessus-brute,nessus-xmlrpc-brute,netbus-brute,nexpose-brute,nje-node-brute,nje-pass-brute,nping-brute,omp2-brute,openvas-otp-brute,oracle-brute,oracle-sid-brute,pcanywhere-brute,pgsql-brute,pop3-brute,redis-brute,rexec-brute,rlogin-brute,rpcap-brute,rsync-brute,rtsp-url-brute,sip-brute,smb-brute,smtp-brute,snmp-brute,socks-brute,svn-brute,targets-asn,targets-ipv6-map4to6,targets-ipv6-multicast-echo,targets-ipv6-multicast-invalid-dst,targets-ipv6-multicast-mld,targets-ipv6-multicast-slaac,targets-ipv6-wordlist,targets-sniffer,targets-traceroute,targets-xml,telnet-brute,telnet-encryption,telnet-ntlm-info,traceroute-geolocation,tso-brute,unusual-port,vmauthd-brute,vnc-brute,whois-domain,whois-ip,xmpp-brute, 192.168.1.226

我收到这个错误:

    NSE: failed to initialize the script engine:
   /usr/local/bin/../share/nmap/nse_main.lua:840: assertion failed!
    stack traceback:
        [C]: in function 'assert'
        /usr/local/bin/../share/nmap/nse_main.lua:840: in local     'get_chosen_scripts'
        /usr/local/bin/../share/nmap/nse_main.lua:1271: in main chunk
        [C]: in ?

QUITTING!

为什么会这样?我以前从来没有遇到过任何问题。这是 nmap 的最新版本,也安装了所有的附加功能。我 运行 在 mac osx 上安装它,它是用自制软件安装的。

这次崩溃是由您的脚本列表中的尾随逗号引起的。一个空规则(比如那个 "following" 那个额外的逗号)被解释为一个没有名字的目录,然后被解释为默认的脚本目录。然后,由于一些相同的脚本是按名称和目录选择的,因此没有 2 个脚本具有相同 ID (basename) 的断言失败了。我已经在开发中纠正了这些问题,所以在 Nmap 的下一个版本中寻找它们:

  • r36761:避免将空规则解释为脚本目录中的所有脚本。
  • r36762:澄清一个断言