metasploit-framework/external/source/shellcode/windows
Raphael Mudge 788c96566f Allow HTTP stager to work with authenticated proxies
The HttpOpenRequest function from WinINet requires the
INTERNET_FLAG_KEEP_CONNECTION flag to communicate through an
authenticated proxy.

From MSDN ( http://tinyurl.com/chwt86j ):

"Uses keep-alive semantics, if available, for the connection. This
 flag is required for Microsoft Network (MSN), NT LAN Manager (NTLM),
 and other types of authentication."

Without this flag, the HTTP stager will fail when faced with a proxy
that requires authentication. The Windows HTTPS stager does not have
this problem.

For HTTP Meterpreter to communicate through an authenticated proxy a
separate patch will need to be made to the Meterpreter source code.
This is at line 1125 of source/common/core.c in the Meterpreter source
code.

My motivation for this request is for windows/dllinject/reverse_http
to download a DLL even when faced with an authenticated proxy. These
changes accomplish this.

Test environment:

I staged a SmoothWall device with the Advanced Proxy Web Add-on. I
enabled Integrated Windows Authentication with a W2K3 DC. I verified
the HTTP stager authenticated to and communicated through the proxy
by watching the proxy access.log
2013-02-24 17:33:00 -05:00
..
msf2 removing them 2009-05-20 17:51:45 +00:00
speech Add Skylined's "You Got Pwned" payload 2011-01-06 17:34:09 +00:00
templates Updated README, include the templates and other src 2008-08-22 18:45:33 +00:00
x64 Add x64 LoadLibraryA payload. Because it should exist. 2012-01-17 21:16:26 -06:00
x86 Allow HTTP stager to work with authenticated proxies 2013-02-24 17:33:00 -05:00
README Updated README, include the templates and other src 2008-08-22 18:45:33 +00:00
build.sh Merge Stephen Fewer's patches to enable support for Windows 7 (fixes support for NT and 2000 as well) 2009-07-05 20:24:37 +00:00
midstager.asm Merge Stephen Fewer's patches to enable support for Windows 7 (fixes support for NT and 2000 as well) 2009-07-05 20:24:37 +00:00
single_adduser.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
single_exec.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
single_shell_bind_tcp.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
single_shell_bind_tcp_xpfw.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
single_shell_reverse_tcp.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stage_shell.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stage_upexec.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stager_bind_ipv6_tcp_nx.asm Merge in the IPv6 Teredo patch. 2010-10-04 11:02:46 +00:00
stager_bind_tcp.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stager_bind_tcp_nx.asm Merge Stephen Fewer's patches to enable support for Windows 7 (fixes support for NT and 2000 as well) 2009-07-05 20:24:37 +00:00
stager_find_tag.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stager_reverse_http.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stager_reverse_ipv6_tcp_nx.asm Copyright updates reflecting the news 2009-10-21 12:58:56 +00:00
stager_reverse_ord_tcp.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stager_reverse_tcp.asm initial import of shellcode source into v3 2007-04-29 20:27:23 +00:00
stager_reverse_tcp_nx.asm Merge Stephen Fewer's patches to enable support for Windows 7 (fixes support for NT and 2000 as well) 2009-07-05 20:24:37 +00:00

README

This directory contains the win32 payload development environment used
for creating the payloads in version 3 of the Metasploit Framework.

The 'nasm' executable must be in your path to use the included build.sh tool.

The included 'build' script automatically creates a number of file types
each time it used to compile a payload. These file types are:

    - Native ELF executable
    - Win32 PE executable
    - Generated C source code
    - Raw opcodes in ".bin" format

The PE executable templates were developed by 'rix' and used with permission.

To use this script, simply run ./build.sh <name of payload>, where the name
does not include the ".asm" suffix. To build win32_stage_api.asm, the 
command line would be "./build.sh win32_stage_api".