Ejemplo n.º 1
0
 def _initVars(self):
     self.lhostStr = None
     self.rhostStr = None
     self.localIP = getLocalIP()
     self.remoteIP = getRemoteIP() or conf.hostname
     self._icmpslave = normalizePath(
         os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe_"))
Ejemplo n.º 2
0
    def _initVars(self):
        self.connectionStr = None
        self.lhostStr = None
        self.rhostStr = None
        self.portStr = None
        self.payloadStr = None
        self.encoderStr = None
        self.payloadConnStr = None
        self.localIP = getLocalIP()
        self.remoteIP = getRemoteIP() or conf.hostname
        self._msfCli = normalizePath(os.path.join(conf.msfPath, "msfcli"))
        self._msfEncode = normalizePath(os.path.join(conf.msfPath,
                                                     "msfencode"))
        self._msfPayload = normalizePath(
            os.path.join(conf.msfPath, "msfpayload"))
        self._msfVenom = normalizePath(os.path.join(conf.msfPath, "msfvenom"))

        if IS_WIN:
            _ = conf.msfPath
            while _:
                if os.path.exists(os.path.join(_, "scripts")):
                    _ = os.path.join(_, "scripts", "setenv.bat")
                    break
                else:
                    old = _
                    _ = normalizePath(os.path.join(_, ".."))
                    if _ == old:
                        break
            self._msfCli = "%s & ruby %s" % (_, self._msfCli)
            self._msfEncode = "ruby %s" % self._msfEncode
            self._msfPayload = "%s & ruby %s" % (_, self._msfPayload)
            self._msfVenom = "%s & ruby %s" % (_, self._msfVenom)

        self._msfPayloadsList = {
            "windows": {
                1: ("Meterpreter (default)", "windows/meterpreter"),
                2: ("Shell", "windows/shell"),
                3: ("VNC", "windows/vncinject"),
            },
            "linux": {
                1: ("Shell (default)", "linux/x86/shell"),
                2: ("Meterpreter (beta)", "linux/x86/meterpreter"),
            }
        }

        self._msfConnectionsList = {
            "windows": {
                1:
                ("Reverse TCP: Connect back from the database host to this machine (default)",
                 "reverse_tcp"),
                2:
                ("Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535",
                 "reverse_tcp_allports"),
                3:
                ("Reverse HTTP: Connect back from the database host to this machine tunnelling traffic over HTTP",
                 "reverse_http"),
                4:
                ("Reverse HTTPS: Connect back from the database host to this machine tunnelling traffic over HTTPS",
                 "reverse_https"),
                5: ("Bind TCP: Listen on the database host for a connection",
                    "bind_tcp"),
            },
            "linux": {
                1:
                ("Reverse TCP: Connect back from the database host to this machine (default)",
                 "reverse_tcp"),
                2: ("Bind TCP: Listen on the database host for a connection",
                    "bind_tcp"),
            }
        }

        self._msfEncodersList = {
            "windows": {
                1: ("No Encoder", "generic/none"),
                2:
                ("Alpha2 Alphanumeric Mixedcase Encoder", "x86/alpha_mixed"),
                3:
                ("Alpha2 Alphanumeric Uppercase Encoder", "x86/alpha_upper"),
                4: ("Avoid UTF8/tolower", "x86/avoid_utf8_tolower"),
                5: ("Call+4 Dword XOR Encoder", "x86/call4_dword_xor"),
                6: ("Single-byte XOR Countdown Encoder", "x86/countdown"),
                7: ("Variable-length Fnstenv/mov Dword XOR Encoder",
                    "x86/fnstenv_mov"),
                8: ("Polymorphic Jump/Call XOR Additive Feedback Encoder",
                    "x86/jmp_call_additive"),
                9: ("Non-Alpha Encoder", "x86/nonalpha"),
                10: ("Non-Upper Encoder", "x86/nonupper"),
                11: ("Polymorphic XOR Additive Feedback Encoder (default)",
                     "x86/shikata_ga_nai"),
                12: ("Alpha2 Alphanumeric Unicode Mixedcase Encoder",
                     "x86/unicode_mixed"),
                13: ("Alpha2 Alphanumeric Unicode Uppercase Encoder",
                     "x86/unicode_upper"),
            }
        }

        self._msfSMBPortsList = {
            "windows": {
                1: ("139/TCP", "139"),
                2: ("445/TCP (default)", "445"),
            }
        }

        self._portData = {
            "bind": "remote port number",
            "reverse": "local port number",
        }
Ejemplo n.º 3
0
    def _initVars(self):
        self.connectionStr = None
        self.lhostStr = None
        self.rhostStr = None
        self.portStr = None
        self.payloadStr = None
        self.encoderStr = None
        self.payloadConnStr = None
        self.localIP = getLocalIP()
        self.remoteIP = getRemoteIP() or conf.hostname
        self._msfCli = normalizePath(os.path.join(conf.msfPath, "msfcli"))
        self._msfConsole = normalizePath(os.path.join(conf.msfPath, "msfconsole"))
        self._msfEncode = normalizePath(os.path.join(conf.msfPath, "msfencode"))
        self._msfPayload = normalizePath(os.path.join(conf.msfPath, "msfpayload"))
        self._msfVenom = normalizePath(os.path.join(conf.msfPath, "msfvenom"))

        if IS_WIN:
            _ = conf.msfPath
            while _:
                if os.path.exists(os.path.join(_, "scripts")):
                    _ = os.path.join(_, "scripts", "setenv.bat")
                    break
                else:
                    old = _
                    _ = normalizePath(os.path.join(_, ".."))
                    if _ == old:
                        break
            self._msfCli = "%s & ruby %s" % (_, self._msfCli)
            self._msfConsole = "%s & ruby %s" % (_, self._msfConsole)
            self._msfEncode = "ruby %s" % self._msfEncode
            self._msfPayload = "%s & ruby %s" % (_, self._msfPayload)
            self._msfVenom = "%s & ruby %s" % (_, self._msfVenom)

        self._msfPayloadsList = {
                                      "windows": {
                                                   1: ("Meterpreter (default)", "windows/meterpreter"),
                                                   2: ("Shell", "windows/shell"),
                                                   3: ("VNC", "windows/vncinject"),
                                                 },
                                      "linux":   {
                                                   1: ("Shell (default)", "linux/x86/shell"),
                                                   2: ("Meterpreter (beta)", "linux/x86/meterpreter"),
                                                 }
                                    }

        self._msfConnectionsList = {
                                      "windows": {
                                                   1: ("Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp"),
                                                   2: ("Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535", "reverse_tcp_allports"),
                                                   3: ("Reverse HTTP: Connect back from the database host to this machine tunnelling traffic over HTTP", "reverse_http"),
                                                   4: ("Reverse HTTPS: Connect back from the database host to this machine tunnelling traffic over HTTPS", "reverse_https"),
                                                   5: ("Bind TCP: Listen on the database host for a connection", "bind_tcp"),
                                                 },
                                      "linux":   {
                                                   1: ("Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp"),
                                                   2: ("Bind TCP: Listen on the database host for a connection", "bind_tcp"),
                                                 }
                                    }

        self._msfEncodersList = {
                                      "windows": {
                                                   1: ("No Encoder", "generic/none"),
                                                   2: ("Alpha2 Alphanumeric Mixedcase Encoder", "x86/alpha_mixed"),
                                                   3: ("Alpha2 Alphanumeric Uppercase Encoder", "x86/alpha_upper"),
                                                   4: ("Avoid UTF8/tolower", "x86/avoid_utf8_tolower"),
                                                   5: ("Call+4 Dword XOR Encoder", "x86/call4_dword_xor"),
                                                   6: ("Single-byte XOR Countdown Encoder", "x86/countdown"),
                                                   7: ("Variable-length Fnstenv/mov Dword XOR Encoder", "x86/fnstenv_mov"),
                                                   8: ("Polymorphic Jump/Call XOR Additive Feedback Encoder", "x86/jmp_call_additive"),
                                                   9: ("Non-Alpha Encoder", "x86/nonalpha"),
                                                  10: ("Non-Upper Encoder", "x86/nonupper"),
                                                  11: ("Polymorphic XOR Additive Feedback Encoder (default)", "x86/shikata_ga_nai"),
                                                  12: ("Alpha2 Alphanumeric Unicode Mixedcase Encoder", "x86/unicode_mixed"),
                                                  13: ("Alpha2 Alphanumeric Unicode Uppercase Encoder", "x86/unicode_upper"),
                                                 }
                                    }

        self._msfSMBPortsList = {
                                      "windows": {
                                                   1: ("139/TCP", "139"),
                                                   2: ("445/TCP (default)", "445"),
                                                 }
                                    }

        self._portData = {
                            "bind": "remote port number",
                            "reverse": "local port number",
                          }
Ejemplo n.º 4
0
 def __initVars(self):
     self.lhostStr = None
     self.rhostStr = None
     self.localIP = getLocalIP()
     self.remoteIP = getRemoteIP()
     self.__icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe"))
Ejemplo n.º 5
0
    def __initVars(self):
        self.connectionStr  = None
        self.lhostStr       = None
        self.rhostStr       = None
        self.portStr        = None
        self.payloadStr     = None
        self.encoderStr     = None
        self.payloadConnStr = None
        self.resourceFile   = None
        self.localIP        = getLocalIP()
        self.remoteIP       = getRemoteIP()
        self.__msfCli       = normalizePath(os.path.join(conf.msfPath, "msfcli"))
        self.__msfConsole   = normalizePath(os.path.join(conf.msfPath, "msfconsole"))
        self.__msfEncode    = normalizePath(os.path.join(conf.msfPath, "msfencode"))
        self.__msfPayload   = normalizePath(os.path.join(conf.msfPath, "msfpayload"))

        self.__msfPayloadsList    = {
                                      "windows": {
                                                   1: ( "Meterpreter (default)", "windows/meterpreter" ),
                                                   2: ( "Shell", "windows/shell" ),
                                                   3: ( "VNC", "windows/vncinject" ),
                                                 },
                                      "linux":   {
                                                   1: ( "Shell", "linux/x86/shell" ),
                                                 }
                                    }

        self.__msfConnectionsList = {
                                      "windows": {
                                                   1: ( "Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp" ),
                                                   2: ( "Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535", "reverse_tcp_allports" ),
                                                   3: ( "Bind TCP: Listen on the database host for a connection", "bind_tcp" )
                                                 },
                                      "linux":   {
                                                   1: ( "Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp" ),
                                                   2: ( "Bind TCP: Listen on the database host for a connection", "bind_tcp" ),
                                                 }
                                    }

        self.__msfEncodersList    = {
                                      "windows": {
                                                   1: ( "No Encoder", "generic/none" ),
                                                   2: ( "Alpha2 Alphanumeric Mixedcase Encoder", "x86/alpha_mixed" ),
                                                   3: ( "Alpha2 Alphanumeric Uppercase Encoder", "x86/alpha_upper" ),
                                                   4: ( "Avoid UTF8/tolower", "x86/avoid_utf8_tolower" ),
                                                   5: ( "Call+4 Dword XOR Encoder", "x86/call4_dword_xor" ),
                                                   6: ( "Single-byte XOR Countdown Encoder", "x86/countdown" ),
                                                   7: ( "Variable-length Fnstenv/mov Dword XOR Encoder", "x86/fnstenv_mov" ),
                                                   8: ( "Polymorphic Jump/Call XOR Additive Feedback Encoder", "x86/jmp_call_additive" ),
                                                   9: ( "Non-Alpha Encoder", "x86/nonalpha" ),
                                                  10: ( "Non-Upper Encoder", "x86/nonupper" ),
                                                  11: ( "Polymorphic XOR Additive Feedback Encoder (default)", "x86/shikata_ga_nai" ),
                                                  12: ( "Alpha2 Alphanumeric Unicode Mixedcase Encoder", "x86/unicode_mixed" ),
                                                  13: ( "Alpha2 Alphanumeric Unicode Uppercase Encoder", "x86/unicode_upper" ),
                                                 }
                                    }

        self.__msfSMBPortsList    = {
                                      "windows": {
                                                   1: ( "139/TCP", "139" ),
                                                   2: ( "445/TCP (default)", "445" ),
                                                 }
                                    }

        self.__portData           = {
                                      "bind":    "remote port number",
                                      "reverse": "local port number",
                                    }
Ejemplo n.º 6
0
    def __initVars(self):
        self.connectionStr = None
        self.lhostStr = None
        self.rhostStr = None
        self.portStr = None
        self.payloadStr = None
        self.encoderStr = None
        self.payloadConnStr = None
        self.resourceFile = None
        self.localIP = getLocalIP()
        self.remoteIP = getRemoteIP()
        self.__msfCli = normalizePath(os.path.join(conf.msfPath, "msfcli"))
        self.__msfConsole = normalizePath(
            os.path.join(conf.msfPath, "msfconsole"))
        self.__msfEncode = normalizePath(
            os.path.join(conf.msfPath, "msfencode"))
        self.__msfPayload = normalizePath(
            os.path.join(conf.msfPath, "msfpayload"))

        self.__msfPayloadsList = {
            "windows": {
                1: ("Meterpreter (default)", "windows/meterpreter"),
                2: ("Shell", "windows/shell"),
                3: ("VNC", "windows/vncinject"),
            },
            "linux": {
                1: ("Shell", "linux/x86/shell"),
            }
        }

        self.__msfConnectionsList = {
            "windows": {
                1:
                ("Reverse TCP: Connect back from the database host to this machine (default)",
                 "reverse_tcp"),
                2:
                ("Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535",
                 "reverse_tcp_allports"),
                3: ("Bind TCP: Listen on the database host for a connection",
                    "bind_tcp")
            },
            "linux": {
                1:
                ("Reverse TCP: Connect back from the database host to this machine (default)",
                 "reverse_tcp"),
                2: ("Bind TCP: Listen on the database host for a connection",
                    "bind_tcp"),
            }
        }

        self.__msfEncodersList = {
            "windows": {
                1: ("No Encoder", "generic/none"),
                2:
                ("Alpha2 Alphanumeric Mixedcase Encoder", "x86/alpha_mixed"),
                3:
                ("Alpha2 Alphanumeric Uppercase Encoder", "x86/alpha_upper"),
                4: ("Avoid UTF8/tolower", "x86/avoid_utf8_tolower"),
                5: ("Call+4 Dword XOR Encoder", "x86/call4_dword_xor"),
                6: ("Single-byte XOR Countdown Encoder", "x86/countdown"),
                7: ("Variable-length Fnstenv/mov Dword XOR Encoder",
                    "x86/fnstenv_mov"),
                8: ("Polymorphic Jump/Call XOR Additive Feedback Encoder",
                    "x86/jmp_call_additive"),
                9: ("Non-Alpha Encoder", "x86/nonalpha"),
                10: ("Non-Upper Encoder", "x86/nonupper"),
                11: ("Polymorphic XOR Additive Feedback Encoder (default)",
                     "x86/shikata_ga_nai"),
                12: ("Alpha2 Alphanumeric Unicode Mixedcase Encoder",
                     "x86/unicode_mixed"),
                13: ("Alpha2 Alphanumeric Unicode Uppercase Encoder",
                     "x86/unicode_upper"),
            }
        }

        self.__msfSMBPortsList = {
            "windows": {
                1: ("139/TCP", "139"),
                2: ("445/TCP (default)", "445"),
            }
        }

        self.__portData = {
            "bind": "remote port number",
            "reverse": "local port number",
        }