Skip to content

No "real" capture of HTTP:BL response #3465

@nesretep-anp1

Description

@nesretep-anp1

Unfortunately the RBL operator returns the originally IP on match, but not the "real" response. This means, that this operator only could be used on a boolean base like "If there is a DNS response, then match".

IMHO being able to filter requests based on a score would be much better and more feasible, so I changed the code like mentioned below.

rbl.cc before 236

    if (rule && t && rule->hasCaptureAction()) {
        char *respBl;
        int first, second, third, fourth;

        respBl = inet_ntoa(sin.sin_addr);

        if (sscanf(respBl, "%d.%d.%d.%d", &first, &second, &third, &fourth) != 4) {
            ms_dbg_a(t, 4, "RBL lookup of " + ipStr + " failed: bad response");
            //return false;
        }
        else {
            t->m_collections.m_tx_collection->storeOrUpdateFirst(
            "1", std::string(respBl));

            t->m_collections.m_tx_collection->storeOrUpdateFirst(
            "2", std::to_string(fourth));
        }

        furtherInfo(&sin, ipStr, t, m_provider);
    }

rbl.cc before 126

        trans->m_collections.m_tx_collection->storeOrUpdateFirst(
        "2", std::to_string(score));

        trans->m_collections.m_tx_collection->storeOrUpdateFirst(
        "3", std::to_string(type));
        trans->m_collections.m_tx_collection->storeOrUpdateFirst(
        "4", std::to_string(days));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions