crowbar icon indicating copy to clipboard operation
crowbar copied to clipboard

passing a txt file with passwords not working

Open ssh30 opened this issue 4 years ago • 7 comments

launching : crowbar -b rdp -s 192.168.0.15/32 -u IEUser -C /usr/share/wordlists/rockyou.txt result: 2020-08-22 17:55:31 START 2020-08-22 17:55:31 Crowbar v0.4.1 2020-08-22 17:55:31 Trying 192.168.0.15:3389 File: /usr/share/wordlists/rockyou.txt doesn't exists

does anyone has experimenting the same issue?

ssh30 avatar Aug 22 '20 22:08 ssh30

Hey, I just had this issue with rockyou.txt, but I think I've been able to work around it.

Assuming you are using kali and used "apt install crowbar" to install the package to /usr/share

  • Navigate to /usr/share/crowbar/lib/
  • Make a backup of main.py (I used "cp main.py main.py.backup")
  • Once you have a backup, open up the main.py file (Ex. sudo nano main.py).
  • Look for "def sshlogin(self, ip, port, user, keyfile, timeout):" as the start of the next function (the function before it should be def rdp(self): but we need to make the change at the bottom of this function, hence why I suggest looking for def sshlogin.
  • A few lines above that you should see a try statement followed by "passwdfile = open(self.args.passwd_file, "r").read().splitlines()"
  • This is the line causing problems with rockyou.txt.
  • I modified the open command to add encoding="latin-1" instead of Python3 using "UTF-8" that throws the error.
  • ie. the line should look like "passwdfile = open(self.args.passwd_file, "r", encoding="latin-1").read().splitlines()"
  • Save your changes and test it out.
  • Seems to be working (I think), at least crowbar is running and the passwords it's attempting look okay. Worth a try at least.

It's the rockyou.txt and some of the passwords in there not working well with UTF-8.

Cryptopone avatar Sep 03 '20 01:09 Cryptopone

Feel free to open up a PR!

g0tmi1k avatar Sep 16 '20 06:09 g0tmi1k

Alternative solution which doesn't require crowbar to change: Convert rockyou.txt to UTF-8.

https://github.com/wpscanteam/wpscan/issues/190#issuecomment-18087644

iconv -f ISO-8859-1 -t UTF-8 /usr/share/wordlists/rockyou.txt > rockyou_utf8.txt

zormit avatar Oct 13 '20 13:10 zormit

Alternative solution which doesn't require crowbar to change: Convert rockyou.txt to UTF-8.

wpscanteam/wpscan#190 (comment)

iconv -f ISO-8859-1 -t UTF-8 /usr/share/wordlists/rockyou.txt > rockyou_utf8.txt

This works for me, thanks.

cyberphor avatar Jun 21 '21 16:06 cyberphor

For anyone who stumbles upon this issue...

Alternatively you can create another rockyou file and update that one.

sudo cp /usr/share/wordlists/rockyou.txt /usr/share/wordlists/rockyou_utf8.txt                              
sudo vim -c ':set nobomb' -c ':set fileencoding=utf-8' -c ':wq' /usr/share/wordlists/rockyou_utf8.txt

The commands, :set nobomb, :set fileencoding=utf-8 and :wq work in vim too; for when you have vim already opened.

  • https://en.wikipedia.org/wiki/Byte_order_mark
  • https://unix.stackexchange.com/questions/381230/how-can-i-remove-the-bom-from-a-utf-8-file
  • https://stackoverflow.com/questions/778069/how-can-i-change-a-files-encoding-with-vim

IAmAnubhavSaini avatar Nov 21 '21 01:11 IAmAnubhavSaini

that's weird, my rockyou.txt is already utf-8 and even with these workarounds I'm still getting "file doesn't exists" Copying rockyou.txt to the same folder I'm running crowbar worked, though.

joaociocca avatar Nov 05 '22 22:11 joaociocca

that's weird, my rockyou.txt is already utf-8 and even with these workarounds I'm still getting "file doesn't exists" Copying rockyou.txt to the same folder I'm running crowbar worked, though.

it works. you will end up with a rockyou_utf8.txt file, try to fix it because you will need it. this post helped me a lot for the oscp.

All you need are these two commands: kali~$ sudo cp /usr/share/wordlists/rockyou.txt /usr/share/wordlists/rockyou_utf8.txt
kali~$ sudo vim -c ':set nobomb' -c ':set fileencoding=utf-8' -c ':wq' /usr/share/wordlists/rockyou_utf8.txt

c0d3x27 avatar Nov 06 '22 02:11 c0d3x27