Merge branch 'feature/mqtt' into feature/mqtt-login

MS-2855/keylogger-mettle-extension
Jon Hart 2017-12-20 13:42:16 -08:00
commit 7723933fa9
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
2 changed files with 6 additions and 7 deletions

View File

@ -5,8 +5,6 @@ require 'rex/proto/mqtt'
module Msf
module Auxiliary::MQTT
include Exploit::Remote::Tcp
def initialize(info = {})
super
@ -25,7 +23,7 @@ module Msf
]
)
register_autofilter_ports([Rex::Proto::MQTT::DEFAULT_PORT])
register_autofilter_ports([Rex::Proto::MQTT::DEFAULT_PORT, Rex::Proto::MQTT::DEFAULT_PORT])
end
def setup
@ -44,9 +42,10 @@ module Msf
datastore['CLIENT_ID'] || Rex::Text.rand_text_alpha(1 + rand(10))
end
# creates a new mqtt client for use against the connected socket
def mqtt_client
client_opts = {
client_id: client_id().to_s,
client_id: client_id.to_s,
username: datastore['USERNAME'],
password: datastore['PASSWORD'],
read_timeout: read_timeout
@ -59,11 +58,11 @@ module Msf
end
def mqtt_connect?(client)
mqtt_connect(client).return_code == 0
client.connect?
end
def mqtt_disconnect(client)
client.disconnect
end
end
end
end

View File

@ -29,7 +29,7 @@ module Rex
end
def connect?
connect.return_code == 0
connect.return_code.zero?
end
def disconnect