rolling back

git-svn-id: https://beef.googlecode.com/svn/trunk@968 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
wade@bindshell.net
2011-05-12 02:10:01 +00:00
parent 129a9caff6
commit 27c32f9d28
6 changed files with 4 additions and 87 deletions

View File

@@ -22,9 +22,6 @@ require 'term/ansicolor'
# Include the filters
require 'core/filters'
# Include the filters
require 'core/renderers'
# Include our patches for ruby and gems
require 'core/ruby'

View File

@@ -1,11 +0,0 @@
module BeEF
module Renderers
end
end
# Include the filters
require 'core/renderers/html'
require 'core/renderers/html/basic'

View File

@@ -1,20 +0,0 @@
module BeEF
module Renderers
module HTML
#fires the HTML render function, attempting to match the appropriate data type
def self.render(cat, type, data)
kclass = self.const_get(cat.capitalize)
if kclass
if kclass.respond_to?(type.downcase)
return kclass.send type.downcase.to_sym, data
else
return kclass.send :string, data
end
end
return data.to_s
end
end
end
end

View File

@@ -1,40 +0,0 @@
module BeEF
module Renderers
module HTML
module Basic
#renders basic string
def self.string(d)
return '<p>'+d.to_s+'</p>'
end
#renders list of strings from an array
def self.array(d)
if d.kind_of?(Array)
html = '<ul>'
d.each{|v|
html += "<li>#{v.to_s}</li>"
}
return html+'</ul>'
end
print_debug "BeEF::Renderers::HTML::Basic.array encountered a non-array data type"
return self.string(d)
end
#renders list of strings from a hash with key values
def self.hash(d)
if d.kind_of?(Hash)
html = '<ul>'
d.each{|k,v|
html += "<li><b>#{k.to_s}</b>: #{v.to_s}</li>"
}
return html+'</ul>'
end
print_debug "BeEF::Renderers::HTML::Basic.hash encountered a non-hash data type"
return self.string(d)
end
end
end
end
end

View File

@@ -513,16 +513,8 @@ class Modules < BeEF::Extension::AdminUI::HttpController
resultsdb = BeEF::Core::Models::Result.all(:command_id => command_id)
raise WEBrick::HTTPStatus::BadRequest, "Command id result is nil" if resultsdb.nil?
resultsdb.each{ |result|
begin
r = JSON.parse(result.data)
results.push({'date' => result.date, 'data' => BeEF::Renderers::HTML.render('basic', r['type'], r['data'])})
rescue JSON::ParserError => e
print_debug "Invalid JSON on command_id: #{command_id}"
print_error "Unable to JSON parse result set from database"
end
}
resultsdb.each{ |result| results.push({'date' => result.date, 'data' => JSON.parse(result.data)}) }
@body = {
'success' => 'true',
'command_module_name' => command_module.name,

View File

@@ -243,7 +243,7 @@ function genExisingExploitPanel(panel, command_id, zombie, sb) {
sortable: false,
renderer: function(value, p, record) {
html = String.format("<div style='color:#385F95;text-align:right;'>{0}</div>", value);
/*html += '<p>';
html += '<p>';
for(index in record.data.data) {
result = record.data.data[index];
@@ -252,8 +252,7 @@ function genExisingExploitPanel(panel, command_id, zombie, sb) {
html += String.format('<b>{0}</b>: {1}<br>', index, result);
}
html += '</p>';*/
html += record.data.data;
html += '</p>';
return html;
}
}]