WIP: Adding default pingback payload to parent check method

This commit is contained in:
asoto-r7
2019-05-26 14:47:20 -05:00
committed by Brent Cook
parent 92fa8f4377
commit cb270cd57a
+51
View File
@@ -360,6 +360,57 @@ class Exploit < Msf::Module
#
##
#
# The check method performs a benign attack against the target. Ideally,
# it will be overwritten by the exploit module with a more specific
# vulnerability-specific technique. However, if the module is not over-
# written, let's use the exploit method, alongside a pingback payload,
# to determine if the target is vulnerable.
#
def check
first_target = find_target_supporting_pingback_payload
if first_target
datastore['TARGET'] = first_target
vprint_status "Found a target that supports pingback payloads: #{first_target} (#{targets[first_target].name})"
datastore['PAYLOAD'] = find_pingback_payload_in_target
vprint_status "Configuring a pingback payload: #{self.payload_instance}"
require 'pry'; binding.pry
generate_payload
exploit
else
vprint_error "No targets within this module support pingback payload."
return false
end
end
def find_target_supporting_pingback_payload
k = 0
targets.each do |target|
datastore['TARGET'] = k
first_payload = find_pingback_payload_in_target
if first_payload
return k
else
#vprint_status "#{target.name} does not support pingback payloads"
end
k = k+1
end
return false
end
def find_pingback_payload_in_target
compatible_payloads.each do |payload|
if payload[0].include? 'pingback'
return payload[0]
end
end
return false
end
#
# Kicks off the actual exploit. Prior to this call, the framework will
# have validated the data store using the options associated with this