Skip to content
New issue

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

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

Already on GitHub? # to your account

Substituted characters not fully implemented #45

Open
aattwood opened this issue Feb 14, 2019 · 6 comments
Open

Substituted characters not fully implemented #45

aattwood opened this issue Feb 14, 2019 · 6 comments

Comments

@aattwood
Copy link

It seems that some substituted characters e.g. @ for a and 5 for s are implemented, but some are not.
I have tested 2u and uu for w e.g.
P@55w0rd provides a basic score of 0
P@55uu0rd provides a basic score of 4

I found a list of substituted characters at:

https://en.wikipedia.org/wiki/Munged_password

@Tostino
Copy link
Collaborator

Tostino commented Nov 18, 2019

Sorry for the delay in responding to you.

That'd be because what is in place currently is just a "l33t" table lookup for single character replacements.

See: https://github.com/GoSimpleLLC/nbvcxz/blob/master/src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java for the getDefaultLeetTable() implementation.

So, with the current design there is no easy way to replace 2 characters with 1 character (uu or 2u with w)... that does seem like a good idea though, if you or anyone else have time to implement an "unmunger", feel free and I will give any support I can in getting it merged.

Otherwise i'll just keep this open and will eventually get to it.

@Ronan-H
Copy link

Ronan-H commented Jun 6, 2020

I'm giving this a shot. It's pretty tricky, most of the leet substitution code has to be rewritten to allow for arbitrary string -> string substitutions. There are some questions to be asked about how you want it done but I'll just go with what I think works best and you can review it in the pull request (if I actually get this done...)

Ronan-H added a commit to Ronan-H/nbvcxz that referenced this issue Jun 8, 2020
* Started the munging rework

* 'Unmunger' mostly working now, passes all original junit tests'

* Added the MungeTable class

* Added a JUnit test that passes

* Added javadoc for new unmunging classes
@Ronan-H
Copy link

Ronan-H commented Jun 11, 2020

From DictionaryMatcher#translateLeet():

// Do not bother continuing if we're going to replace every single character
if(replacements.keySet().size() == password.length())
    return translations;

Why shouldn't passwords that are made up entirely of leet characters be translated?

@Tostino
Copy link
Collaborator

Tostino commented Jun 11, 2020

@Ronan-H really appreciate the work on this! I will review it as soon as I can get up for air at work, it's been really crazy for me, and I don't want you to think I am just ignoring ya.

I honestly cannot remember why that was put in place, it may have been an optimization to speed the dictionary checker up without causing any known regressions. I will look at my commits and see if I can recall.

@Tostino
Copy link
Collaborator

Tostino commented Jun 11, 2020

And...that's exactly what it was: 65a1e54

As i'm sure you're aware, the complexity of this problem can get out of hand quite quickly causing an extreme performance issue if the number of options on how to cost this is allowed to explode to any granularity. So that's why I put some "stops" in place to limit the explosion of possibilities that need to be considered for each password to only the ones which were more likely to be a hit.

If that can be relaxed in some way without degrading performance a ton that'd be great.

@Ronan-H
Copy link

Ronan-H commented Jun 12, 2020

@Tostino Ok, I've added that optimization to my PR. Something like 31!+3 still gets matched to elite somehow, I guess that has to do with how the string gets broken up? EDIT: Actually I may have rushed that one...

Don't worry about merging my PR any time soon, I just wanted something fun to work on while I'm waiting to start work :)


I know what you mean about the performance issues, things start to slow down when you're testing combinations of combinations of combinations...I feel like it's a bad place to optimize though personally. The above example with 31!+3 -> elite can be translated extremely quickly, and yet it gets skipped and matched as brute force. Anyway, I fixed that optimization and it can always be taken our or traded for another optimization later if you want.

Ronan-H added a commit to Ronan-H/nbvcxz that referenced this issue Mar 9, 2023
Ronan-H added a commit to Ronan-H/nbvcxz that referenced this issue Mar 9, 2023
Ronan-H added a commit to Ronan-H/nbvcxz that referenced this issue Mar 9, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants