mitre / caldera

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

Cannot get past login page #2901

Open googlier325 opened 7 months ago

googlier325 commented 7 months ago

Describe the bug Unable to login using default login on port 8888

To Reproduce Steps to reproduce the behavior:

  1. Entered red:admin, admin:admin, blue:admin
  2. Tried passwords on local.yml also

Expected behavior Log into the first screen

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context after launching main.py with debugging, insecure, build

2024-02-25 06:11:36 WARNING --insecure flag set. Caldera will use the default user accounts in default.yml config file. server.py:216 INFO Using main config from conf/default.yml server.py:225 DEBUG Loaded 2 parsers learning_svc.py:20 2024-02-25 06:11:37 INFO Building VueJS front-end. server.py:261

up to date, audited 1071 packages in 2s

153 packages are looking for funding run npm fund for details

1 moderate severity vulnerability

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details.

magma@0.0.0 build node prebundle.js && vite build

Copying all plugin GUI source files to magma Copying over "access" files... Copying over "atomic" files... Copying over "builder" files... Copying over "compass" files... Copying over "debrief" files... Copying over "emu" files... Copying over "gameboard" files... Copying over "human" files... Copying over "manx" files... Copying over "response" files... Copying over "sandcat" files... Copying over "ssl" files... Copying over "stockpile" files... Copying over "training" files... Plugin GUI source files copied! vite v2.9.17 building for production... ✓ 1481 modules transformed. dist/assets/favicon.cc1c341b.ico 69.07 KiB dist/assets/caldera-logo.6a24b35b.png 16.51 KiB dist/assets/caldera-logo-mtn.88f0ff8a.png 36.07 KiB dist/assets/darwin-icon-privileged.ffa7a1c2.svg 0.68 KiB dist/assets/darwin-icon.95280721.svg 0.67 KiB dist/assets/linux-icon-privileged.d1ede01c.svg 3.66 KiB dist/assets/linux-icon.df96f069.svg 3.65 KiB dist/assets/windows-icon-privileged.e4e076e8.svg 0.39 KiB dist/assets/windows-icon.2e7338a5.svg 0.37 KiB dist/index.html 0.46 KiB dist/assets/access.a0a503d9.js 12.71 KiB / gzip: 3.97 KiB dist/assets/atomic.67a3e273.js 1.05 KiB / gzip: 0.62 KiB dist/assets/builder.7f422b3e.js 1.08 KiB / gzip: 0.63 KiB dist/assets/compass.ad30b927.js 5.22 KiB / gzip: 2.22 KiB dist/assets/debrief.166c248a.js 27.75 KiB / gzip: 7.22 KiB dist/assets/emu.40c251f3.js 1.56 KiB / gzip: 0.70 KiB dist/assets/gameboard.01aa0461.js 21.79 KiB / gzip: 6.09 KiB dist/assets/sandcat.e3e90fa8.js 0.68 KiB / gzip: 0.44 KiB dist/assets/human.615d442d.js 11.80 KiB / gzip: 3.46 KiB dist/assets/response.4fea73b3.js 1.60 KiB / gzip: 0.83 KiB dist/assets/manx.d044addc.js 6.11 KiB / gzip: 2.27 KiB dist/assets/stockpile.730486f7.js 1.61 KiB / gzip: 0.76 KiB dist/assets/gameboard.430857df.css 2.01 KiB / gzip: 0.68 KiB dist/assets/compass.4b402f52.css 0.12 KiB / gzip: 0.12 KiB dist/assets/debrief.854158fe.css 0.79 KiB / gzip: 0.34 KiB dist/assets/human.d7b43e12.css 2.31 KiB / gzip: 0.78 KiB dist/assets/response.9692d0ec.css 0.20 KiB / gzip: 0.13 KiB dist/assets/training.9d43ffbb.css 3.86 KiB / gzip: 1.06 KiB dist/assets/manx.fdacbfd3.css 3.11 KiB / gzip: 1.51 KiB dist/assets/training.35b91e34.js 8.51 KiB / gzip: 3.33 KiB dist/assets/access.b689ce59.css 0.32 KiB / gzip: 0.20 KiB dist/assets/ssl.363b7b54.js 0.98 KiB / gzip: 0.62 KiB dist/assets/index.ad437303.css 248.24 KiB / gzip: 33.79 KiB dist/assets/index.b6169022.js 1665.65 KiB / gzip: 535.85 KiB

(!) Some chunks are larger than 500 KiB after minification. Consider:

github-actions[bot] commented 7 months 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/

googlier325 commented 7 months ago

2024-02-25 14:22:04 INFO new connection from 10.0.4.14:54112 server.py:888 2024-02-25 14:22:07 ERROR dispatcher caught exception server.py:964 ╭────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────────────────────────────────╮ │ /usr/local/lib/python3.8/dist-packages/aioftp/server.py:936 in dispatcher │ │ │ │ 933 │ │ │ │ connection.extra_workers -= done │ │ 934 │ │ │ │ for task in done: │ │ 935 │ │ │ │ │ try: │ │ ❱ 936 │ │ │ │ │ │ result = task.result() │ │ 937 │ │ │ │ │ except errors.PathIOError: │ │ 938 │ │ │ │ │ │ connection.response("451", "file system error") │ │ 939 │ │ │ │ │ │ continue │ │ │ │ /usr/local/lib/python3.8/dist-packages/aioftp/server.py:847 in parsecommand │ │ │ │ 844 │ │ """ │ │ 845 │ │ line = await stream.readline() │ │ 846 │ │ if not line: │ │ ❱ 847 │ │ │ raise ConnectionResetError │ │ 848 │ │ s = line.decode(encoding=self.encoding).rstrip() │ │ 849 │ │ cmd, , rest = s.partition(" ") │ │ 850 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ConnectionResetError INFO closing connection from 10.0.4.14:54112

elegantmoose commented 7 months ago

Just confirming, you pulled down Master branch with --recursive flag (to pick up more recent plugins/magma submodule) ?

nizzy714 commented 7 months ago

I had the same issue when pulling with --recursive flag and specifying --branch 5.0.0. However, when omitting a specific branch it worked as intended. Hope this helps.

elegantmoose commented 7 months ago

Master branch is what is getting the patches. Including this fix - https://github.com/mitre/caldera/issues/2881

edenqyb commented 7 months ago

hey, I have the same problem. I pulled master branch(using --recursive) and tried using Safari, Chrome and firefox but still can't login.(the server is on Ubuntu machine and I'm using it remotely using the ip)

aut0exec commented 7 months ago

Experiencing the same issue with a fresh pull of caldera this morning. Used git clone --recursive https://github.com/mitre/caldera.git. Ran though the build instructions in the readme. Get to the login page but typing in any credentials and submitting them results in nothing occurring. I've tried Chrome and Safari from a Mac via Caldera server's IP (Caldera is running on Devuan 5, npm version 9.2.0, golang 1.19).

aut0exec commented 7 months ago

Working now. Looks like I was running into this issue: https://github.com/mitre/caldera/issues/2885#issuecomment-1949646936

Here's what fixed it. 1) cp plugins/magma/.env.template plugins/magma/.env 2) Modified the VITE_CALDERA_URL to reflect the IP and protocol for my setup in plugins/magma/.env. Since I'm using the TLS (SSL) plugin, not running as root, and wanting port 443, I changed the line to VITE_CALDERA_URL=https://<CALDERA_IP> (some iptables things going on in the background to redirect 443 -> 8443) 3) python3 server.py --build

Is there a way to simply use a wildcard here rather than a hardcoded IP? I tried the typical 0.0.0.0 as the but it didn't work.

@edenqyb Sounds like it'll probably be the same issue you're running into from your setup's description.

--- EDIT ---- Looks like you can wildcard it. ReplacedVITE_CALDERA_URL=https://<CALDERA_IP> with simplyVITE_CALDERA_URL=https://. Then rebuilt withpython3 server.py --build and any IP seems to be able to connect to the Web UI now. Not sure if this is intended but it does work!

googlier325 commented 7 months ago

Yep, @elegantmoose can confirm that I am pulling from the master branch

@aut0exec copy and edit the .env file to my actual ip address worked

fitz003 commented 6 months ago

@aut0exec thanks for posting this, I had to make this change as well!

morpheuslord commented 5 months ago

hey, even I am facing this issue: and it is occurring in both Brave and Chrome:

https://github.com/mitre/caldera/assets/70637311/9a6d28ab-d424-41ee-88f4-f31c29087458

ghismo89 commented 5 months ago

Me too and i have tryed everything written here

morpheuslord commented 5 months ago

Here's the inspect console view:

https://github.com/mitre/caldera/assets/70637311/81c5e2e6-8c6f-4f46-b69a-1e807837c79e

ghismo89 commented 5 months ago

Same goes for me, even if i tryed everything that is said here

alketshabani commented 5 months ago

Not sure how you are trying but if it is with --insecure flag the default creds should not work. You should look for the creds that are generated in conf/local.yml

morpheuslord commented 5 months ago

Not sure how you are trying but if it is with --insecure flag the default creds should not work. You should look for the creds that are generated in conf/local.yml

I tried with both and none worked.

chrisytharp commented 5 months ago

has anyone got this working?

morpheuslord commented 5 months ago

I got fed up and am using a previous version of the tool.

chrisytharp commented 5 months ago

i figured out my issue: i ran

  1. npm audit fix --force
  2. cp plugins/magma/.env.template plugins/magma/.env
  3. Modified the VITE_CALDERA_URL to reflect the IP and protocol for my setup in plugins/magma/.env. Since I'm using the TLS (SSL) plugin, not running as root, and wanting port 443, I changed the line to VITE_CALDERA_URL=https:// (some iptables things going on in the background to redirect 443 -> 8443)
  4. python3 server.py --build --insecure
codddddddd commented 5 months ago
  1. python3 server.py --insecure for access the server >>
  2. Reached the caldera sign-in page as a localhost:8888
  3. sign-in as a admin : admin

It's works for me.....

elegantmoose commented 4 months ago

@codddddddd @chrisytharp @morpheuslord @ghismo89 @alketshabani @fitz003 @googlier325 @aut0exec @nizzy714 We believe we fixed this issue with https://github.com/mitre/caldera/pull/2977. And we will now look at dockerfile for any required updates.

We really appreciate the active feedback and user testing.

And of course, reopen issue if still having it.

morpheuslord commented 4 months ago

Sure will check and get back if I find it still persist.

KINGP1N commented 4 months ago

@elegantmoose Unfortunately, the fix you are referring to didn't do it for me. The issue is still present because of the specified host and port values in default.yml ; which appear to be used during the build process (--build) of the frontend components. It basically overwrites the value of VITE_CALDERA_URL in plugins/magma/.env. Specifically here:

filename: server.py

image

If you keep 0.0.0.0 as your host value in default.yml, after initiating, building and launching Caldera, you end up with client-side callbacks that point to: https://0.0.0.0:8888/api/...

This becomes a problem when Caldera is behind a reverse proxy and you have to resort to domain names, commenting out the following line in server.py temporarily fixed it:

273 configure_magma_env_file()

Just make sure to define VITE_CALDERA_URL=https://{example-domain}:{port} correctly in plugins/magma/.env.

abhra101 commented 4 months ago

Fix!

People are trying to access on http://localhost:8888, just type http://0.0.0.0:8888 and it will work.

morpheuslord commented 4 months ago

Fix!

People are trying to access http://localhost:8888, just type http://0.0.0.0:8888 and it will work.

I guess not, image

image

I am trying to find out what is the issue but am not able to determine anything specific. I also tried this:

Just make sure to define VITE_CALDERA_URL=https://{example-domain}:{port} correctly in plugins/magma/.env.

Still no luck

abhra101 commented 4 months ago

Fix! People are trying to access http://localhost:8888, just type http://0.0.0.0:8888 and it will work.

I guess not, image

image

I am trying to find out what is the issue but am not able to determine anything specific. I also tried this:

Just make sure to define VITE_CALDERA_URL=https://{example-domain}:{port} correctly in plugins/magma/.env.

Still no luck

stop using chrome use firefox

morpheuslord commented 4 months ago

Fix! People are trying to access http://localhost:8888, just type http://0.0.0.0:8888 and it will work.

I guess not, image image I am trying to find out what is the issue but am not able to determine anything specific. I also tried this:

Just make sure to define VITE_CALDERA_URL=https://{example-domain}:{port} correctly in plugins/magma/.env.

Still no luck

stop using chrome use firefox

Am I missing out on something here:

image

image

image

image

image

For better scope, I tried it with both localhost, 127.0.0.1 (just in case) and 0.0.0.0 but they did not work.

solidshadw commented 3 months ago

@morpheuslord Did you ever figure out what the issue was? I'm experiencing this with the docker build

morpheuslord commented 3 months ago

@morpheuslord Did you ever figure out what the issue was? I'm experiencing this with the docker build

Na man I am using an older release for my tests .

Still working on it though, but no leads.

ghismo89 commented 3 months ago

you have tried with the admin admin credentials? and the other without the insecure or build flag

morpheuslord commented 3 months ago

you have tried with the admin admin credentials? and the other without the insecure or build flag

Yes, I have tried all possible combinations with and without clearing cache and cookies.

njammy commented 3 months ago

http://0.0.0.0:8888

this work for me, thank guy

solidshadw commented 3 months ago

I can't use the 0.0.0.0 or localhost, because I'm accessing the GUI from another computer. I'm changing the IP in the conf/default.yml and its still not working and it breaks. Not sure if the there's a different work around?

morpheuslord commented 3 months ago

can you document your env that we can try recreate

abhra101 commented 3 months ago

bro morpheus when you run caldera server are u running insecure build or normal? if you are using insecure build, try running without the insecure build option then open locals.yml, use login for red username and passwork as mentioned for red user.

On Tue, 11 Jun 2024 at 9:25 PM, morpheuslord @.***> wrote:

can you document your env that we can try recreate

— Reply to this email directly, view it on GitHub https://github.com/mitre/caldera/issues/2901#issuecomment-2161106629, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCX75TGTL7Y4Q4U4B7HQJLZG4MWBAVCNFSM6AAAAABDYTOWMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRRGEYDMNRSHE . You are receiving this because you commented.Message ID: @.***>

morpheuslord commented 3 months ago

bro morpheus when you run caldera server are u running insecure build or normal? if you are using insecure build, try running without the insecure build option then open locals.yml, use login for red username and passwork as mentioned for red user. On Tue, 11 Jun 2024 at 9:25 PM, morpheuslord @.> wrote: can you document your env that we can try recreate — Reply to this email directly, view it on GitHub <#2901 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCX75TGTL7Y4Q4U4B7HQJLZG4MWBAVCNFSM6AAAAABDYTOWMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRRGEYDMNRSHE . You are receiving this because you commented.Message ID: @.>

well I did that but still nothing worked.

Asif644 commented 3 months ago

@morpheuslord Did you ever figure out what the issue was? I'm experiencing this with the docker build

Na man I am using an older release for my tests .

Still working on it though, but no leads.

@morpheuslord can you mention which release you are using now?

morpheuslord commented 3 months ago

@morpheuslord Did you ever figure out what the issue was? I'm experiencing this with the docker build

Na man I am using an older release for my tests . Still working on it though, but no leads.

@morpheuslord can you mention which release you are using now?

I am using 4.2.0

cyberjack256 commented 2 months ago

Im experiencing the same issue same version. Accessing from a separate virtual machine than the install. For reference, I'm accessing via http://ip.of.the.host:8888 on the distant VM.

mdarri commented 2 months ago

I can get 4.2.0 to work without issue, 5.0.0 does not, I get to the log on and enter red/admin and nothing, yes, I did build insecure... this is so frustrating that none of the suggestions work

elegantmoose commented 2 months ago

Use Master not v5.0.0, it's buggy

decyphertek-io commented 1 month ago

Solution Using Python Method:

I ran into a similar issue and decided to provide some more detail on how to solve the problem.

npm audit fix --force vim /caldera/conf/local.yml

app.contact.http: http://SERVER-IP:8888 app.frontend.api_base_url: http://SERVER-IP:8888

vim /caldera/plugins/magma/.env VITE_CALDERA_URL=http://SERVER-IP:8888

python3 server.py --build --fresh

cat /caldera/conf/local.yml

find passwords to login.


* If you are having issues, you can delete caldera directory and git clone caldera again.
* If you made many changes, sometimes there can be build errors. This will solve that. 
*  I found changing all the 0.0.0.0 and localhost in local.yml breaks things. For example 7010 & 2222
balu0000000 commented 1 month ago

run this in your caldera folder

find . -type f -exec grep -l "http://localhost:8888/" {} \; | xargs -I {} sed -i "s/http:\/\/localhost:8888/http:\/\/FILLYOURIPADDRESS:8888/g" {}

D47K-0v3771D3 commented 1 week ago

run this in your caldera folder

find . -type f -exec grep -l "http://localhost:8888/" {} ; | xargs -I {} sed -i "s/http://localhost:8888/http://FILLYOURIPADDRESS:8888/g" {}

This worked for me...Thanks homie

brahian035 commented 1 week ago

I had the same problem to solve it I did the following -->

If you installed Mitre Caldera with Docker when you run the following command from the documentation add it -E default With this option you will define the default configuration of the default file the command it would look like this: docker run -p 8888:8888 caldera:latest -E default caldera_mitre If you run the command like this you will be able to log in to http://localhost:8888/ without any problems