1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 17:09:02 +00:00

XML structured output for brute.lua and creds.lua

The @xmloutput section documentation is not done, and I'm not sure how
to best do it, since it will be the same for all brute.lua scripts. This
is how it looks:

metasploit-msgrpc-brute:
<table key="Accounts">
  <table>
    <elem key="username">root</elem>
    <elem key="state">Valid credentials</elem>
    <elem key="password">root</elem>
  </table>
</table>
<elem key="Statistics">Performed 3 guesses in 4 seconds, average tps: 0</elem>

creds-summary:
<table key="127.0.0.1">
  <table key="9929/nping-echo">
    <table>
      <elem key="password">123456</elem>
      <elem key="state">Valid credentials</elem>
    </table>
  </table>
  <table key="55553/unknown">
    <table>
      <elem key="username">root</elem>
      <elem key="state">Valid credentials</elem>
      <elem key="password">root</elem>
    </table>
  </table>
</table>
This commit is contained in:
dmiller
2014-09-23 05:23:19 +00:00
parent aaf7838b10
commit e42409be93
3 changed files with 70 additions and 62 deletions

View File

@@ -32,10 +32,10 @@ categories = {"auth", "default", "safe"}
postrule = function()
local all = creds.Credentials:new(creds.ALL_DATA)
local tab = all:getTable()
if ( tab and #tab > 0 ) then return true end
if ( tab and next(tab) ) then return true end
end
action = function()
local all = creds.Credentials:new(creds.ALL_DATA)
return (all and tostring(all) or nil)
return all:getTable()
end