Class: Msf::Exploit::Remote::SMB::Relay::Kerberos::RelayServer::KerberosSMBRelayServer
- Inherits:
-
Object
- Object
- Msf::Exploit::Remote::SMB::Relay::Kerberos::RelayServer::KerberosSMBRelayServer
- Includes:
- Rex::Proto
- Defined in:
- lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb
Overview
Service-manager wrapper that owns the listening socket and the Kerberos relay Server. Mirrors Msf::Exploit::Remote::SMB::RelayServer::SMBRelayServer.
Instance Attribute Summary collapse
-
#listener_sock ⇒ Object
Returns the value of attribute listener_sock.
-
#listener_thread ⇒ Object
Returns the value of attribute listener_thread.
Class Method Summary collapse
-
.hardcore_alias(*args) ⇒ Object
Returns the hardcore alias for the SMB service.
- .sock_options_for(options) ⇒ Object
Instance Method Summary collapse
- #alias ⇒ Object
-
#initialize(options) ⇒ KerberosSMBRelayServer
constructor
A new instance of KerberosSMBRelayServer.
- #start ⇒ Object
- #stop ⇒ Object
-
#wait ⇒ Object
This method waits on the server listener thread.
Constructor Details
#initialize(options) ⇒ KerberosSMBRelayServer
Returns a new instance of KerberosSMBRelayServer.
45 46 47 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 45 def initialize() @options = end |
Instance Attribute Details
#listener_sock ⇒ Object
Returns the value of attribute listener_sock.
95 96 97 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 95 def listener_sock @listener_sock end |
#listener_thread ⇒ Object
Returns the value of attribute listener_thread.
95 96 97 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 95 def listener_thread @listener_thread end |
Class Method Details
.hardcore_alias(*args) ⇒ Object
Returns the hardcore alias for the SMB service
56 57 58 59 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 56 def self.hardcore_alias(*args) = (*args) "#{['LocalHost']}#{['LocalPort']}" end |
.sock_options_for(options) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 97 def self.() { 'LocalHost' => '0.0.0.0', 'LocalPort' => 445 }.merge([:socket]) end |
Instance Method Details
#alias ⇒ Object
49 50 51 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 49 def alias super || 'SMB Kerberos Relay Server' end |
#start ⇒ Object
61 62 63 64 65 66 67 68 69 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 61 def start @listener_sock = Rex::Socket::TcpServer.create() @listener_server = Msf::Exploit::Remote::SMB::Relay::Kerberos::Server.new(**(@listener_sock)) @listener_thread = Rex::ThreadFactory.spawn('SMBKerberosRelayServerListener', false) do @listener_server.run rescue StandardError => e elog(e) end end |
#stop ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 71 def stop begin @listener_server.close if @listener_server && !@listener_server.closed? @listener_thread.kill if @listener_thread rescue StandardError => e print_error('Failed closing SMB Kerberos relay server') elog('Failed closing SMB Kerberos relay server', error: e) end begin @listener_sock.close if @listener_sock && !@listener_sock.closed? rescue StandardError => e print_error('Failed closing SMB Kerberos relay server socket') elog('Failed closing SMB Kerberos relay server socket', error: e) end end |
#wait ⇒ Object
This method waits on the server listener thread
91 92 93 |
# File 'lib/msf/core/exploit/remote/smb/relay/kerberos/relay_server.rb', line 91 def wait @listener_thread.join if @listener_thread end |