File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
modules/exploits/linux/upnp Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,13 @@ def execute_command(cmd, opts)
104
104
end
105
105
106
106
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 ..." )
108
108
109
109
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" )
111
111
end
112
112
113
- print_status ( "#{ rhost } : #{ rport } - Exploiting..." )
113
+ print_status ( "#{ peer } - Exploiting..." )
114
114
execute_cmdstager (
115
115
:flavor => :echo ,
116
116
:linemax => 950
@@ -128,9 +128,8 @@ def configure_socket
128
128
add_socket ( self . udp_sock )
129
129
end
130
130
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
134
133
135
134
def rhost
136
135
datastore [ 'RHOST' ]
@@ -140,6 +139,10 @@ def rport
140
139
datastore [ 'RPORT' ]
141
140
end
142
141
142
+ def peer
143
+ "#{ rhost } :#{ rport } "
144
+ end
145
+
143
146
# Accessor for our UDP socket
144
147
attr_accessor :udp_sock
145
148
You can’t perform that action at this time.
0 commit comments