Skip to content

Commit 741d08f

Browse files
committed
Style cleanup
1 parent ac1daaf commit 741d08f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/msf/core/auxiliary/mqtt.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
module Msf
77
module Auxiliary::MQTT
8-
include Exploit::Remote::Tcp
9-
108
def initialize(info = {})
119
super
1210

@@ -25,7 +23,7 @@ def initialize(info = {})
2523
]
2624
)
2725

28-
register_autofilter_ports([Rex::Proto::MQTT::DEFAULT_PORT])
26+
register_autofilter_ports([Rex::Proto::MQTT::DEFAULT_PORT, Rex::Proto::MQTT::DEFAULT_PORT])
2927
end
3028

3129
def setup
@@ -44,9 +42,10 @@ def client_id
4442
datastore['CLIENT_ID'] || Rex::Text.rand_text_alpha(1 + rand(10))
4543
end
4644

45+
# creates a new mqtt client for use against the connected socket
4746
def mqtt_client
4847
client_opts = {
49-
client_id: client_id().to_s,
48+
client_id: client_id.to_s,
5049
username: datastore['USERNAME'],
5150
password: datastore['PASSWORD'],
5251
read_timeout: read_timeout
@@ -59,7 +58,7 @@ def mqtt_connect(client)
5958
end
6059

6160
def mqtt_connect?(client)
62-
mqtt_connect(client).return_code == 0
61+
client.connect?
6362
end
6463

6564
def mqtt_disconnect(client)

lib/rex/proto/mqtt/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def connect
2929
end
3030

3131
def connect?
32-
connect.return_code == 0
32+
connect.return_code.zero?
3333
end
3434

3535
def disconnect

0 commit comments

Comments
 (0)