Remove protocol option

Only tcp is supported for the mixin.
master
Jacob Robles 2019-04-24 14:24:30 -05:00
parent b0498d0991
commit f3a820b475
No known key found for this signature in database
GPG Key ID: 3EC9F18F2B12401C
4 changed files with 2 additions and 18 deletions

View File

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

View File

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

View File

@ -2,6 +2,7 @@
require 'rex/proto/nuuo/client_request'
require 'rex/proto/nuuo/response'
require 'rex/socket'
module Rex
module Proto
@ -17,9 +18,6 @@ class Client
# @!attribute timeout
# @return [Integer] The connect/read timeout
attr_accessor :timeout
# @!attribute protocol
# @return [String] The transport protocol used (tcp/udp)
attr_accessor :protocol
# @!attribute connection
# @return [IO] The connection established through Rex sockets
attr_accessor :connection
@ -46,7 +44,6 @@ class Client
self.host = opts[:host]
self.port = opts[:port] || 5180
self.timeout = opts[:timeout] || 10
self.protocol = opts[:protocol] || 'tcp'
self.context = opts[:context] || {}
self.username = opts[:username]
self.password = opts[:password]
@ -58,11 +55,9 @@ class Client
# Creates a connection through a Rex socket
#
# @return [Rex::Socket::Tcp]
# @raise [RuntimeError] if 'tcp' is not requested
def connect(temp: false)
return connection if connection && !temp
return create_tcp_connection(temp: temp) if protocol == 'tcp'
raise ::RuntimeError, 'Nuuo Client: Unknown transport protocol'
return create_tcp_connection(temp: temp)
end
# Closes the connection

View File

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