Home page logo
/

metasploit logo Metasploit mailing list archives

Auto targeting with multi platform payloads
From: Pedro Ribeiro <pedrib () gmail com>
Date: Tue, 24 Jun 2014 18:40:28 +0100

Hi,

I'm building a multi platform exploit which has auto targeting and is able
to identify its Linux and Windows targets. I'm using a global variable to
store the chosen target. With that I set the arch and platform correctly,
and then invoke generate_payload_exe with those parameters.

However when my auto targeting function identifies a Linux target, the
generated payload defaults to the windows meterpreter.

I have a feeling that I have to tell metasploit which target I have ended
up choosing. I have tried to set the "target" variable, but it seems to
have local function scope only. Meaning if I set it in one function, it
resets to automatic in another function.

So I guess the question is - after I've chosen the target via my auto
targeting function, how do I set that as the "real" target (target 1 ,2 or
3,  not 0 / auto) so that metasploit generates the correct platform
payload? Should I be using a global variable, or is there a cleaner way to
do it?

Regards
Pedro
_______________________________________________
https://dev.metasploit.com/mailman/listinfo/framework

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]