caldera
caldera copied to clipboard
Save & Add button breaks Add an Ability to Adversary window
Describe the bug
When editing an existing Ability of an Adversary Profile (not when adding a new one), when you click the Save & Add button it saves the changes, but you can not close the window and the Close button does not do anything. If we then try to press Save or the Save & Add button, we get an ! Error Saving Ability
error. Therefore, we can not make any more changes or exit this window (even when clicking outside of the pop-up window) and the only way to access the UI again is to refresh the page.
The only error I can find is in the Browser’s Console, where we get the following errors:
Uncaught TypeError: O is undefined
Gn http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
m http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Gn http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
de http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Ir http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Lr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Gn http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
<anonymous> http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
r http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
Cr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Rr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Tr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
ht http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
scheduler http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
l http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
P http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
or http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
saveAbility http://192.168.1.99:8888/#home line 41 > injectedScript:571
promise callback*saveAbility http://192.168.1.99:8888/#home line 41 > injectedScript:566
anonymous http://192.168.1.99:8888/gui/js/lib/alpine.min.js line 3 > AsyncFunction:3
Ir http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Lr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
s http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
o http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
o http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
a http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
alpine.min.js:7:25995
Gn http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
m http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Gn http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
de http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Ir http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Lr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
bind_applyFunctionN self-hosted:1349
Lr self-hosted:1312
Gn http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
<anonymous> http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
r http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
Cr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
(Async: VoidFunction)
Rr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Tr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
ht http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
scheduler http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
l http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
forEach self-hosted:4326
P http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
or http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
saveAbility http://192.168.1.99:8888/#home line 41 > injectedScript:571
(Async: promise callback)
saveAbility http://192.168.1.99:8888/#home line 41 > injectedScript:566
anonymous http://192.168.1.99:8888/gui/js/lib/alpine.min.js line 3 > AsyncFunction:3
Ir http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
Lr http://192.168.1.99:8888/gui/js/lib/alpine.min.js:3
bind_applyFunctionN self-hosted:1349
Lr self-hosted:1312
s http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
o http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
o http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
a http://192.168.1.99:8888/gui/js/lib/alpine.min.js:7
The logs from the docker container at that moment do not contain any error, only the beacons from the 2 agents that I have running:
2022-08-07 16:04:12 - DEBUG (contact_svc.py:64 handle_heartbeat) Incoming HTTP beacon from xlcdou
2022-08-07 16:04:13 - DEBUG (contact_svc.py:64 handle_heartbeat) Incoming tcp beacon from tzkmfz
I am running CALDERA version 4.0.0 (commit 4fe71ac87468e97665f3f26516137a442c7fab32
) with docker-compose up -d
and with no modification to the source code or extra plugins downloaded.
To Reproduce Steps to reproduce the behavior:
- Download CALDERA from GitHub with all submodules and checkout to v4.0.0:
git clone https://github.com/mitre/caldera.git --recursive --branch 4.0.0
- Run CALDERA with
docker-compose
:
docker-compose up -d
- Once started, log in to http://localhost:8888 with the
red
using the password found in theconf/local.yml
file (this file will be generated on server start). - Navigate to the
adversaries
page and select an adversary from the dropdown, e.g.Discovery
. - Click on an existing ability, e.g.
Identify active user
to open theAdd an Ability to Adversary
window. - Click the Save & Add button.
- Try to close the window either with the Close button or by clicking outside the window area.
- Try to click the Save button or the Save & Add button again.
Expected behavior The expected behavior is to be able to close the window after pressing the Save & Add button and not break the functionality of the other buttons in the window.
Screenshots
Click the Save & Add button on an existing Ability of an Adversary Profile :
Trying to click the Save button or the Save & Add button again:
Trying to click the Close button to close the window:
Desktop (please complete the following information):
- OS: Ubuntu 18.04.6 LTS Server, Ubuntu 20.04.4 LTS Server
- Browser: Firefox, Chrome
- Version: 103.0.1, 104.0.5112.81
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/
Hi @thanoskoutr, really appreciate the detailed issue and bringing it to our attention. I was able to replicate the problem locally and have identified the source of it.
Could you please try checking out the branch from this pull request and see if the issue persists? https://github.com/mitre/caldera/pull/2637
If that fixes the issue for you we can get that merged in ASAP.
I checked the branch from the pull request and the issue is now fixed. Thanks for the quick response.
I may face another issue now, but before describing it or opening a new issue I need to verify if it is an issue and if it is relevant to the changes made for the fix.
I will reply in a while in this discussion first.
Ok just checked and the issues I am facing are not relevant to the fix, as they also appear in the 4.0.0
branch.
I will describe them shortly here just to get an opinion and if they are relevant:
- The first issue I have is when I select an Adversary and then an Ability and change a field, e.g. the Name, in the Ability window and I save (either with
Save
andClose
or with theSave & Add
button) I do not see the Name get changed in the abilities list of the select Adversary. I either have to reselect the Adversary from the Dropdown menu or reload the page and navigate back to the Ability. Is this expected? If not I would gladly open a new issue. If it is expected I would suggest an enhancement as it will improve a lot the UI/UX of the Adversaries page. - The second issue is when adding executors, I almost always get errors when saving and the
executor
dropdown list changes values randomly every time I select one. For this, I will open a new issue describing the last one, as it certainly out of scope for this fix.
I was also able to replicate those bugs, thanks again for letting us know. They were fairly easy to patch to please check out the branch again from the PR above and see if those two issues are resolved.
Regarding the latter on #2, it should default to linux as the platform each time but I agree it would make more sense to default to whatever the user had last selected. I'll add that one to our backlog and get that in for a future release.
Ok just checked the new commits from the MR, and the 1st issue is fixed. Great support, thanks!