Issue 384: added escape_for_html function to escape PoC data before rendering in ExtJs UI
git-svn-id: https://beef.googlecode.com/svn/trunk@1125 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -55,13 +55,22 @@ class Xssrays < BeEF::Extension::AdminUI::HttpController
|
||||
'id' => log.id,
|
||||
'vector_method' => log.vector_method,
|
||||
'vector_name' => log.vector_name,
|
||||
'vector_poc' => log.vector_poc
|
||||
'vector_poc' => escape_for_html(log.vector_poc)
|
||||
}
|
||||
}
|
||||
|
||||
@body = {'success' => 'true', 'logs' => logs}.to_json
|
||||
end
|
||||
|
||||
def escape_for_html(str)
|
||||
str.gsub!(/</, '<')
|
||||
str.gsub!(/>/, '>')
|
||||
str.gsub!(/\u0022/, '"')
|
||||
str.gsub!(/\u0027/, ''')
|
||||
str.gsub!(/\\/, '\')
|
||||
str
|
||||
end
|
||||
|
||||
# called by the UI. needed to pass the hooked browser ID/session and store a new scan in the DB
|
||||
def set_scan_target
|
||||
hooked_browser = HB.first(:session => @params['hb_id'].to_s)
|
||||
|
||||
Reference in New Issue
Block a user