Exemple #1
0
def fuzz(hexdomain):
    """Calculates the dnstwist "fuzzy domains" for a domain."""
    domain = tools.parse_domain(hexdomain)
    if domain is None:
        flask.abort(
            400,
            'Malformed domain or domain not represented in hexadecimal format.'
        )

    fuzz_result = tools.fuzzy_domains(domain)
    fuzz_payload = []
    for result in fuzz_result:
        result_payload = standard_api_values(result['domain-name'], skip='url')
        result_payload['fuzzer'] = result['fuzzer']
        fuzz_payload.append(result_payload)

    payload = standard_api_values(domain, skip='fuzz')
    payload['fuzzy_domains'] = fuzz_payload
    return flask.jsonify(payload)
def fuzz(hexdomain):
    """Calculates the dnstwist "fuzzy domains" for a domain."""
    domain = tools.parse_domain(hexdomain)
    if domain is None:
        flask.abort(
            400,
            'Malformed domain or domain not represented in hexadecimal format.'
        )

    fuzz_result = tools.fuzzy_domains(domain)
    fuzz_payload = []
    for result in fuzz_result:
        result_payload = standard_api_values(result['domain-name'], skip='url')
        result_payload['fuzzer'] = result['fuzzer']
        fuzz_payload.append(result_payload)

    payload = standard_api_values(domain, skip='fuzz')
    payload['fuzzy_domains'] = fuzz_payload
    return flask.jsonify(payload)
Exemple #3
0
def email_view_noisy_domains(sub_id):
    """Show the noisy domains not sent in the email.

    This is deliberately bound to the email system as the detection of noisy
    domains is limited to the domains found in email subscriptions.
    """
    subscribed_domain = repository.subscribed_domain(sub_id)
    if subscribed_domain is None:
        app.logger.info(
            'Failed to retrieve sub for id for noisy report: {}'.format(
                sub_id))
        return flask.redirect('/')

    fuzzy_domains = map(operator.itemgetter('domain-name'),
                        tools.fuzzy_domains(subscribed_domain))

    noisy_domains = [
        domain for domain in fuzzy_domains if stats_store.is_noisy(domain)
    ]

    return flask.render_template('www/email/noisy.html',
                                 domain=subscribed_domain,
                                 noisy_domains=noisy_domains)