Exemplo n.º 1
0
    def fetch_site(self):
        site_info_list = services.fetch_site(self.site_list)

        for site_info in site_info_list:
            curr_site = site_info["site"]
            if curr_site not in self.site_list:
                self.site_302_list.append(curr_site)
            site_path = "/image/" + self.task_id
            file_name = '{}/{}.jpg'.format(site_path,
                                           utils.gen_filename(curr_site))
            site_info["task_id"] = self.task_id
            site_info["screenshot"] = file_name

            # 调用读取站点识别的结果,并且去重
            if self.web_analyze_map:
                finger_list = self.web_analyze_map.get(curr_site, [])
                known_finger_set = set()
                for finger_item in site_info["finger"]:
                    known_finger_set.add(finger_item["name"].lower())

                for analyze_finger in finger_list:
                    analyze_name = analyze_finger["name"].lower()
                    if analyze_name not in known_finger_set:
                        site_info["finger"].append(analyze_finger)

            utils.conn_db('site').insert_one(site_info)

        if self.task_tag == 'monitor':
            self.async_site_info(site_info_list)
Exemplo n.º 2
0
    def fetch_site(self):
        '''***站点信息获取***'''
        site_info_list = services.fetch_site(self.site_list)
        self.site_info_list = site_info_list
        for site_info in site_info_list:
            curr_site = site_info["site"]
            if curr_site not in self.site_list:
                self.site_302_list.append(curr_site)
            site_path = "/image/" + self.task_id
            file_name = '{}/{}.jpg'.format(site_path,
                                           utils.gen_filename(curr_site))
            site_info["task_id"] = self.task_id
            site_info["screenshot"] = file_name

            finger_list = self.web_analyze_map.get(curr_site, [])
            site_info["finger"] = finger_list

            if self.options.get("site_identify"):
                web_app_finger = services.web_app_identify(site_info)
                flag = False
                if web_app_finger and finger_list:
                    for finger in finger_list:
                        if finger["name"].lower(
                        ) == web_app_finger["name"].lower():
                            flag = True
                            break

                if not flag and web_app_finger:
                    finger_list.append(web_app_finger)

            utils.conn_db('site').insert_one(site_info)
Exemplo n.º 3
0
 def fetch_site(self):
     site_info_list = services.fetch_site(self.site_list)
     for site_info in site_info_list:
         curr_site = site_info["site"]
         if curr_site not in self.site_list:
             self.site_302_list.append(curr_site)
         site_path = "/image/" + self.task_id
         file_name = '{}/{}.jpg'.format(site_path,
                                        utils.gen_filename(curr_site))
         site_info["task_id"] = self.task_id
         site_info["screenshot"] = file_name
         site_info["finger"] = []
         utils.conn_db('site').insert_one(site_info)