diff --git a/data/templates/service.exe b/data/templates/service.exe index 5e59846f18..0db7377164 100755 Binary files a/data/templates/service.exe and b/data/templates/service.exe differ diff --git a/lib/msf/util/exe.rb b/lib/msf/util/exe.rb index 1866b82840..c305beb3d1 100644 --- a/lib/msf/util/exe.rb +++ b/lib/msf/util/exe.rb @@ -335,7 +335,7 @@ require 'metasm' bo = pe.index('PAYLOAD:') raise RuntimeError, "Invalid Win32 PE Service EXE template!" if not bo - pe[bo, code.length] = code + pe[bo, 8192] = [code].pack("a8192") bo = pe.index('SERVICENAME') raise RuntimeError, "Invalid Win32 PE Service EXE template!" if not bo @@ -1307,3 +1307,4 @@ require 'metasm' end end end +