Failed to use the --username switch in Hashcat 3.20 on OS X
#1
Smile 
Hello,

First of all, I would like to say thanks to atom and to all those who contributed to coding such a great program. 
I started to use it a few days ago with pretty good success, but of course I am still a newbie.

Back to topic, I managed to install Hashcat 3.20 on OS X 10.10.5 by the following the guidelines in BUILD.md file.

Everything works fine cracking normal hashes with no usernames. But whenever I try to load a hash file with usernames in it and use the --username switch, hashcat always throws an error like this (no matter the username length or the separator):

Code:
./hashcat -a 0 -m 3200 --session=all --username -p : potfile-disable -o xxx/xxx_plains.txt --outfile-format=2 -w 2 xxx/xxx_pfile.txt dictionaries/big001.txt
hashcat (v3.10-814-g9402610) starting...

OpenCL Platform #1: Apple
=========================
* Device #1: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz, skipped
* Device #2: Iris, 384/1536 MB allocatable, 40MCU

Hash '—-username': Line-length exception
No hashes loaded

At the opposite, the same command gives no problem in Hashcat 3.10 installed on my VM with Windows 7.

So I tried to revert back to version 3.10 on OS X also: I downloaded the source code from main hashcat page and tried to compile it the same way I did for ver. 3.20 (i.e. downloading latest Open-CL from GitHub Repository, then 'make' command etc.). Here is the output after make command on Hashcat 3.10:

Code:
/bin/sh: gsed: command not found
gcc -D_POSIX -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -Ideps/OpenCL-Headers/ -O2 -c -o obj/ext_OpenCL.NATIVE.o src/ext_OpenCL.c
gcc -D_POSIX -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -Ideps/OpenCL-Headers/ -O2 -c -o obj/shared.NATIVE.o src/shared.c
gcc -D_POSIX -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -Ideps/OpenCL-Headers/ -O2 -c -o obj/rp_kernel_on_cpu.NATIVE.o src/rp_kernel_on_cpu.c
gcc -D_POSIX -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -Ideps/OpenCL-Headers/ -O2    -o hashcat src/hashcat.c obj/ext_OpenCL.NATIVE.o obj/shared.NATIVE.o obj/rp_kernel_on_cpu.NATIVE.o -lpthread  -DCOMPTIME=1480244563 -DVERSION_TAG=\"\" -DINSTALL_FOLDER=\"/usr/local/bin\" -DSHARED_FOLDER=\"/usr/local/share/hashcat\" -DDOCUMENT_FOLDER=\"/usr/local/share/doc/hashcat\"
src/hashcat.c:14371:9: warning: unused variable 'need_xnvctrl'
     [-Wunused-variable]
   int need_xnvctrl = 0;
       ^
src/hashcat.c:14369:9: warning: unused variable 'need_nvapi' [-Wunused-variable]
   int need_nvapi   = 0;
       ^
2 warnings generated.

After this, however, no hashcat command except for --help is recognized and I always see this error on any command:
Code:
ERROR: (null): No such file or directory

So in conclusions, my questions are:
  1. Does the 'username switch' error arise in ver. 3.20 (on OS X), because this version is still beta? Hashcat 3.10 gives no such error on Win 7.
  2. If yes, then how can I correctly compile Hashcat 3.10 on OS X? I followed the procedure in BUILD.md file but no success.
Thanks to everybody in advance!
P.S.: I see you're all high-technicality people here, please use simple words with me. Smile
#2
Something is wrong with the commandline you posted:

Quote:./hashcat -a 0 -m 3200 --session=all --username -p : potfile-disable -o xxx/xxx_plains.txt --outfile-format=2 -w 2 xxx/xxx_pfile.txt dictionaries/big001.txt

The potfile-disable should be --potfile-disable

Also, from the error you posted

Quote:Hash '--username': Line-length exception

This means hashcat thinks "--username" is the hash. So generally, I think the only problem here is using an wrong commandline.

The error

Quote:ERROR: (null): No such file or directory

Has been fixed for OSX with v3.20. Basically, to workaround, I think you need to mkdir /usr/local/bin but I'm not OSX expert.

The error:

Quote:/bin/sh: gsed: command not found

Also has been fixed for OSX with v3.20.

So the way to go is not to backport. Better find the reason why v3.20 isn't working for you.
#3
Hi atom,

First of all, thanks for your prompt reply!
Yes, the potfile-disable was a clerical mistake, but correcting it or simply deleting the option did not help.

I tried several solutions: shortening the usernames, changing the separator, moving the --username option anywhere in the command but always the same error.

One strange thing I notice is that whatever I write in that option, even wrong syntax like -username, --user etc., the error message always shows this syntax like:

Code:
Hash '-username': Line-length exception

No hashes loaded

or

Code:
Hash '--user': Line-length exception

No hashes loaded

as if such option is not recognized at all!?

Anyway thanks, I will keep on searching and see what I can find! Will report back here in case I solve it.
#4
As I said, hashcat thinks --username is the hash, that's why the error is the same for "-username" and "--user". As long as you don't show the commandline as you really use it there's no way we can help.
#5
Sorry atom, 

the command is basically what I posted in the first thread without the --potfile-disable option.
Here is another example. If you allow me to, I can show you the hashes, but I don't think there's anything wrong in there either.
I'd be very happy if you could solve this problem. Smile

Code:
$ ./hashcat -a 0 -m 3200 --session=all —-username -p : -o xxx/xxx_plains.txt --outfile-format=2 -w 2 xxx/xxx_pfile.txt dictionaries/big001.txt
hashcat (v3.10-814-g9402610) starting...

OpenCL Platform #1: Apple
=========================
* Device #1: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz, skipped
* Device #2: Iris, 384/1536 MB allocatable, 40MCU

Hash '—-username': Line-length exception
No hashes loaded

Started: Mon Nov 28 19:16:12 2016
Stopped: Mon Nov 28 19:16:12 2016
#6
There's something wrong for sure. Don't you see this difference?

Quote:--session

and

Quote:—-username

While both kind of look like a hyphen/minus, the second one is different. Such problem usually are created when copy/paste a string from a html source, maybe a website/blog post or an email. It's clearly not a minus char. Since getops can't recognize it as an option it must be the hash, because the hash/hashlist is always the first argument that is not an option.
#7
LOL damn, you are absolutely right and it is solved now!

Actually I first prepare hashcat commands on OS X Text Editor, in order to save time when editing, but this damned program had automatic correction of hyphens enabled. This cuts off the second hyphen and replaces the first one with that fake sign while typing. At first I did not bother and went on, thinking it was the same thing, but now I clearly see the difference, thanks to you!

Thanks a lot for solving this problem due to my mistake and thanks for the time you spent for me!