1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-14 19:59:02 +00:00

-Adds digest support to basic login method.

-Adds detection entry for Digital Sprite 2 ( Digital recorder )

Originally committed by paulino but recommitted by david after recovery
from backup.
This commit is contained in:
david
2013-04-12 17:29:26 +00:00
parent f43f163ec2
commit a58e6d0f33

View File

@@ -23,10 +23,11 @@ local url = require "url"
-- @param path Path to request -- @param path Path to request
-- @param user Username for Basic Auth -- @param user Username for Basic Auth
-- @param pass Password for Basic Auth -- @param pass Password for Basic Auth
-- @param digest_auth Digest Authentication
-- @return True if login in was successful -- @return True if login in was successful
--- ---
local function try_http_basic_login(host, port, path, user, pass) local function try_http_basic_login(host, port, path, user, pass, digest_auth)
local credentials = {username = user, password = pass} local credentials = {username = user, password = pass, digest = digest_auth}
local req = http.get(host, port, path, {no_cache=true, auth=credentials, redirect_ok = false}) local req = http.get(host, port, path, {no_cache=true, auth=credentials, redirect_ok = false})
if req.status ~= 401 and req.status ~= 403 then if req.status ~= 401 and req.status ~= 403 then
return true return true
@@ -92,7 +93,7 @@ table.insert(fingerprints, {
{username = "j2deployer", password = "j2deployer"} {username = "j2deployer", password = "j2deployer"}
}, },
login_check = function (host, port, path, user, pass) login_check = function (host, port, path, user, pass)
return try_http_basic_login(host, port, path, user, pass) return try_http_basic_login(host, port, path, user, pass, false)
end end
}) })
@@ -140,8 +141,24 @@ table.insert(fingerprints, {
{username = "cisco", password = "cisco"} {username = "cisco", password = "cisco"}
}, },
login_check = function (host, port, path, user, pass) login_check = function (host, port, path, user, pass)
return try_http_basic_login(host, port, path, user, pass) return try_http_basic_login(host, port, path, user, pass, false)
end end
}) })
---
--Digital recorders
---
table.insert(fingerprints, {
name = "Digital Sprite 2",
category = "security",
paths = {
{path = "/frmpages/index.html"}
},
login_combos = {
{username = "dm", password = "web"}
},
login_check = function (host, port, path, user, pass)
return try_http_basic_login(host, port, path, user, pass, true)
end
})