Nmap中NSE数据文件分析

1.Nmap中数据文件所在的位置

在Windows操作系统中这些文件都在C:\Program Files\Nmap\NSElib\data文件夹中64位系统稍有不同

在Linux系列操作系统中这些文件在/usr/local/share/Nmap/NSElib/data/usr/share/Nmap/nselib/data


2.暴力穷举时所使用的用户名和密码列表数据文件

很多服务都使用了用户名和密码进行验证。在对服务进行密码强壮度审计的时候需要使用到两个数据文件一个存储了大量的用户名一个存储了大量的密码

usernames.lst中的内容十分简单打开这个文件

在这里插入图片描述

passwords.lst中的内容要丰富一些大概包含了5000多个常见的词汇和字母组合

在这里插入图片描述


3.Web应用审计数据文件

http-fingerprints.lua

这个文件是一个Lua table形式保存的数据文件在这个文件中包含了一些常见Web应用的信息这些信息包括这些应用中关键文件所在的位置

在这里插入图片描述

Nmap允许对http-fingerprints.lua文件进行扩充可以随时将一个新的Web应用文件的信息添加到这个table文件中

如果希望在http-enum脚本执行的时候使用其他的数据文件也可以在执行的时候使用参数--script-args http-enum.fingerprintfile来指定。例如要使用./myfingerprints.txt就可以执行如下命令

Nmap --script http-enum --script-args http-enum.fingerprintfile=./myfingerprints.
txt -p80<target>

http-sql-errors.lst

这个数据文件中包含了一些标识错误的字符串这个数据文件主要被脚本http-sql-injection所使用。用来完成对应用是否能够抵御SQL注入进行检测

在这里插入图片描述

同样也可以使用参数http-sql-injection.errorstrings来改变这个脚本执行时所使用的数据文件

http-web-files-extensions.lst

NSE中的http-spider库文件在对页面进行扫描的过程中就会使用该文件。这个文件中包含了200多个常见的Web应用扩展名也可以很容易地将另外一些Web应用扩展名添加到这个文件中

在这里插入图片描述

http-devframework-fingerprints.lua

这个数据文件由Lua table所构成被脚本http-devframework所调用目的是检测目标Web应用的开发语言例如ASP、PHP等

例如这是一段检测Django框架的Lua代码

Django = { rapidDetect = function(host, port)

    -- Check if the site gives that familiar Django admin login page.
    local response = http.get(host, port, "/admin/")

    if response.body then
      if string.find(response.body, "Log in | Django site admin") or
        string.find(response.body, "this_is_the_login_form") or
        string.find(response.body, "csrfmiddlewaretoken") then
        return "Django detected. Found Django admin login page on /admin/"
      end
    end

    -- In Django, the cookie sessionid is being set when you log in
    -- and forms will probably set a cookie called csrftoken.
    if response.cookies then
      for _, c in pairs(response.cookies) do
        if c.name == "csrftoken" then
          return "Django detected. Found sessionid cookie which means the contrib.auth package for authentication is enabled."
        elseif c.name == "sessionid" then
          return "Django detected. Found csrftoken cookie."
        end
      end
    end

    -- See if DEBUG mode still happens to be true.
    response = http.get(host, port, "/random404page/")

    if response.body then
      if string.find(response.body, "<code>DEBUG = True</code>") then
        return "Django detected. Found Django error page on /random404page/"
      end
    end

  end,

  consumingDetect = function(page, path)
    if page then
      if string.find(page, "csrfmiddlewaretoken") then
        return "Django detected. Found csrfmiddlewaretoken on " .. path
      end
      if string.find(page, "id=\"id_") then
        return "Django detected. Found id_ preffix in id attribute name on " .. path
      end
      if string.find(page, "%-TOTAL%-FORMS") or string.find(page, "%-DELETE") then
        return "Django detected. Found -TOTAL-FORMS and -DELETE hidden inputs, which means there is a Django formset on " .. path
      end
    end
  end
},

http-folders.txt

这个数据文件中包含了956个HTTP中常见的目录名被脚本http-iis-webdav-vuln所调用用来检测IIS 5.1/6.0类型服务器上的漏洞

在这里插入图片描述

如果不想使用这个数据文件也可以使用参数--script-args folderdb来指定其他的数据文件例如使用/pentest/fuzzers/folders.txt作为这个目录

--script-args folderdb=/pentest/fuzzers/folders.txt <target>

vhosts-default.lst

脚本http-vhosts就是用这个数据文件来判断目标服务器到底是一个虚拟机还是一个真正的Web服务器

在这里插入图片描述

wp-plugins.lst

这个文件中包含了18575个常见的WordPress插件的名称脚本http-wordpress-plugins就是利用这个文件来对采用WordPress建站的服务器进行暴力穷举攻击

如果http-wordpress-plugins脚本中不特殊指定--script-args http-wordpress-plugins.search这个脚本只会读取前100个插件名

在这里插入图片描述


4.DBMS-auditing数据文件

mysql-cis.audit

这个文件位于Nmap的安装目录中主要根据CIS MySQL v1.0.2 benchmark来检测MySQL数据库的配置安全性。NSE中有一个mysql-audit脚本就是使用了这个文件

在这里插入图片描述

oracle-default-accounts.lst

这个文件中包含了687个Oracle数据库中用来验证的用户名

在这里插入图片描述

oracle-sids

文件oracle-sids包含了700个常见的Oracle数据库实例名

在这里插入图片描述

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6