hashtopolis/server

[BUG]: Command 'wmic cpu get name' returned non-zero exit status 1.

Opened this issue ยท 1 comments

Version Information

hashtopolis/backend:latest sha256:22be0c644c3eff473b5bc10c99f360659de8aed74bc1c2a719d3e49baeb5f00e

Hashcat

6.2.6

Description

Description:

The Hashtopolis client fails to run on my Windows 11 system due to an issue with the wmic command. The error occurs when the client tries to retrieve CPU information using wmic. However, wmic is deprecated and no longer available on modern Windows 11 installations. This results in a subprocess.CalledProcessError.

Steps to Reproduce:

  1. Download agent.zip
  2. Run python main.py on a Windows 11 system.
  3. Observe the error.

Output

~\Downloads\hashtopolis(1) via ๐Ÿ v3.12.7
โฏ python .\__main__.py
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.2.4'...
Collecting agent data...
Der Befehl "wmic" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Traceback (most recent call last):
  File "C:\Users\ceddi\Downloads\hashtopolis(1)\__main__.py", line 377, in <module>
    init(args)
  File "C:\Users\ceddi\Downloads\hashtopolis(1)\__main__.py", line 164, in init
    Initialize().run(args)
  File "C:\Users\ceddi\Downloads\hashtopolis(1)\htpclient\initialize.py", line 25, in run
    self.__update_information()
  File "C:\Users\ceddi\Downloads\hashtopolis(1)\htpclient\initialize.py", line 107, in __update_information
    output = subprocess.check_output("wmic cpu get name", shell=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ceddi\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ceddi\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'wmic cpu get name' returned non-zero exit status 1.

Fatfetch

~ via ๐Ÿ v3.12.7
โฏ fastfetch
/////////////////  /////////////////    ceddi@desktop
/////////////////  /////////////////    -------------
/////////////////  /////////////////    OS: Windows 11 (Pro) x86_64
/////////////////  /////////////////    Host: MS-7B86 (5.0)
/////////////////  /////////////////    Kernel: WIN32_NT 10.0.26100.2454 (24H2)
/////////////////  /////////////////    Uptime: 3 hours, 14 mins
/////////////////  /////////////////    Packages: 2 (choco)
/////////////////  /////////////////    Shell: Windows PowerShell 5.1.26100.2161
                                        Display (BenQ G2410HD): 1920x1080 @ 60 Hz in 23" [External]
/////////////////  /////////////////    Display (BenQ GL2450): 1920x1080 @ 60 Hz in 24" [External] *
/////////////////  /////////////////    DE: Fluent
/////////////////  /////////////////    WM: Desktop Window Manager
/////////////////  /////////////////    WM Theme: Custom - Blue (System: Dark, Apps: Dark)
/////////////////  /////////////////    Icons: Recycle Bin
/////////////////  /////////////////    Font: Segoe UI (12pt) [Caption / Menu / Message / Status]
/////////////////  /////////////////    Cursor: Windows-Voreinstellung (32px)
/////////////////  /////////////////    Terminal: Windows Terminal 1.21.3231.0
                                        Terminal Font: Cascadia Mono (12pt)
                                        CPU: AMD Ryzen 5 5600 (12) @ 4,45 GHz
                                        GPU 1: NVIDIA GeForce GTX 970 (3,94 GiB) [Discrete]
                                        GPU 2: NVIDIA GeForce RTX 2070 SUPER (7,80 GiB) [Discrete]
                                        Memory: 16,90 GiB / 47,93 GiB (35%)
                                        Swap: 0 B / 3,00 GiB (0%)
                                        Disk (C:\): 227,07 GiB / 442,47 GiB (51%) - NTFS
                                        Disk (D:\): 68,26 GiB / 100,00 GiB (68%) - FAT32
                                        Disk (E:\): 115,91 GiB / 488,28 GiB (24%) - NTFS
                                        Disk (F:\): 34,51 GiB / 111,77 GiB (31%) - NTFS
                                        Disk (G:\): 389,02 GiB / 465,75 GiB (84%) - NTFS
                                        Local IP (Ethernet): 192.168.178.91/24
                                        Locale: de-DE

Thanks for your detailed bug report. I think the best solution for this would be to use python code to determine the cpu architecture when on windows. For example use the platform.processor() function. That way we wont be reliant on which windows version is being used.