shmuelamar/cracken

"\n" doesn't removed then read from wordlist on Windows

Closed this issue · 4 comments

Hi, on Windows I try the following command:

cracken.exe -w xx.txt -o out.txt ?w1?d

My wordlist is (just two words for example):

pass
xcv

And as a result I see:

xcv0
xcv1
xcv2
xcv3
xcv4
xcv5
xcv6
xcv7
xcv8
xcv9
pass
0
pass
1
pass
2
pass
3
pass
4
pass
5
pass
6
pass
7
pass
8
pass
9

So I think \n symbol is not removed properly

hi @0x123456789,

I've ran some tests in windows and I am getting the same output only when the wordlist (the xx.txt file) delimited with \r\n. When the wordlist file is correctly delimited with \n only i get the expected results.
There is a difference between unix & windows in line delimiter (\n vs \r\n).

I'm pretty confident that you're file is line delimited by \r\n. to verify you can use this simple python one liner:

$ python -c "print(list(open('xx.txt', 'rb')))"

if you see something like this, you've got the correct line delimiter:

[b'pwd\n', b'xcv\n']

if you see this, you're file has wrong line delimiter:

[b'pwd\r\n', b'xcv\r\n']

Edit it somehow with a script (e.g. python).

Note: I've implemented \n as delimiter as almost all wordlists i know of use it, it contains 1 char vs 2 chars and save a bit extra space.

Hope this helps :)

Thank you, is it possible to add some checks that delimiter is used?

I am open to accept a PR if you wish to write one @0x123456789 , but currently I am busy with other projects.

Closing due to inactivity.