def find_versions(args):
    # --------------------------------------------------------------------------
    # Common vars
    # --------------------------------------------------------------------------
    url = args.target
    parsed_url = urlparse(args.target)
    host = parsed_url.hostname
    concurrency = args.concurrency
    log = args.log_function
    proxy = args.proxy
    is_color = args.colorize
    start_time = datetime.now()
    no_check_wordpress = args.no_check_wordpress
    no_check_plugins = args.no_check_plugins
    no_check_wordpress_version = args.no_check_wordpress_version
    force_scan = args.force_scan

    # Jackass mode is set?
    if args.jackass is True:
        concurrency = 9999

    # Non-blocking config
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    con = aiohttp.TCPConnector(conn_timeout=10, share_cookies=True, loop=loop, verify_ssl=False)
    _download = partial(download, max_redirect=0, connector=con, loop=loop)

    # Get CVE database
    db = DB(path=join(get_data_folder(), "cve.db"))

    # --------------------------------------------------------------------------
    # Test availability of target
    # --------------------------------------------------------------------------
    log("[*] Testing target connection...")
    headers, status, content = loop.run_until_complete(_download(url, method="get", get_content=False))

    # Detect redirect
    if status in (300, 301, 302, 303, 307):
        url = headers.get("location", None)

        if url is not None:
            log("\n[%s] Redirection detected to '%s'. Using it now. " % (colorize("ii", "yellow"), url),
                log_level=1)
        else:
            raise PlecostTargetNotAvailable("Redirection detected, but can't determinate the new location")
    log(colorize(" ok!\n"))

    # --------------------------------------------------------------------------
    # Check if remote host is a WordPress
    # --------------------------------------------------------------------------
    if no_check_wordpress is False:
            log("[*] Looking for WordPress installation...\n")
            # Error page content.
            headers, status, error_page = loop.run_until_complete(_download(generate_error_page(url)))

            _is_wp = loop.run_until_complete(is_remote_a_wordpress(url, error_page, _download))

            if not _is_wp:
                if force_scan is False:
                    raise PlecostNotWordPressFound("No WordPress installations found in '%s'." % host)
                else:
                    log(colorize("\n   No Wordpress installation found!\n", "yellow"))
            else:
                log("\n   %s" % colorize(" ok!\n"))

    # --------------------------------------------------------------------------
    # Check WordPress version
    # --------------------------------------------------------------------------
    if no_check_wordpress_version is False:
            log("[*] Getting WordPress version... ")

            wordpress_version = loop.run_until_complete(get_wordpress_version(url, _download, db))
            # wordpress_version.
            if wordpress_version:
                log("%s (latest: %s)" %
                    (
                        colorize("%s" % wordpress_version.current_version,
                                 "red" if wordpress_version.is_outdated is True else "blue"),
                        colorize("%s" % wordpress_version.latest_version)
                    ), 0)

                # --------------------------------------------------------------------------
                # Looking for CVEs for installed Wordpress version
                # --------------------------------------------------------------------------
                if wordpress_version.vulnerabilities:
                    log("\n    |_CVE list:\n")
                    for cve in wordpress_version.vulnerabilities:
                        log("    |__%(cve)s: (http://cve.mitre.org/cgi-bin/cvename.cgi?name=%(cve)s)\n" %
                            {"cve": colorize(cve, "red")})
                    log("\n")
            else:
                    log(colorize("Unknown!\n", "red"))

            log("\n")
    else:
        wordpress_version = PlecostWordPressInfo(last_version="",
                                                 current_version="",
                                                 vulnerabilities=[])

    # --------------------------------------------------------------------------
    # Check the plugins
    # --------------------------------------------------------------------------
    # Read plugins file and remove \n and \r
    plugins_info = []

    if no_check_plugins is False:
        plugins = []
        plugins_append = plugins.append

        with open(args.wordlist, "rU") as f:
            for plugin in f:
                plugins_append(plugin.replace("\n", "").replace("\r", ""))

        # Prepare csv file
        cve_info = csv.reader(plugins)
        error_page = ""
        # Find plugins
        log("[*] Looking for plugins (wordlist: %s) ... " % args.wordlist[args.wordlist.rfind("/") + 1:], 0)

        plugins_info = loop.run_until_complete(plugins_testing(url,
                                                               error_page,
                                                               log,
                                                               cve_info,
                                                               db,
                                                               concurrency,
                                                               loop,
                                                               con=con))
    log("\n[*] Done! \n")

    # Set finish time
    end_time = datetime.now()

    # --------------------------------------------------------------------------
    # Clean up
    # --------------------------------------------------------------------------
    con.close()

    # --------------------------------------------------------------------------
    # Make results
    # --------------------------------------------------------------------------
    return PlecostResults(target=args.target,
                          start_time=start_time,
                          end_time=end_time,
                          wordpress_info=wordpress_version,
                          plugins=plugins_info)
Main function to run libs as version finder.
dataset/ETHPy150Open iniqua/plecost/plecost_lib/libs/versions.py/find_versions