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

Not able to run Caldera in Kali Linux #3056

Open
farhadanwari opened this issue Sep 24, 2024 · 6 comments
Open

Not able to run Caldera in Kali Linux #3056

farhadanwari opened this issue Sep 24, 2024 · 6 comments
Assignees
Labels

Comments

@farhadanwari
Copy link

farhadanwari commented Sep 24, 2024

I am facing an issue with Caldera and am not able to run it on my Kali Linux machine at all.

I tried running Caldera in my Kali Linux machine but unfortunately, it's showing an error while running the server using the python3 server.py --insecure --build
I thought maybe it was because I did not install all the required libraries and packages, however even after installing all the requirements using the pip3 install -r requirements it did not work. I tried installing npm separately using sudo apt install npm and it was successfully installed. However, when I tried to run the server.py, it showed a different error.

Here is the error output that I got:

INFO     Invalid Github Gist personal API token provided. Gist C2 contact will not be started.                                                          contact_gist.py:70
Traceback (most recent call last):
  File "/home/cypher/caldera/server.py", line 298, in <module>
    run_tasks(services=app_svc.get_services(), run_vue_server=args.uiDevHost)
  File "/home/cypher/caldera/server.py", line 80, in run_tasks
    loop.run_until_complete(app_svc.register_contacts())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/cypher/caldera/app/service/app_svc.py", line 150, in register_contacts
    await self.register_contact_tunnels(contact_svc)
  File "/home/cypher/caldera/app/service/app_svc.py", line 155, in register_contact_tunnels
    tunnel_class = import_module(tunnel_module_name).Tunnel
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/cypher/caldera/app/contacts/tunnels/tunnel_ssh.py", line 3, in <module>
    import asyncssh
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/__init__.py", line 31, in <module>
    from .agent import SSHAgentClient, SSHAgentKeyPair, connect_agent
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/agent.py", line 34, in <module>
    from .public_key import KeyPairListArg, SSHCertificate, SSHKeyPair
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/public_key.py", line 35, in <module>
    from .crypto import ed25519_available, ed448_available
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/crypto/__init__.py", line 58, in <module>
    from .x509 import X509Certificate, X509Name, X509NamePattern
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/crypto/x509.py", line 32, in <module>
    from OpenSSL import crypto
  File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 19, in <module>
    from OpenSSL.crypto import (
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1616, in <module>
    class X509StoreFlags:
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1635, in X509StoreFlags
    NOTIFY_POLICY: int = _lib.X509_V_FLAG_NOTIFY_POLICY
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'?

I tried it with my friends' PCs but they had different problems when trying to login into the Caldera dashboard by entering the username and password, it shows an error below the password field as "Not Found....". and it doesn't allow me to log in at all and keeps bringing the login page.

How to fix this? Do I need to change any configurations or install anything else?
image
image
image
image
image

Copy link

Looks like your first issue -- we aim to respond to issues as quickly as possible. In the meantime, check out our documentation here: http://caldera.readthedocs.io/

@farhadanwari
Copy link
Author

farhadanwari commented Sep 24, 2024

I am facing an issue with Caldera and am not able to run it on my Kali Linux machine at all.

I tried running Caldera in my Kali Linux machine but unfortunately, it's showing an error while running the server using the python3 server.py --insecure --build I thought maybe it was because I did not install all the required libraries and packages, however even after installing all the requirements using the pip3 install -r requirements it did not work. I tried installing npm separately using sudo apt install npm and it was successfully installed. However, when I tried to run the server.py, it showed a different error.

Here is the error output that I got:

INFO     Invalid Github Gist personal API token provided. Gist C2 contact will not be started.                                                          contact_gist.py:70
Traceback (most recent call last):
  File "/home/cypher/caldera/server.py", line 298, in <module>
    run_tasks(services=app_svc.get_services(), run_vue_server=args.uiDevHost)
  File "/home/cypher/caldera/server.py", line 80, in run_tasks
    loop.run_until_complete(app_svc.register_contacts())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/cypher/caldera/app/service/app_svc.py", line 150, in register_contacts
    await self.register_contact_tunnels(contact_svc)
  File "/home/cypher/caldera/app/service/app_svc.py", line 155, in register_contact_tunnels
    tunnel_class = import_module(tunnel_module_name).Tunnel
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/cypher/caldera/app/contacts/tunnels/tunnel_ssh.py", line 3, in <module>
    import asyncssh
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/__init__.py", line 31, in <module>
    from .agent import SSHAgentClient, SSHAgentKeyPair, connect_agent
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/agent.py", line 34, in <module>
    from .public_key import KeyPairListArg, SSHCertificate, SSHKeyPair
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/public_key.py", line 35, in <module>
    from .crypto import ed25519_available, ed448_available
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/crypto/__init__.py", line 58, in <module>
    from .x509 import X509Certificate, X509Name, X509NamePattern
  File "/home/cypher/.local/lib/python3.11/site-packages/asyncssh/crypto/x509.py", line 32, in <module>
    from OpenSSL import crypto
  File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 19, in <module>
    from OpenSSL.crypto import (
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1616, in <module>
    class X509StoreFlags:
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1635, in X509StoreFlags
    NOTIFY_POLICY: int = _lib.X509_V_FLAG_NOTIFY_POLICY
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'?

I tried it with my friends' PCs but they had different problems when trying to login into the Caldera dashboard by entering the username and password, it shows an error below the password field as "Not Found....". and it doesn't allow me to log in at all and keeps bringing the login page.

How to fix this? Do I need to change any configurations or install anything else? image image image image image

I have updated my Kali Linux again and now its version is 2023.3. I tried reinstalling the requirements.txt again but now it's showing a different error as shown below:
image
I tried installing the "aiohttp_apispec" manually using pip3 as shown below:
image
Even though it shows that the "aiohttp_apispec" is successfully downloaded and installed it still shows the following error while executing the server.py:
image

@farhadanwari
Copy link
Author

Today I tried to install the requirements again by running pip3 install -r requirements.txt however I got the following error at the end:
image

@uruwhy
Copy link
Contributor

uruwhy commented Sep 30, 2024

In this case you'll want to set up a virtual Python environment to allow different pip requirement contexts.

You can reference the Python documentation for virtual environments as needed, but the gist of it will look something like the following:

# create new virtual environment
python -m venv path/to/new/virtual/environment

# activate your virtual environment
source <venv>/bin/activate

# Install your dependencies
pip3 install -r requirements.txt

@farhadanwari
Copy link
Author

farhadanwari commented Oct 3, 2024

In this case you'll want to set up a virtual Python environment to allow different pip requirement contexts.

You can reference the Python documentation for virtual environments as needed, but the gist of it will look something like the following:

# create new virtual environment
python -m venv path/to/new/virtual/environment

# activate your virtual environment
source <venv>/bin/activate

# Install your dependencies
pip3 install -r requirements.txt

I have followed your instructions and unfortunately, I am getting a new type of error while opening Caldera in my browser.

Here are the steps I followed:

  1. Created a Python virtual env
    image
  2. Activated the env
    image
  3. Installed all the requirements using pip successfully
    image
    image
  4. rerun the server.py as shown below:
    image
    image
  5. However, when I try to open the dashboard in my browser I get the "500 Internal Server Error" error message:
    image
  6. This error appeared in the terminal after I tried to open the dashboard:
    image
    image

Note: I tried using 0.0.0.0:8888, 127.0.0.1:8888, and PRIVATE_IP:8888, but none worked.

What could be the issue and how to fix this?

@uruwhy
Copy link
Contributor

uruwhy commented Oct 3, 2024

This should be fixed in #3063, try pulling from main and seeing if it works then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants