hashcat Forum
Exit status code - Printable Version

+- hashcat Forum (https://hashcat.net/forum)
+-- Forum: Support (https://hashcat.net/forum/forum-3.html)
+--- Forum: hashcat (https://hashcat.net/forum/forum-45.html)
+--- Thread: Exit status code (/thread-9387.html)



Exit status code - BadWood17 - 07-16-2020

Good day!

I’m making a program that works with haschat (python). And I wanna know what exit code would be after hashcat worked. There’s a file with exit status codes in haschat/doc, but in haschat.logfile there is no information about exit status code. Please, help me to find exit status’s code after haschat working.


RE: Exit status code - philsmd - 07-16-2020

here we just need to distinguish between the process exit code ($? variable) and the status that hashcat internally uses:
1. if you check the process exit code, you need to follow this list: https://github.com/hashcat/hashcat/blob/master/docs/status_codes.txt
2. if you look into the file hashcat.log instead, you will see entries with "status-after-work" and it should follow this list: https://github.com/hashcat/hashcat/blob/46cd7900dc3309bac044784e5e45625252e72be6/include/types.h#L199-L211

as you can see the internal state is more detailed and there are more possibilities. Not all of them make sense to expose into the $? process exit code, therefore the lists are different.


RE: Exit status code - BadWood17 - 07-16-2020

(07-16-2020, 11:27 AM)philsmd Wrote: here we just need to distinguish between the process exit code ($? variable) and the status that hashcat internally uses:
1. if you check the process exit code, you need to follow this list: https://github.com/hashcat/hashcat/blob/master/docs/status_codes.txt
2. if you look into the file hashcat.log instead, you will see entries with "status-after-work" and it should follow this list: https://github.com/hashcat/hashcat/blob/46cd7900dc3309bac044784e5e45625252e72be6/include/types.h#L199-L211

as you can see the internal state is more detailed and there are more possibilities. Not all of them make sense to expose into the $? process exit code, therefore the lists are different.


Speaking about 1. Status codes. Where should I find these codes in hashcat? Maybe some file or what?


RE: Exit status code - philsmd - 07-16-2020

no, this code is returned directly from the process, your shell is able to give you the results:

linux
Code:
hashcat example0.hash example.dict

echo $?


on windows it seems to be this: https://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-command-line/334890#334890

there are of course libraries and also python modules/libs (e.g. https://docs.python.org/3/library/subprocess.html , see returncode etc)