Class: Metasploit::Framework::LoginScanner::FreeswitchEventSocket
- Inherits:
-
Object
- Object
- Metasploit::Framework::LoginScanner::FreeswitchEventSocket
- Includes:
- Base, RexSocket, Tcp::Client
- Defined in:
- lib/metasploit/framework/login_scanner/freeswitch_event_socket.rb
Overview
This is the LoginScanner class for dealing with FreeSWITCH EventSocket. 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 =
8021
- LIKELY_PORTS =
[ DEFAULT_PORT ]
- LIKELY_SERVICE_NAMES =
[ 'freeswitch' ]
- PRIVATE_TYPES =
[ :password ]
- REALM_KEY =
nil
Instance Attribute Summary
Attributes included from Tcp::Client
#max_send_size, #send_delay, #sock
Instance Method Summary collapse
-
#attempt_login(credential) ⇒ Metasploit::Framework::LoginScanner::Result
This method attempts a single login with a single credential against the target.
Methods included from Tcp::Client
#chost, #connect, #cport, #disconnect, #proxies, #rhost, #rport, #set_tcp_evasions, #ssl, #ssl_version
Instance Method Details
#attempt_login(credential) ⇒ Metasploit::Framework::LoginScanner::Result
This method attempts a single login with a single credential against the target
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 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/metasploit/framework/login_scanner/freeswitch_event_socket.rb', line 27 def attempt_login(credential) = { credential: credential, status: Metasploit::Model::Login::Status::INCORRECT, host: host, port: port, protocol: 'tcp', service_name: 'freeswitch' } disconnect if self.sock begin connect select([sock], nil, nil, 0.4) sock.get_once sock.put("auth #{credential.private}\n\n") /Reply-Text: (?<reply>.*)/ =~ sock.get_once [:proof] = reply # Invalid password - ( -ERR invalid\n\n ) # Valid password - ( +OK accepted\n\n ) if [:proof]&.include?('-ERR invalid') [:status] = Metasploit::Model::Login::Status::INCORRECT elsif [:proof]&.include?('+OK accepted') [:status] = Metasploit::Model::Login::Status::SUCCESSFUL end rescue Rex::ConnectionError, EOFError, Timeout::Error, Errno::EPIPE, Rex::StreamClosedError => e .merge!( proof: e., status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT ) end disconnect if self.sock ::Metasploit::Framework::LoginScanner::Result.new() end |