def init(self):
        self.init_shodan_api()
        dork = None
        if conf.dork_shodan:
            dork = conf.dork_shodan
        else:
            dork = conf.dork
        if not dork:
            msg = "Need to set up dork (please --dork or --dork-shodan)"
            raise PocsuitePluginDorkException(msg)
        if conf.dork_b64:
            import base64
            dork = str(base64.b64decode(dork), encoding="utf-8")

        if kb.comparison:
            kb.comparison.add_dork("Shodan", dork)
        info_msg = "[PLUGIN] try fetch targets from shodan with dork: {0}".format(dork)
        logger.info(info_msg)
        targets = self.shodan.search(dork, conf.max_page, resource=conf.search_type)
        count = 0
        if targets:
            for target in targets:
                if kb.comparison:
                    kb.comparison.add_ip(target, "Shodan")
                if self.add_target(target):
                    count += 1

        info_msg = "[PLUGIN] get {0} target(s) from shodan".format(count)
        logger.info(info_msg)
    def init(self):
        self.init_zoomeye_api()
        dork = None
        if conf.dork_zoomeye:
            dork = conf.dork_zoomeye
        else:
            dork = conf.dork
        if not dork:
            msg = "Need to set up dork (please --dork or --dork-zoomeye)"
            raise PocsuitePluginDorkException(msg)

        info_msg = "[PLUGIN] try fetch targets from zoomeye with dork: {0}".format(
            dork)
        logger.info(info_msg)
        targets = self.zoomeye.search(dork,
                                      conf.max_page,
                                      resource=conf.search_type)
        count = 0
        if targets:
            for target in targets:
                if self.add_target(target):
                    count += 1

        info_msg = "[PLUGIN] get {0} target(s) from zoomeye".format(count)
        logger.info(info_msg)
Exemple #3
0
    def init(self):
        self.init_fofa_crawler()
        dork = None
        if conf.dork_fofac:
            dork = conf.dork_fofac
        else:
            dork = conf.dork
        if not dork:
            msg = "Need to set up dork (please --dork or --dork-fofac)"
            raise PocsuitePluginDorkException(msg)
        if kb.comparison:
            kb.comparison.add_dork("Fofac", dork)
        info_msg = "[PLUGIN] try fetch targets from fofa with dork: {0}".format(
            dork)
        logger.info(info_msg)
        targets = self.fofac.search(dork)
        count = 0
        if targets:
            for target in targets:
                if kb.comparison:
                    kb.comparison.add_ip(target, "Fofa")
                if self.add_target(target):
                    count += 1

            info_msg = "[PLUGIN] get {0} target(s) from FOfac".format(count)
            logger.info(info_msg)
Exemple #4
0
    def init(self):
        self.google = Google()
        dork = None
        if conf.dork_google:
            dork = conf.dork_google
        else:
            dork = conf.dork
        if not dork:
            msg = "Need to set up dork (please --dork or --dork-google)"
            raise PocsuitePluginDorkException(msg)
        if kb.comparison:
            kb.comparison.add_dork("Google", dork)
        info_msg = "[PLUGIN] try fetch targets from google with dork: {0}".format(
            dork)
        logger.info(info_msg)
        targets = self.google.search(dork)
        count = 0
        tmp = []
        if targets:
            for target in targets:
                url = urlparse(target)
                if url.scheme + "://" + url.netloc != 'https://www.google.com':
                    tmp.append(url.scheme + "://" + url.netloc)
            targets = list(set(tmp))
            for target in targets:
                if kb.comparison:
                    kb.comparison.add_ip(target, "Google")
                if self.add_target(target):
                    count += 1

            info_msg = "[PLUGIN] get {0} target(s) from google".format(count)
            logger.info(info_msg)
Exemple #5
0
    def init(self):
        self.init_censys_api()
        dork = None
        if conf.dork_censys:
            dork = conf.dork_censys
        else:
            dork = conf.dork
        if not dork:
            msg = "Need to set up dork (please --dork or --dork-censys)"
            raise PocsuitePluginDorkException(msg)
        if conf.dork_b64:
            import base64
            dork = str(base64.b64decode(dork),encoding = "utf-8")
        if kb.comparison:
            kb.comparison.add_dork("Censys", dork)
        info_msg = "[PLUGIN] try fetch targets from censys with dork: {0}".format(dork)
        logger.info(info_msg)
        search_type = conf.search_type
        if search_type == "web":
            search_type = "websites"
        else:
            search_type = "ipv4"
        targets = self.censys.search(dork, conf.max_page, resource=search_type)
        count = 0
        if targets:
            for target in targets:
                if kb.comparison:
                    kb.comparison.add_ip(target, "Censys")
                if self.add_target(target):
                    count += 1

        info_msg = "[PLUGIN] get {0} target(s) from Censys".format(count)
        logger.info(info_msg)