Browse Source

Remove protocol option

Only tcp is supported for the mixin.
Jacob Robles 1 month ago
parent
commit
f3a820b475
No account linked to committer's email address

+ 0
- 1
lib/msf/core/exploit/nuuo.rb View File

@@ -1,4 +1,3 @@
1
-require 'msf/core/exploit/tcp'
2 1
 require 'rex/proto/nuuo'
3 2
 
4 3
 ###

+ 0
- 2
lib/rex/proto/nuuo.rb View File

@@ -1,8 +1,6 @@
1 1
 # -*- coding: binary -*-
2 2
 
3 3
 # NUUO implementation
4
-
5
-#require 'rex/socket'
6 4
 require 'rex/proto/nuuo/client'
7 5
 require 'rex/proto/nuuo/client_request'
8 6
 require 'rex/proto/nuuo/constants'

+ 2
- 7
lib/rex/proto/nuuo/client.rb View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 require 'rex/proto/nuuo/client_request'
4 4
 require 'rex/proto/nuuo/response'
5
+require 'rex/socket'
5 6
 
6 7
 module Rex
7 8
 module Proto
@@ -17,9 +18,6 @@ class Client
17 18
   # @!attribute timeout
18 19
   #   @return [Integer] The connect/read timeout
19 20
   attr_accessor :timeout
20
-  # @!attribute protocol
21
-  #   @return [String] The transport protocol used (tcp/udp)
22
-  attr_accessor :protocol
23 21
   # @!attribute connection
24 22
   #   @return [IO] The connection established through Rex sockets
25 23
   attr_accessor :connection
@@ -46,7 +44,6 @@ class Client
46 44
     self.host         = opts[:host]
47 45
     self.port         = opts[:port] || 5180
48 46
     self.timeout      = opts[:timeout] || 10
49
-    self.protocol     = opts[:protocol] || 'tcp'
50 47
     self.context      = opts[:context] || {}
51 48
     self.username     = opts[:username]
52 49
     self.password     = opts[:password]
@@ -58,11 +55,9 @@ class Client
58 55
   # Creates a connection through a Rex socket
59 56
   #
60 57
   # @return [Rex::Socket::Tcp]
61
-  # @raise [RuntimeError] if 'tcp' is not requested
62 58
   def connect(temp: false)
63 59
     return connection if connection && !temp
64
-    return create_tcp_connection(temp: temp) if protocol == 'tcp'
65
-    raise ::RuntimeError, 'Nuuo Client: Unknown transport protocol'
60
+    return create_tcp_connection(temp: temp)
66 61
   end
67 62
 
68 63
   # Closes the connection

+ 0
- 8
spec/lib/rex/proto/nuuo/client_spec.rb View File

@@ -16,14 +16,6 @@ RSpec.describe Rex::Proto::Nuuo::Client do
16 16
   let(:client_password) {nil}
17 17
 
18 18
   describe '#connect' do
19
-    context 'given udp option when created' do
20
-      let(:protocol) {'udp'}
21
-
22
-      it 'raises an error' do
23
-        expect{client.connect}.to raise_error(::RuntimeError)
24
-      end
25
-    end
26
-
27 19
     context 'given temp is false' do
28 20
       context 'when there is no connection' do
29 21
         it 'returns a tcp connection' do

Loading…
Cancel
Save