Example #1
0
    def get_nikto(self):
        """
        Get the path to the Nikto scanner and the configuration file.

        :returns: Nikto scanner and configuration file paths.
        :rtype: tuple(str, str)

        :raises RuntimeError: Nikto scanner of config file not found.
        """

        # Get the path to the Nikto scanner.
        nikto_script = Config.plugin_args["exec"]
        if nikto_script and exists(nikto_script):
            nikto_dir = abspath(split(nikto_script)[0])
        else:
            nikto_dir = join(get_tools_folder(), "nikto")
            nikto_script = join(nikto_dir, "nikto.pl")
            if not nikto_script or not exists(nikto_script):
                nikto_script = find_binary_in_path("nikto")
                if not exists(nikto_script):
                    nikto_script = Config.plugin_args["exec"]
                    msg = "Nikto not found"
                    if nikto_script:
                        msg += ". File: %s" % nikto_script
                    Logger.log_error(msg)
                    raise RuntimeError(msg)

        # Get the path to the configuration file.
        config = Config.plugin_args.get("config", "nikto.conf")
        if not config:
            config = "nikto.conf"
        config = join(nikto_dir, config)
        config = abspath(config)
        if not isfile(config):
            config = Config.plugin_args.get("config", "nikto.conf")
            if not config:
                config = "nikto.conf"
            config = abspath(config)
            if not isfile(config):
                config = "/etc/nikto.conf"
                if not isfile(config):
                    msg = "Nikto config file not found"
                    if config:
                        msg += ". File: %s" % config
                    raise RuntimeError(msg)

        # Return the paths.
        return nikto_script, config
Example #2
0
    def get_nikto(self):
        """
        Get the path to the Nikto scanner and the configuration file.

        :returns: Nikto scanner and configuration file paths.
        :rtype: tuple(str, str)

        :raises RuntimeError: Nikto scanner of config file not found.
        """

        # Get the path to the Nikto scanner.
        nikto_script = Config.plugin_args["exec"]
        if nikto_script and exists(nikto_script):
            nikto_dir = abspath(split(nikto_script)[0])
        else:
            nikto_dir = join(get_tools_folder(), "nikto")
            nikto_script = join(nikto_dir, "nikto.pl")
            if not nikto_script or not exists(nikto_script):
                nikto_script = find_binary_in_path("nikto")
                if not exists(nikto_script):
                    nikto_script = Config.plugin_args["exec"]
                    msg = "Nikto not found"
                    if nikto_script:
                        msg += ". File: %s" % nikto_script
                    Logger.log_error(msg)
                    raise RuntimeError(msg)

        # Get the path to the configuration file.
        config = Config.plugin_args.get("config", "nikto.conf")
        if not config:
            config = "nikto.conf"
        config = join(nikto_dir, config)
        config = abspath(config)
        if not isfile(config):
            config = Config.plugin_args.get("config", "nikto.conf")
            if not config:
                config = "nikto.conf"
            config = abspath(config)
            if not isfile(config):
                config = "/etc/nikto.conf"
                if not isfile(config):
                    msg = "Nikto config file not found"
                    if config:
                        msg += ". File: %s" % config
                    raise RuntimeError(msg)

        # Return the paths.
        return nikto_script, config
Example #3
0
 def check_params(self):
     if not find_binary_in_path("nmap"):
         raise RuntimeError("Nmap not found! You can download it from: http://nmap.org/")
Example #4
0
 def check_params(self):
     if not find_binary_in_path("xsser.py"):
         raise RuntimeError("XSSer not found! You can download it from: "
                            "http://xsser.sourceforge.net/")
Example #5
0
    def check_params(self):

        # Check that SSLScan is installed.
        if not find_binary_in_path("sslscan"):
            if sep == "\\":
                url = "https://code.google.com/p/sslscan-win/"
            else:
                url = "http://sourceforge.net/projects/sslscan/"
            raise RuntimeError(
                "SSLScan not found! You can download it from: %s" % url)

        # SSLScan doesn't support scanning from behind a proxy.
        if Config.audit_config.proxy_addr:
            raise RuntimeError(
                "SSLScan doesn't support scanning from behind a proxy.")

        # Detect sslscan-win bug #2:
        # https://code.google.com/p/sslscan-win/issues/detail?id=2
        if sep == "\\":
            from ctypes import windll, c_char_p, c_uint32, c_void_p, byref, \
                 create_string_buffer, Structure, sizeof, POINTER
            class VS_FIXEDFILEINFO (Structure):
                _fields_ = [
                    ("dwSignature",         c_uint32),     # 0xFEEF04BD
                    ("dwStrucVersion",      c_uint32),
                    ("dwFileVersionMS",     c_uint32),
                    ("dwFileVersionLS",     c_uint32),
                    ("dwProductVersionMS",  c_uint32),
                    ("dwProductVersionLS",  c_uint32),
                    ("dwFileFlagsMask",     c_uint32),
                    ("dwFileFlags",         c_uint32),
                    ("dwFileOS",            c_uint32),
                    ("dwFileType",          c_uint32),
                    ("dwFileSubtype",       c_uint32),
                    ("dwFileDateMS",        c_uint32),
                    ("dwFileDateLS",        c_uint32),
                ]
            def GetFileVersionInfo(lptstrFilename):
                _GetFileVersionInfoA = windll.version.GetFileVersionInfoA
                _GetFileVersionInfoA.argtypes = [
                    c_char_p, c_uint32, c_uint32, c_void_p]
                _GetFileVersionInfoA.restype  = bool
                _GetFileVersionInfoSizeA = \
                    windll.version.GetFileVersionInfoSizeA
                _GetFileVersionInfoSizeA.argtypes = [c_char_p, c_void_p]
                _GetFileVersionInfoSizeA.restype  = c_uint32
                _VerQueryValueA = windll.version.VerQueryValueA
                _VerQueryValueA.argtypes = [
                    c_void_p, c_char_p, c_void_p, POINTER(c_uint32)]
                _VerQueryValueA.restype  = bool
                dwLen = _GetFileVersionInfoSizeA(lptstrFilename, None)
                if dwLen:
                    lpData = create_string_buffer(dwLen)
                    success = _GetFileVersionInfoA(
                        lptstrFilename, 0, dwLen, byref(lpData))
                    if success:
                        lpFileInfo = POINTER(VS_FIXEDFILEINFO)()
                        uLen = c_uint32(sizeof(lpFileInfo))
                        success = _VerQueryValueA(
                            lpData, "\\", byref(lpFileInfo), byref(uLen))
                        if success:
                            sFileInfo = lpFileInfo.contents
                            if sFileInfo.dwSignature == 0xFEEF04BD:
                                return sFileInfo
            def LOWORD(x):
                return x & 0xFFFF
            def HIWORD(x):
                return (x >> 16) & 0xFFFF
            filename = find_binary_in_path("sslscan")[0]
            filename = split(filename)[0]
            filename = join(filename, "libeay32.dll")
            vinfo = GetFileVersionInfo(filename)
            if not vinfo:
                return # skip check if no file version info present
            ms = vinfo.dwFileVersionMS
            ls = vinfo.dwFileVersionLS
            a = HIWORD(ms)
            b = LOWORD(ms)
            c = HIWORD(ls)
            d = LOWORD(ls)
            if not (
                a > 0 or
                b > 9 or
                c > 8 or
                d >= 20
            ):
                raise RuntimeError(
                    "This version of OpenSSL (%s.%s.%s.%s) has a bug on"
                    " Windows that causes a crash when run from GoLismero,"
                    " please replace it with a newer version from: "
                    "https://slproweb.com/products/Win32OpenSSL.html"
                    % (a, b, c, d)
                )
Example #6
0
 def check_params(self):
     if not find_binary_in_path("xsser.py"):
         raise RuntimeError(
             "XSSer not found! You can download it from: "
             "http://xsser.sourceforge.net/")
Example #7
0
 def check_params(self):
     if not find_binary_in_path("sqlmap.py"):
         raise RuntimeError(
             "SQLMap not found!"
             " You can download it from: http://sqlmap.org/")
Example #8
0
 def check_params(self):
     if not find_binary_in_path("sqlmap.py"):
         raise RuntimeError(
             "SQLMap not found!"
             " You can download it from: http://sqlmap.org/")
Example #9
0
 def check_params(self):
     if not find_binary_in_path("nmap"):
         raise RuntimeError(
             "Nmap not found in the PATH environment variable")
Example #10
0
    def check_params(self):

        # Check that SSLScan is installed.
        if not find_binary_in_path("sslscan"):
            if sep == "\\":
                url = "https://code.google.com/p/sslscan-win/"
            else:
                url = "http://sourceforge.net/projects/sslscan/"
            raise RuntimeError(
                "SSLScan not found! You can download it from: %s" % url)

        # SSLScan doesn't support scanning from behind a proxy.
        if Config.audit_config.proxy_addr:
            raise RuntimeError(
                "SSLScan doesn't support scanning from behind a proxy.")

        # Detect sslscan-win bug #2:
        # https://code.google.com/p/sslscan-win/issues/detail?id=2
        if sep == "\\":
            from ctypes import windll, c_char_p, c_uint32, c_void_p, byref, \
                 create_string_buffer, Structure, sizeof, POINTER
            class VS_FIXEDFILEINFO (Structure):
                _fields_ = [
                    ("dwSignature",         c_uint32),     # 0xFEEF04BD
                    ("dwStrucVersion",      c_uint32),
                    ("dwFileVersionMS",     c_uint32),
                    ("dwFileVersionLS",     c_uint32),
                    ("dwProductVersionMS",  c_uint32),
                    ("dwProductVersionLS",  c_uint32),
                    ("dwFileFlagsMask",     c_uint32),
                    ("dwFileFlags",         c_uint32),
                    ("dwFileOS",            c_uint32),
                    ("dwFileType",          c_uint32),
                    ("dwFileSubtype",       c_uint32),
                    ("dwFileDateMS",        c_uint32),
                    ("dwFileDateLS",        c_uint32),
                ]
            def GetFileVersionInfo(lptstrFilename):
                _GetFileVersionInfoA = windll.version.GetFileVersionInfoA
                _GetFileVersionInfoA.argtypes = [
                    c_char_p, c_uint32, c_uint32, c_void_p]
                _GetFileVersionInfoA.restype  = bool
                _GetFileVersionInfoSizeA = \
                    windll.version.GetFileVersionInfoSizeA
                _GetFileVersionInfoSizeA.argtypes = [c_char_p, c_void_p]
                _GetFileVersionInfoSizeA.restype  = c_uint32
                _VerQueryValueA = windll.version.VerQueryValueA
                _VerQueryValueA.argtypes = [
                    c_void_p, c_char_p, c_void_p, POINTER(c_uint32)]
                _VerQueryValueA.restype  = bool
                dwLen = _GetFileVersionInfoSizeA(lptstrFilename, None)
                if dwLen:
                    lpData = create_string_buffer(dwLen)
                    success = _GetFileVersionInfoA(
                        lptstrFilename, 0, dwLen, byref(lpData))
                    if success:
                        lpFileInfo = POINTER(VS_FIXEDFILEINFO)()
                        uLen = c_uint32(sizeof(lpFileInfo))
                        success = _VerQueryValueA(
                            lpData, "\\", byref(lpFileInfo), byref(uLen))
                        if success:
                            sFileInfo = lpFileInfo.contents
                            if sFileInfo.dwSignature == 0xFEEF04BD:
                                return sFileInfo
            def LOWORD(x):
                return x & 0xFFFF
            def HIWORD(x):
                return (x >> 16) & 0xFFFF
            filename = find_binary_in_path("sslscan")[0]
            filename = split(filename)[0]
            filename = join(filename, "libeay32.dll")
            vinfo = GetFileVersionInfo(filename)
            if not vinfo:
                return # skip check if no file version info present
            ms = vinfo.dwFileVersionMS
            ls = vinfo.dwFileVersionLS
            a = HIWORD(ms)
            b = LOWORD(ms)
            c = HIWORD(ls)
            d = LOWORD(ls)
            if not (
                a > 0 or
                b > 9 or
                c > 8 or
                d >= 20
            ):
                raise RuntimeError(
                    "This version of OpenSSL (%s.%s.%s.%s) has a bug on"
                    " Windows that causes a crash when run from GoLismero,"
                    " please replace it with a newer version from: "
                    "https://slproweb.com/products/Win32OpenSSL.html"
                    % (a, b, c, d)
                )
Example #11
0
 def check_params(self):
     if not find_binary_in_path("nmap"):
         raise RuntimeError(
             "Nmap not found! You can download it from: http://nmap.org/")