-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add support of HS384 & HS512, password list and improved display #34
Conversation
* **alphabet**: the alphabet to use for the brute force (default: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") | ||
* **maxLength**: the max length of the string generated during the brute force (default: 12) | ||
|
||
* **dictionaryFilePath**: path to a list of passwords (one per line) to use instead of brute force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we specify that it’s optional ?
|
||
## Requirements | ||
|
||
This script requires Node.js version 6.0.0 or higher | ||
This script requires Node.js version 16.0.0 or higher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reflecting the engine
key in package.json
("node": ">=16.0.0"
)
@@ -7,7 +7,7 @@ export default class Constants { | |||
return 12 | |||
} | |||
|
|||
static get MAX_CHUNK_SIZE () { | |||
static get CHUNK_SIZE () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have renamed it since it’s not used (no reference to this constant found)
|
||
const args = new ArgsParser() | ||
const __dirname = fileURLToPath(new URL('.', import.meta.url)) | ||
const numberFormatter = Intl.NumberFormat('en', { notation: 'compact' }).format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the magic used for displaying speed like 875K/s
, 1M/s
, 1.1M/s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick! :) i was not aware you could simply use Intl
!
process.on('message', function ({ chunk, content, signature }) { | ||
|
||
process.on('message', function ({ chunk, content, signature, algorithm }) { | ||
const generateSignature = signatureGenerator(algorithm, content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function generator (currying) improve speed as we won’t pass each time algorithm
and content
during the loop (only the changing part)
static SUPPORTED_ALGORITHM = [ | ||
'HS256', | ||
'HS384', | ||
'HS512' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also put it in constants.js
if you wish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! It looks really good to me!
Can you please review that .conflicts
option?
Happy to merge and release a new version after that
type: 'string', | ||
describe: 'Password file to use instead of the brute force', | ||
default: null | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also add a
.conflicts('d', 'a')
To basically error if a user is specifying both the alphabet and the dictionary (which I believe should be mutually exclusive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be tested btw, i have only looked at the tdoc and discovered that this is supported in some version of Yargs!
|
||
const args = new ArgsParser() | ||
const __dirname = fileURLToPath(new URL('.', import.meta.url)) | ||
const numberFormatter = Intl.NumberFormat('en', { notation: 'compact' }).format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick! :) i was not aware you could simply use Intl
!
Thank you very much for your approval!! I’ve looked into the
So I see two possible options :
By the way, during testing I found the |
Thinking about this, it actually makes sense. Thanks for testing this thoroughly!
I prefer the second approach for now... it feels more intuitive to me. What do you think? If I understand your implementation correctly, we just need to make it very clear that by default it's an alphabet brute force, but if you specify a dictionary that takes precedence it becomes a dictionary brute force.
No strong preference here. what's a good value that doesn't crop the options? Can you share some screenshots? Also this is something we could review and discuss in a dedicated PR, if you don't want to have this one blocked ;) |
This reverts commit 258fade.
I honestly like the responsive one... should we include it in this PR? |
Agreed!! It’s pushed :) |
Legend! Once the tests are completed, I'll merge and cut a new release! Thanks a lot for your awesome contribution PS: did you know that I also have a distributed version of this project? 😇 |
Awesome!! 🔥 I saw it very recently when looking the issues, It’s awesome to have this server/client distributed version, I was impressed!! Some contributions you would suggest? 😇 I was also thinking of porting the cracker to the web (converting |
The web idea sounds pretty cool! I'd love to see it :) Regarding contribs to the distributed version, the dictionary feature might be very cool to have there too! |
Almost a year later ⏲️ I finally deployed a web version running in the browser (brute-force is done only on client side), features are very limited for now (the dictionary works the best) but it can help when you want to quickly check a token without installing Node.JS :) |
That's amazing! I love the design :) Thanks for sharing this. I will certainly repost it on my socials. BTW I am not able to change the dictionary (looks like I can't click anything other than the default option). Is that intended or a bug? |
Thank you very much !! That would be awesome !! If you’re talking about using your own dictionary, I haven’t implemented this feature (custom dictionary) yet as I was thinking about uploading file and the design of the input, but that would be the next feature on the list :) |
Attempts: 100000 (483K/s last attempt was 'nascar08')
-help
withyargs
Don’t hesitate to ask for changes, I will do it as fast as possible ! 🚀
It should resolve this issue : #4
Thanks for this awesome project, it helped me a lot!!