Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent 0.7.0 is broken on Windows due to path parameters #834

Closed
1 task done
kjnunu opened this issue Dec 3, 2022 · 5 comments · Fixed by hashtopolis/agent-python#36
Closed
1 task done

Agent 0.7.0 is broken on Windows due to path parameters #834

kjnunu opened this issue Dec 3, 2022 · 5 comments · Fixed by hashtopolis/agent-python#36
Assignees
Labels
agent Hashtopolis Agent related bug Something isn't working

Comments

@kjnunu
Copy link

kjnunu commented Dec 3, 2022

hi
i updated my server yesterday to the last version (0.13.0).
this last version has too many error on windows cracker .
on its first run after it tried to update my cracker binary to 6.2.6 it just download the whole package but immediately deleted duo some error in the new code
first error :
Error:
cannot find archive
Traceback (most recent call last):
..
..
FileNotFoundError: [WinError 3] (my_path_)/crackers\temp
and i fixed by creating temp folder on /crackers and downloading the last hashcat manually and adding path of the new hashcat to my system environment .
then again another error:
it cant run hashcat64 because its not available in the last new version of hashcat you see , in the last version of hashcat there are just one file called hashcat.exe. so i renamed it and to hashcat64.exe and it fixed this error and here we go again another error occurred:
it couldn't call hashcat64 because it says "is not recognized as an internal or external command" . after i removed " ' " from hashcat_cracker.py file line 29 and its solved too
self.cracker_path = self.config.get_value('crackers-path') + "/" + str(cracker_id) + "/"
self.cracker_path = self.config.get_value(crackers-path) + "/" + str(cracker_id) + "/"
but again it get another error ...
after wasting couple of my worthless hours, i gave up and downgraded my server and my crackers then everything worked as it should with hashcat v5.1.0 and server v0.12.0
please check the last version of your agent on any pure new installed windows os to see what i'm saying!

@zyronix
Copy link
Member

zyronix commented Dec 3, 2022

Thanks for reporting this issue and sorry for the inconvenience that the upgrade causes. I haven't found the time to reproduce the issue, but based on the information I can already confirm it. This is caused by the addition of the new config parameters at the agent side. We indeed did not correctly confirm this change on Windows agents.

I'll try to investigate this in the upcoming week and come up with a solution.

@zyronix zyronix changed the title agent for last version has too many error on windows but works great on linux Agent 0.7.0 is broken on Windows due to path parameters Dec 3, 2022
@zyronix zyronix self-assigned this Dec 3, 2022
@zyronix zyronix added bug Something isn't working agent Hashtopolis Agent related labels Dec 3, 2022
@zyronix
Copy link
Member

zyronix commented Dec 7, 2022

I spent some time trying to fix this issue, but it is not very easy to resolve. This bug was introduces by: hashtopolis/agent-python#31

There are two problems, on initial setup the config settings for hashlists-path is done using os.path.abspath. Returning a path using '' slashes like C:\hashtopolis-agent, while everything in the application requires forward slashes. Next the change introduces the quotation of shell commands. For example originally the agent was calling:
hashcat64.exe --keyspace

Now it is calling:
'hashcat64.exe' --keyspace

This break it on windows.

I see 3 options as for now:

  1. Revert the agent.path change
  2. Dirty fix it, I have completed this change; however I still need to test this.
  3. Completely rewrite all the calls to prober support of Pathlib and standardize the quoting. (2-3 days engineering time)

@s3inlc what do you prefer?

@spmedia
Copy link

spmedia commented Feb 17, 2023

I'm running into the same issue as well atm with the Windows agent.


C:\Users\me\Downloads>python3 hashtopolis.zip
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.7.0.7'...
Collecting agent data...
Login successful!
Hashtopolis Server version: 0.13.0 (commit c61e750 branch master)
Client is up-to-date!
Got task with id: 3

Client is up-to-date!
Got cracker binary type hashcat
''hashcat64.exe'' is not recognized as an internal or external command,
operable program or batch file.
Error during version detection: Command ''hashcat64.exe' --version' returned non-zero exit status 1.
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\me\Downloads\hashtopolis.zip_main
.py", line 378, in
File "C:\Users\me\Downloads\hashtopolis.zip_main
.py", line 226, in loop
File "C:\Users\me\Downloads\hashtopolis.zip\htpclient\hashcat_cracker.py", line 51, in init
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?

@zyronix zyronix moved this from 🏗 In progress to 👀 In review in Development Plans Feb 27, 2023
@fsacer
Copy link

fsacer commented Feb 28, 2023

same issue here after upgrading to 0.13.0

@zyronix
Copy link
Member

zyronix commented Feb 28, 2023

Workaround is available, downgrade the agent to 0.6.1. Old releases can be found via: https://github.com/hashtopolis/agent-python/releases

  1. Download the old version (0.6.1)
  2. Upload the old version (0.6.1) WebInterface -> Config -> Agent Binaries
  3. Delete the latest version (0.7.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Hashtopolis Agent related bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants