Metasploit mailing list archives

Re: Dynamically Generated Final Stages


From: Philip Sanderson <philip.k.sanderson () gmail com>
Date: Tue, 31 Aug 2010 17:42:26 +1000

Hello,

http://github.com/philip-k-sanderson/metasploit-posix-meterpreter/blob/d03535944aceb46da04b264feffb02e5473a5c8e/modules/payloads/stages/linux/x86/meterpreter.rb

(used in linux/x86/meterpreter/reverse_tcp. first it does reverse_tcp, then
the middle stager, then finally sends a file to remote host)

<http://github.com/philip-k-sanderson/metasploit-posix-meterpreter/blob/d03535944aceb46da04b264feffb02e5473a5c8e/modules/payloads/stages/linux/x86/meterpreter.rb>generate_stage
to get the final / last stage. handle_intermediate_payload() to send a
payload before final one.

does that answer your question ?

On Fri, Aug 27, 2010 at 8:13 AM, Ty Miller <tyronmiller () gmail com> wrote:

Hey guys,

When writing staged shellcode for metasploit, how do you get the final
stage that was selected by the user (eg, meterpreter or shell or bind, etc)
to be dynamically included within the module or handler?

For example, say that a user selects the payload
"windows/meterpreter/awesome_payload" then the meterpreter stage needs to be
dynamically generated and used by the handler to tunnel it through to the
compromised host (or soon to be compromised host). But if the user selects
the payload "windows/shell/awesome_payload" then the shell stage needs to be
dynamically generated and passed to the compromised host via the handler.

Do I need to use msfpayload within the handler or something?

Thanks,
Ty



_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework


_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework

Current thread: