mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-23 12:18:04 +00:00
enable post requests + fix encoding bug
This commit is contained in:
@@ -53,11 +53,11 @@ class GoalMessageHost < StringGenerator
|
||||
when '--recipient'
|
||||
self.recipient = arg
|
||||
when '--message_header'
|
||||
self.message_header = arg
|
||||
self.message_header = arg.force_encoding('UTF-8')
|
||||
when '--message_subtext'
|
||||
self.message_subtext = arg
|
||||
self.message_subtext = arg.force_encoding('UTF-8')
|
||||
when '--mappings'
|
||||
self.mappings << arg
|
||||
self.mappings << arg.force_encoding('UTF-8')
|
||||
when '--mapping_type'
|
||||
self.mapping_type = arg
|
||||
end
|
||||
|
||||
@@ -56,9 +56,9 @@ class GoalMessageMap < StringGenerator
|
||||
when '--recipient'
|
||||
self.recipient = arg
|
||||
when '--message_header'
|
||||
self.message_header = arg
|
||||
self.message_header = arg.force_encoding('UTF-8')
|
||||
when '--message_subtext'
|
||||
self.message_subtext = arg
|
||||
self.message_subtext = arg.force_encoding('UTF-8')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,10 +16,6 @@ class WebActioner < AlertActioner
|
||||
end
|
||||
|
||||
def perform_action
|
||||
Print.info "WebActioner disabled for testing - uncomment me when pushed to Hacktivity (web_actioner.rb:19)"
|
||||
end
|
||||
|
||||
def perform_actions
|
||||
Print.info "Running WebActioner", logger
|
||||
# uri = URI.parse("http://www.google.com")
|
||||
uri = URI.parse(self.target_host)
|
||||
@@ -43,9 +39,9 @@ class WebActioner < AlertActioner
|
||||
|
||||
Print.info " Request Data: \n", logger
|
||||
Print.info(request.body, logger)
|
||||
# response = http.request(request)
|
||||
# Print.info " Response: \n", logger
|
||||
# Print.info(response, logger)
|
||||
response = http.request(request)
|
||||
Print.info " Response: \n", logger
|
||||
Print.info(response, logger)
|
||||
when 'PUT'
|
||||
# TODO: later
|
||||
response = ''
|
||||
@@ -55,8 +51,7 @@ class WebActioner < AlertActioner
|
||||
else
|
||||
response = Net::HTTP.get_response(uri)
|
||||
end
|
||||
# Print.info response.body.to_s, logger
|
||||
Print.warn("TODO: uncomment web_actioner.rb when merging", logger) # TODO: uncomment web_actioner.rb when merging
|
||||
Print.info response.body.to_s, logger
|
||||
Print.info "Web Action complete #{alertactioner_name}", logger
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user