From 1bf6a7cadced5a102d9c5cfd0803f5fb771716bd Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Tue, 3 Nov 2009 16:49:19 +0000 Subject: [PATCH] Adapted sqlmap to latest changes in Metasploit trunk --- plugins/generic/takeover.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/generic/takeover.py b/plugins/generic/takeover.py index fe840bfae..069a30d41 100644 --- a/plugins/generic/takeover.py +++ b/plugins/generic/takeover.py @@ -305,14 +305,13 @@ class Takeover(Abstraction, Metasploit, Registry): self.initEnv() self.getRemoteTempPath() - goUdf = False - condition = ( kb.dbms == "MySQL" or kb.dbms == "PostgreSQL" ) + goUdf = False - if condition is True: + if kb.dbms == "MySQL": msg = "how do you want to execute the Metasploit shellcode " msg += "on the back-end database underlying operating system?" - msg += "\n[1] Stand-alone payload stager (file system way, default)" - msg += "\n[2] Via UDF 'sys_bineval' (in-memory way, anti-forensics)" + msg += "\n[1] Via UDF 'sys_bineval' (in-memory way, anti-forensics, default)" + msg += "\n[2] Stand-alone payload stager (file system way)" while True: choice = readInput(msg, default=1) @@ -328,9 +327,12 @@ class Takeover(Abstraction, Metasploit, Registry): warnMsg = "invalid value, valid values are 1 and 2" logger.warn(warnMsg) - if choice == 2: + if choice == 1: goUdf = True + elif kb.dbms == "PostgreSQL": + goUdf = True + if goUdf is True: self.createMsfShellcode(exitfunc="thread", format="raw", extra="BufferRegister=EAX", encode="x86/alpha_mixed") else: