File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -187,9 +187,17 @@ def set_via(opts)
187
187
# exploit instance. Store references from and to the exploit module.
188
188
#
189
189
def set_from_exploit ( m )
190
+ target_host = nil
191
+ unless m . target_host . blank?
192
+ # only propagate the target_host value if it's exactly 1 host
193
+ if ( rw = Rex ::Socket ::RangeWalker . new ( m . target_host ) ) . length == 1
194
+ target_host = rw . next_ip
195
+ end
196
+ end
197
+
190
198
self . via = { 'Exploit' => m . fullname }
191
199
self . via [ 'Payload' ] = ( 'payload/' + m . datastore [ 'PAYLOAD' ] . to_s ) if m . datastore [ 'PAYLOAD' ]
192
- self . target_host = Rex :: Socket . getaddress ( m . target_host ) if ( m . target_host . to_s . strip . length > 0 )
200
+ self . target_host = target_host
193
201
self . target_port = m . target_port if ( m . target_port . to_i != 0 )
194
202
self . workspace = m . workspace
195
203
self . username = m . owner
You can’t perform that action at this time.
0 commit comments