mitre / caldera

Automated Adversary Emulation Platform
https://caldera.mitre.org
Apache License 2.0
5.54k stars 1.05k forks source link

Not able to run Caldera in Kali Linux #3056

Open farhadanwari opened 6 days ago

farhadanwari commented 6 days ago

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

github-actions[bot] commented 6 days ago

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 commented 6 days ago

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 commented 5 days ago

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 commented 8 minutes ago

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