metasploit-framework/modules/encoders/x86
sinn3r a543d957d4 Fix #4717 - Change AllowWin32SEH's default to false
This is patch to change AllowWin32SEH to false.

Root cause:

The truely intended behavior is that if the user doesn't set a
BufferRegister and the encoder is for Windows, the AllowWin32SEH
code should kick in.

The problem here is that msfencode and msfvenom handle the platform
information differently, so we get different results.

With msfencode, the platform information isn't passed when alpha_mixed
is used, so even if you're using the encoder for Win32, the encoder
doesn't actually know about this. But everything works out just fine
anyway because people don't actually rely on AllowWin32SEH.

With msfvenom, the platform information is passed, so the encoder
actually knows it's for Windows. The two conditions are met (regster
and platform), so AllowWin32SEH kicks in. However, the AllowWin32SEH
technique enforces the BufferRegister to ECX, and that there's no
GetPC, so by default this isn't going to work.

The solution:

We are actually better off with setting AllowWin32SEH to false, mainly
because the SEH technique is pretty much dead (congrats MSFT!). And we
want the GetPC routine by default.

If people want to use AllowWin32SEH routine, they can simply set
AllowWin32SEH to true to bring it right back. For example:

e = framework.encoders.create('x86/alpha_mixed')
e.datastore.import_options_from_hash({'AllowWin32SEH'=>true})
buf = e.encode("AAAA", nil, nil, ::Msf::Module::PlatformList.win32)

Or in msfvenom:

msfvenom -p windows/meterpreter/bind_tcp -e x86/alpha_mixed
AllowWin32SEH=true -f raw

Fix #4717
2015-02-06 12:38:04 -06:00
..
add_sub.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
alpha_mixed.rb Fix #4717 - Change AllowWin32SEH's default to false 2015-02-06 12:38:04 -06:00
alpha_upper.rb Fix #4717 - Change AllowWin32SEH's default to false 2015-02-06 12:38:04 -06:00
avoid_underscore_tolower.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
avoid_utf8_tolower.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
bloxor.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
call4_dword_xor.rb Add missing commits from #3770, lands #4393 2014-12-13 17:36:26 -06:00
context_cpuid.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
context_stat.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
context_time.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
countdown.rb Add missing commits from #3770, lands #4393 2014-12-13 17:36:26 -06:00
fnstenv_mov.rb Add missing commits from #3770, lands #4393 2014-12-13 17:36:26 -06:00
jmp_call_additive.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
nonalpha.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
nonupper.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
opt_sub.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
shikata_ga_nai.rb Add missing commits from #3770, lands #4393 2014-12-13 17:36:26 -06:00
single_static_bit.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
unicode_mixed.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00
unicode_upper.rb Fix up comment splats with the correct URI 2014-10-17 11:47:33 -05:00