Nmap maxdb-info NSE Script
This page contains detailed information about how to use the maxdb-info NSE script. For list of all NSE scripts, visit the Nmap NSE Library.
Select: |
---|
Script Overview
Script source code: https://github.com/nmap/nmap/tree/master/scripts/maxdb-info.nse
Script categories: default, version, safe
Target service / protocol: maxdb, tcp
Target network port(s): 7210
List of CVEs: -
Script Description
The maxdb-info.nse script retrieves version and database information from a SAP Max DB database.
Maxdb-info NSE Script Arguments
The maxdb-info.nse script does not have any arguments.
Maxdb-info NSE Script Example Usage
Here's an example of how to use the maxdb-info.nse script:
nmap -p 7210 --script maxdb-info <ip>
Maxdb-info NSE Script Example Output
Here's a sample output from the maxdb-info.nse script:
PORT STATE SERVICE REASON
7210/tcp open maxdb syn-ack
| maxdb-info:
| Version: 7.8.02
| Build: DBMServer 7.8.02 Build 021-121-242-175
| OS: UNIX
| Instroot: /opt/sdb/MaxDB
| Sysname: Linux 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011
| Databases
| instance path version kernel state
| MAXDB /opt/sdb/MaxDB 7.8.02.21 fast running
| MAXDB /opt/sdb/MaxDB 7.8.02.21 quick offline
| MAXDB /opt/sdb/MaxDB 7.8.02.21 slow offline
|_ MAXDB /opt/sdb/MaxDB 7.8.02.21 test offline
Maxdb-info NSE Script Example XML Output
There is no sample XML output for this module. However, by providing the -oX <file>
option, Nmap will produce a XML output and save it in the file.xml
file.
Author
- Patrik Karlsson
References
- https://nmap.org/nsedoc/scripts/maxdb-info.html
- https://github.com/nmap/nmap/tree/master/scripts/maxdb-info.nse
See Also
Visit Nmap NSE Library for more scripts.
The maxdb-info.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.
Failed to send packet to server
Here is a relevant code snippet related to the "Failed to send packet to server" error message:
44: -- @return status true on success, false on failure
45: -- @return data string containing the raw response from the server
46: local function exchPacket(socket, packet)
47: local status, err = socket:send(packet)
48: if ( not(status) ) then
49: stdnse.debug2("Failed to send packet to server")
50: return false, "Failed to send packet to server"
51: end
52:
53: local data
54: status, data= socket:receive()
Failed to send packet to server
Here is a relevant code snippet related to the "Failed to send packet to server" error message:
45: -- @return data string containing the raw response from the server
46: local function exchPacket(socket, packet)
47: local status, err = socket:send(packet)
48: if ( not(status) ) then
49: stdnse.debug2("Failed to send packet to server")
50: return false, "Failed to send packet to server"
51: end
52:
53: local data
54: status, data= socket:receive()
55: if ( not(status) ) then
Failed to read packet from server
Here is a relevant code snippet related to the "Failed to read packet from server" error message:
51: end
52:
53: local data
54: status, data= socket:receive()
55: if ( not(status) ) then
56: stdnse.debug2("Failed to read packet from server")
57: return false, "Failed to read packet from server"
58: end
59: local len = string.unpack("<I2", data)
60:
61: -- make sure we've got it all
Failed to read packet from server
Here is a relevant code snippet related to the "Failed to read packet from server" error message:
52:
53: local data
54: status, data= socket:receive()
55: if ( not(status) ) then
56: stdnse.debug2("Failed to read packet from server")
57: return false, "Failed to read packet from server"
58: end
59: local len = string.unpack("<I2", data)
60:
61: -- make sure we've got it all
62: if ( len ~= #data ) then
Failed to read packet from server
Here is a relevant code snippet related to the "Failed to read packet from server" error message:
61: -- make sure we've got it all
62: if ( len ~= #data ) then
63: local tmp
64: status, tmp = socket:receive_bytes(len - #data)
65: if ( not(status) ) then
66: stdnse.debug2("Failed to read packet from server")
67: return false, "Failed to read packet from server"
68: end
69: data = data .. tmp
70: end
71: return true, data
Failed to read packet from server
Here is a relevant code snippet related to the "Failed to read packet from server" error message:
62: if ( len ~= #data ) then
63: local tmp
64: status, tmp = socket:receive_bytes(len - #data)
65: if ( not(status) ) then
66: stdnse.debug2("Failed to read packet from server")
67: return false, "Failed to read packet from server"
68: end
69: data = data .. tmp
70: end
71: return true, data
72: end
Response to short
Here is a relevant code snippet related to the "Response to short" error message:
79: -- @return data string containing the raw response from the server
80: local function exchCommand(socket, packet)
81: local status, data = exchPacket(socket, packet)
82: if( status ) then
83: if ( #data < 26 ) then
84: return false, "Response to short"
85: end
86: if ( "OK" ~= data:sub(25, 26) ) then
87: return false, "Incorrect response from server (no OK found)"
88: end
89: end
Incorrect response from server (no OK found)
Here is a relevant code snippet related to the "Incorrect response from server (no OK found)" error message:
82: if( status ) then
83: if ( #data < 26 ) then
84: return false, "Response to short"
85: end
86: if ( "OK" ~= data:sub(25, 26) ) then
87: return false, "Incorrect response from server (no OK found)"
88: end
89: end
90: return status, data
91: end
92:
Failed to perform handshake with MaxDB server
Here is a relevant code snippet related to the "Failed to perform handshake with MaxDB server" error message:
140: local status, err = socket:connect(host, port)
141: local data
142:
143: status, data = exchPacket(socket, stdnse.fromhex( handshake))
144: if ( not(status) ) then
145: return fail("Failed to perform handshake with MaxDB server")
146: end
147:
148: status, data = exchPacket(socket, stdnse.fromhex( dbm_version))
149: if ( not(status) ) then
150: return fail("Failed to request version information from server")
Failed to request version information from server
Here is a relevant code snippet related to the "Failed to request version information from server" error message:
145: return fail("Failed to perform handshake with MaxDB server")
146: end
147:
148: status, data = exchPacket(socket, stdnse.fromhex( dbm_version))
149: if ( not(status) ) then
150: return fail("Failed to request version information from server")
151: end
152:
153: local version_info = parseVersion(data)
154: if ( not(version_info) ) then
155: return fail("Failed to parse version information from server")
Failed to parse version information from server
Here is a relevant code snippet related to the "Failed to parse version information from server" error message:
150: return fail("Failed to request version information from server")
151: end
152:
153: local version_info = parseVersion(data)
154: if ( not(version_info) ) then
155: return fail("Failed to parse version information from server")
156: end
157:
158: local result, filter = {}, {"Version", "Build", "OS", "Instroot", "Sysname"}
159: for _, f in ipairs(filter) do
160: table.insert(result, ("%s: %s"):format(f, version_info[f:upper()]))
Failed to request version information from server
Here is a relevant code snippet related to the "Failed to request version information from server" error message:
161: end
162:
163: status, data = exchCommand(socket, stdnse.fromhex( db_enum))
164: socket:close()
165: if ( not(status) ) then
166: return fail("Failed to request version information from server")
167: end
168: local dbs = parseDatabases(data)
169: table.insert(result, { name = "Databases", dbs } )
170:
171: -- set the version information
Version
This page has been created based on Nmap version 7.92.
Go back to menu.