Class: Metasploit::Framework::LoginScanner::DB2
- Inherits:
-
Object
- Object
- Metasploit::Framework::LoginScanner::DB2
- Includes:
- Base, RexSocket, Tcp::Client
- Defined in:
- lib/metasploit/framework/login_scanner/db2.rb
Overview
This is the LoginScanner class for dealing with DB2 Database servers. It is responsible for taking a single target, and a list of credentials and attempting them. It then saves the results.
Constant Summary collapse
- DEFAULT_PORT =
50000
- DEFAULT_REALM =
'toolsdb'
- LIKELY_PORTS =
[ DEFAULT_PORT ]
- LIKELY_SERVICE_NAMES =
TODO:
XXX
[ ]
- PRIVATE_TYPES =
[ :password ]
- REALM_KEY =
Metasploit::Model::Realm::Key::DB2_DATABASE
Instance Attribute Summary
Attributes included from Tcp::Client
#max_send_size, #send_delay, #sock
Instance Method Summary collapse
Methods included from Tcp::Client
#chost, #connect, #cport, #disconnect, #proxies, #rhost, #rport, #set_tcp_evasions, #ssl, #ssl_version
Instance Method Details
#attempt_login(credential) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/metasploit/framework/login_scanner/db2.rb', line 25 def attempt_login(credential) = { credential: credential } begin probe_data = send_probe(credential.realm) if probe_data.empty? [:status] = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT else if authenticate?(credential) [:status] = Metasploit::Model::Login::Status::SUCCESSFUL else [:status] = Metasploit::Model::Login::Status::INCORRECT end end rescue ::Rex::ConnectionError, ::Rex::Proto::DRDA::RespError, ::Timeout::Error => e .merge!({ status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e, }) end result = ::Metasploit::Framework::LoginScanner::Result.new() result.host = host result.port = port result.protocol = 'tcp' result.service_name = 'db2' result end |