Skip to content

Commit 72c0c59

Browse files
committed
Land rapid7#3523, release fixes
I didn't misspell it this time. :)
2 parents a673971 + 6c595f2 commit 72c0c59

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ def execute_command(cmd, opts)
104104
end
105105

106106
def exploit
107-
print_status("#{rhost}:#{rport} - Trying to access the device via UPnP ...")
107+
print_status("#{peer} - Trying to access the device via UPnP ...")
108108

109109
unless check == Exploit::CheckCode::Detected
110-
fail_with(Failure::Unknown, "#{rhost}:#{rport} - Failed to access the vulnerable device")
110+
fail_with(Failure::Unknown, "#{peer} - Failed to access the vulnerable device")
111111
end
112112

113-
print_status("#{rhost}:#{rport} - Exploiting...")
113+
print_status("#{peer} - Exploiting...")
114114
execute_cmdstager(
115115
:flavor => :echo,
116116
:linemax => 950
@@ -128,9 +128,8 @@ def configure_socket
128128
add_socket(self.udp_sock)
129129
end
130130

131-
#
132-
# Required since we aren't using the normal mixins
133-
#
131+
# Need to define our own rhost/rport/peer since we aren't
132+
# using the normal mixins
134133

135134
def rhost
136135
datastore['RHOST']
@@ -140,6 +139,10 @@ def rport
140139
datastore['RPORT']
141140
end
142141

142+
def peer
143+
"#{rhost}:#{rport}"
144+
end
145+
143146
# Accessor for our UDP socket
144147
attr_accessor :udp_sock
145148

0 commit comments

Comments
 (0)