Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effectively-duplicate rule suppression #5698

Open
solardiz opened this issue Mar 16, 2025 · 1 comment
Open

Effectively-duplicate rule suppression #5698

solardiz opened this issue Mar 16, 2025 · 1 comment

Comments

@solardiz
Copy link
Member

We already have suppression of literally duplicate wordlist rules (although there may be bugs with it, see #5011), however we do not yet suppress rules that look different but are effectively duplicate (redundant).

https://github.com/mhasbini/duprule is one external project that does this, so we could consider their approach (vs. or as well as other ideas):

How does it works ?

TL;DR: Each rule change is mapped, and a unique id is generated for each rule with functions count.

The mechanism is like this:

    A blank map is created with N ( from 1 to 36 ) slots.
    Each rule change will be applied to the map. Example rule: 'u', will change all characters cases from '?' ( unknown ) to 'u' ( upper case ). 'sab', will add {'a' -> 'b'} to the map. And same logic apply for the other rules.
    An id is generated from the map.
    The ids are compared to detect duplicate rules.
    The rule with the least functions count will be selected.
@solardiz
Copy link
Member Author

The referenced duprule tool is now in Rust, but it was in Perl until commit:

commit 05e73e913a3899931c2e46ca2ec65201ebadbfec
Author: mhasbini <mohammad.hasbini@gmail.com>
Date:   Mon Sep 11 22:27:48 2017 +0300

    remove L, R, + & - rules; Rewrite in Rust

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant