dns.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ws-backend-community 作者: lavalamp- 项目源码 文件源码
def create_and_inspect_domains_from_subdomain_enumeration(
        self,
        org_uuid=None,
        domain_uuid=None,
        domain_scan_uuid=None,
        parent_domain=None,
        order_uuid=None,
):
    """
    Process the contents of all subdomain enumerations for the given domain name scan, create new domains
    for those subdomains that are new, and invoke scans for the domains as necessary.
    :param org_uuid: The UUID of the organization that subdomains were enumerated for.
    :param domain_uuid: The UUID of the domain name related to this inspection.
    :param domain_scan_uuid: The UUID of the domain name scan that this enumeration is a part of.
    :param parent_domain: The parent domain that was queried.
    :return: None
    """
    logger.info(
        "Now creating an inspecting domains from subdomain enumeration of parent domain %s."
        % (parent_domain,)
    )
    self.wait_for_es()
    subdomains = get_all_subdomains_from_domain_scan_enumeration(
        org_uuid=org_uuid,
        parent_domain=parent_domain,
        domain_scan_uuid=domain_scan_uuid,
    )
    task_sigs = []
    for subdomain in subdomains:
        domain_name = get_or_create_domain_name_for_organization(
            db_session=self.db_session,
            name=subdomain,
            added_by="subdomain_enum",
            org_uuid=org_uuid,
        )
        self.db_session.add(domain_name)
        do_scan = check_domain_name_scanning_status(
            db_session=self.db_session,
            domain_uuid=domain_name.uuid,
            update_status=False,
        )
        if do_scan:
            task_sigs.append(scan_domain_name.si(
                org_uuid=org_uuid,
                domain_uuid=domain_name.uuid,
                enumerate_subdomains=False,
            ))
    self.db_session.commit()
    canvas_sig = group(task_sigs)
    self.finish_after(signature=canvas_sig)


#USED
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号