server
server copied to clipboard
[BUG] hashcat client does not download any file and fails after migration to HTTPS
- Hashtopolis version: 0.12.0+74bedaedc2df0f066a5842be3bef657290b5461a
- Current Client version: s3-python-0.6.0.10
- Your current Hashcat version: 6.2.5
- The exact task command you are trying to run: #HL# german-words.txt -r dive.rule (does not matter as it occurs for any task)
- Debug output from the client by running "hashtopolis.exe -d" or with debug flag set on the python client:
Starting client 's3-python-0.6.0.10'...
Collecting agent data...
{'action': 'updateInformation', 'token': '[TOKEN-REDACTED]', 'uid': '[UUID-REDACTED]', 'os': 1, 'devices': ['Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz', 'Intel(R) UHD Graphics 630', 'NVIDIA GeForce GTX 1050 Ti with Max-Q Design']}
Starting new HTTP connection (1): [URL-REDACTED]:80
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
Starting new HTTPS connection (1): [URL-REDACTED]:443
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 51
b'{"action":"updateInformation","response":"SUCCESS"}'
{'action': 'login', 'token': '[TOKEN-REDACTED]', 'clientSignature': 's3-python-0.6.0.10'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 106
b'{"action":"login","response":"SUCCESS","multicastEnabled":false,"timeout":45,"server-version":"0.12.0 ()"}'
Login successful!
Hashtopolis Server version: 0.12.0 ()
{'action': 'checkClientVersion', 'token': '[TOKEN-REDACTED]', 'version': '0.6.0.10', 'type': 'python'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 67
b'{"action":"checkClientVersion","response":"SUCCESS","version":"OK"}'
Client is up-to-date!
Entering loop...
{'action': 'getFileStatus', 'token': '[TOKEN-REDACTED]'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 125
b'{"action":"getFileStatus","response":"SUCCESS","filenames":["cedric_test","darknet","Pre-cracked_1_11-08-2022_10-35-31.txt"]}'
{'action': 'getTask', 'token': '[TOKEN-REDACTED]'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 406
b'{"action":"getTask","response":"SUCCESS","taskId":90,"attackcmd":"#HL# german-words.txt -r dive.rule","cmdpars":" --hash-type=1000 ","hashlistId":1,"bench":30,"statustimer":5,"files":["dive.rule","german-words.txt"],"crackerId":1,"benchType":"speed","hashlistAlias":"#HL#","keyspace":0,"usePreprocessor":false,"preprocessor":0,"preprocessorCommand":"","enforcePipe":false,"slowHash":false,"useBrain":false}'
Got task with id: 90
{'action': 'downloadBinary', 'token': '[TOKEN-REDACTED]', 'type': 'cracker', 'binaryVersionId': 1}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 147
b'{"action":"downloadBinary","response":"SUCCESS","url":"https:\\/\\/hashcat.net\\/files\\/hashcat-6.2.5.7z","name":"hashcat","executable":"hashcat.exe"}'
{'action': 'getFile', 'token': '[TOKEN-REDACTED]', 'taskId': 90, 'file': 'dive.rule'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 145
b'{"action":"getFile","filename":"dive.rule","extension":"rule","response":"SUCCESS","url":"getFile.php?file=2&token=[TOKEN-REDACTED]","filesize":788063}'
http://[URL-REDACTED]:80 "HEAD /getFile.php?file=2&token=[TOKEN-REDACTED] HTTP/1.1" 308 0
{'action': 'getFile', 'token': '[TOKEN-REDACTED]', 'taskId': 90, 'file': 'german-words.txt'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 153
b'{"action":"getFile","filename":"german-words.txt","extension":"txt","response":"SUCCESS","url":"getFile.php?file=4&token=[TOKEN-REDACTED]","filesize":25867742}'
http://[URL-REDACTED]:80 "HEAD /getFile.php?file=4&token=[TOKEN-REDACTED] HTTP/1.1" 308 0
{'action': 'getHashlist', 'token': '[TOKEN-REDACTED]', 'hashlistId': 1}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 98
b'{"action":"getHashlist","response":"SUCCESS","url":"getHashlist.php?hashlists=1&token=[TOKEN-REDACTED]"}'
http://[URL-REDACTED]:80 "GET /getHashlist.php?hashlists=1&token=[TOKEN-REDACTED] HTTP/1.1" 301 17
https://[URL-REDACTED]:443 "GET /getHashlist.php?hashlists=1&token=[TOKEN-REDACTED] HTTP/1.1" 200 None
{'action': 'checkClientVersion', 'token': '[TOKEN-REDACTED]', 'version': '0.6.0.10', 'type': 'python'}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 67
b'{"action":"checkClientVersion","response":"SUCCESS","version":"OK"}'
Client is up-to-date!
Got cracker binary type hashcat
CALL: hashcat.exe --version
{'action': 'getChunk', 'token': '[TOKEN-REDACTED]', 'taskId': 90}
http://[URL-REDACTED]:80 "POST /api/server.php HTTP/1.1" 308 18
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 71
b'{"action":"getChunk","response":"SUCCESS","status":"keyspace_required"}'
CALL: hashcat.exe --keyspace --quiet german-words.txt -r dive.rule --hash-type=1000
german-words.txt: No such file or directory
Error during keyspace measure: Command 'hashcat.exe --keyspace --quiet german-words.txt -r dive.rule --hash-type=1000 ' returned non-zero exit status 4294967295.
{'action': 'clientError', 'token': '[TOKEN-REDACTED]', 'taskId': 90, 'chunkId': None, 'message': 'Keyspace measure failed!'}
Describe your problem in as much detail as possible " It's broke " is not a description. I was using hashtopolis in a test environment on HTTP and everything worked fine. After testing I migrated hashtopolis to our production server using HTTPs and a self-signed (but trusted) certificate. The setup works fine using "pip-system-certs" and the client can authenticate against the hashtopolis-server. However when starting a task the client fails with the error "No such file or directory" for any file needed for the task. At the beginning 7zr.exe was missing and I added it manually. But I cannot to that for every file. I can see that hashcat tries to download the file via port 80 and gets a redirect from the server. Line: http://[URL-REDACTED]:80 "HEAD /getFile.php?file=4&token=[TOKEN-REDACTED] HTTP/1.1" 308 0 Howver it does not seem to follow the redirect and simply skips the download. Any ideas on how to fix that? Why are some redirects followed (eg. the hashlist is downloaded) and some are not (wordlists and rules and static files)?
The issue here is that for downloading files, different python components are used. For all normal requests, it is able to handle redirects, but the download code is not able to handle this.
An easy fix in your case would be that you fix the URL on the agent(s) to directly use the https one instead of having to do two http requests for each request to the server. You can do this by editing the base url in the config.json file which is in the agent folder where the source code is.
@s3inlc thanks for the quick reply. However changing the URL in the config does not change the behavior. Hashtopolis still tries http first and fails at the redirect. Even completely resetting the client and registering a new one does not fix this:
Found existing lock.pid, checking if python process is running...
Ignoring lock.pid file because PID is not existent anymore or not running python!
Starting client 's3-python-0.6.0.10'...
Collecting agent data...
{'action': 'updateInformation', 'token': '[TOKEN-REDACTED]', 'uid': '[UUID-REDACTED]', 'os': 1, 'devices': ['Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz', 'Intel(R) UHD Graphics 630', 'NVIDIA GeForce GTX 1050 Ti with Max-Q Design']}
Starting new HTTPS connection (1): [URL-REDACTED]:443
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 51
b'{"action":"updateInformation","response":"SUCCESS"}'
{'action': 'login', 'token': '[TOKEN-REDACTED]', 'clientSignature': 's3-python-0.6.0.10'}
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 106
b'{"action":"login","response":"SUCCESS","multicastEnabled":false,"timeout":45,"server-version":"0.12.0 ()"}'
Login successful!
Hashtopolis Server version: 0.12.0 ()
{'action': 'checkClientVersion', 'token': '[TOKEN-REDACTED]', 'version': '0.6.0.10', 'type': 'python'}
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 67
b'{"action":"checkClientVersion","response":"SUCCESS","version":"OK"}'
Client is up-to-date!
{'action': 'downloadBinary', 'token': '[TOKEN-REDACTED]', 'type': '7zr'}
https://[URL-REDACTED]:443 "POST /api/server.php HTTP/1.1" 200 125
b'{"action":"downloadBinary","response":"SUCCESS","executable":"http:\\/\\/[URL-REDACTED]\\/static\\/7zr.exe"}'
Starting new HTTP connection (1): [URL-REDACTED]:80
http://[URL-REDACTED]:80 "HEAD /static/7zr.exe HTTP/1.1" 308 0
Traceback (most recent call last):
File "C:\Users\[USER-REDACTED]\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\[USER-REDACTED]\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\[USER-REDACTED]\Desktop\HT\hashtopolis.zip\__main__.py", line 342, in <module>
File "C:\Users\[USER-REDACTED]\Desktop\HT\hashtopolis.zip\__main__.py", line 139, in init
File "C:\Users\[USER-REDACTED]\Desktop\HT\hashtopolis.zip\htpclient\binarydownload.py", line 22, in run
File "C:\Users\[USER-REDACTED]\Desktop\HT\hashtopolis.zip\htpclient\binarydownload.py", line 80, in __check_utils
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden: '7zr.exe'
Is it possible to follow redirects for the specific python components?
You also need to fix the base URL on the server side, as the download link for files is built on the server side and sent to the client. You will find this at Server -> Config -> Server. There may be some value at the base hostname/port/protocol entry. Either change this to the correct protocol and port or clear it out completely (normally Hashtopolis is able to determine this automatically, so this value stays empty).
Fixed for me. If you want you can close this, or keep it open as a reminder to follow redirects for all calls.
Thanks for the feedback, I will keep it open so this remains on the list and we check if there is a fix for this problem.