f0cker / crackq

CrackQ: A Python Hashcat cracking queue system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot add user ID via UI with SQL auth - TypeError: post() missing 1 required positional argument: 'user_id'

hkelley opened this issue · comments

Describe the bug
Cannot add user ID via UI with SQL auth

To Reproduce
Steps to reproduce the behavior:

image
image

Expected behavior
SQL-based user ID is created

Debug output

ERROR    app.py:1892 log_exception 2023-07-31 19:51:49,207 Exception on /api/admin/ [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 163, in dispatch_request
    return meth(*args, **kwargs)
  File "/opt/crackq/build/crackq/cq_api.py", line 390, in wrap
    return func(args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
TypeError: post() missing 1 required positional argument: 'user_id'

commented

I don't have this issue. I fixed it before moving from dev, I think your JS gui might be cached from using the dev branch. Can you check your browser dev tools to see if you're loading /js/app.dcad8ee7.js? You may have an older version there.

commented

Also I'm not sure how you're using python3.6, it should be 3.8 now. Which build did you use docker/nvidia/centos maybe?

My UI loads /js/app.e79626a4.js, regardless of what browser I use.

Yes, I'm using NVIDIA GPUs on centos.

I'm not very Docker savvy - how do I get up to Python 3.8? Could this Python version also explain these _pickle.UnpicklingError: invalid load key, '{'. issues, which have reappeared?

ERROR    app.py:1892 log_exception 2023-08-01 10:36:55,358 Exception on /api/queuing/all [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 163, in dispatch_request
    return meth(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/opt/crackq/build/crackq/cq_api.py", line 840, in get
    cur_list = started.get_job_ids()
  File "/usr/local/lib/python3.6/site-packages/rq/registry.py", line 97, in get_job_ids
    self.cleanup()
  File "/usr/local/lib/python3.6/site-packages/rq/registry.py", line 139, in cleanup
    connection=self.connection)
  File "/usr/local/lib/python3.6/site-packages/rq/job.py", line 309, in fetch
    job.refresh()
  File "/usr/local/lib/python3.6/site-packages/rq/job.py", line 541, in refresh
    self.restore(data)
  File "/usr/local/lib/python3.6/site-packages/rq/job.py", line 517, in restore
    self.meta = self.serializer.loads(obj.get('meta')) if obj.get('meta') else {}
_pickle.UnpicklingError: invalid load key, '{'.

commented

Ah I haven't updated the CentOS build, since it's now EoL I believe. Use docker/nvidia/ubuntu build instead. For the GUI, you should have app.dcad8ee7.js in your ./dist/js/ directory. If you're building from a directory where you had a previous install, you may need to remove the ./build directory as well.

Apologies if I'm being dense. I just ran this sequence and I still see Python 3.6 in the stack trace.

sudo /usr/libexec/docker/cli-plugins/docker-compose -f docker-compose.nvidia.yml down

sudo git status
On branch master
Your branch is up to date with 'origin/master'.

sudo mv build build.OLD-CENTOS   
sudo ./install.sh docker/nvidia/ubuntu    
sudo /usr/libexec/docker/cli-plugins/docker-compose -f docker-compose.nvidia.yml up -d

This file still mentions image: "nvidia-centos". Could that be related to this?

https://github.com/f0cker/crackq/blob/3155f0960fe009e177f5d677adee16ce8a5eac22/docker-compose.nvidia.yml#L18C25-L18C25

If the CentOS images are EOL then this page should probably be updated.

https://github.com/f0cker/crackq/wiki/Install-on-CentOS#installation

commented

Yup that'll be the problem, can you modify nvidia-centos to nvidia-ubuntu and check if it runs properly? I don't have an nvidia box setup to test at the moment. I'll push the change to master if it works OK. If not I'll have to setup a cloud vm to debug.

Starts up and renders the UI but seems to fail when submitting a job. I'll go back to the nvidia-centos image for now.

INFO     run_hashcat.py:116 runner 2023-08-01 16:22:29,933 Running hashcat
ERROR    run_hashcat.py:188 runner 2023-08-01 16:22:29,960 Speed check failed: RuntimeError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/rq/worker.py", line 1418, in perform_job
    rv = job.perform()
  File "/usr/local/lib/python3.8/dist-packages/rq/job.py", line 1222, in perform
    self._result = self._execute()
  File "/usr/local/lib/python3.8/dist-packages/rq/job.py", line 1259, in _execute
    result = self.func(*self.args, **self.kwargs)
  File "/opt/crackq/build/crackq/run_hashcat.py", line 988, in show_speed
    hcat = runner(hash_file=hash_file, mask=mask,
  File "/opt/crackq/build/crackq/run_hashcat.py", line 159, in runner
    hc.hashcat_session_execute()
SystemError: <method 'hashcat_session_execute' of 'pyhashcat.hashcat' objects> returned a result with an error set

image