mitre / caldera

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

hardcoded URL localhost:8888 #2946

Open elruedas-ops opened 2 months ago

elruedas-ops commented 2 months ago

Describe the bug by default all work fine. After change the bind port in conf/production.yml (my conf file): app.contact.http: http://caldera:9999 port: 9999

when I get http://10.0.4.6:9999/login and introduce user/pass nothing happened. If I debug the requesta made by de browser I find a js (index246d96ad.js) asking for http://localhost:8888/api/v2/config/main net::ERR_CONNECTION_REFUSED

the JS has this code inside: let g = ${{}.VITE_CALDERA_URL || "http://localhost:8888"}/file/download_exfil?file=${btoa(v)} const d = (await r.get(http://localhost:8888/plugin/${e.pluginName}/gui)).data

I tried to find references in all files for VITE_CALDERA_URL and change all to point the port 9999. for example: ./plugins/magma/.env.template:VITE_CALDERA_URL=http://localhost:9999

To Reproduce Steps to reproduce the behavior:

  1. install in a docker following the oficial gide
  2. chage the conf/production.yml (my conf file): app.contact.http: http://caldera:9999 port: 9999

docker-compose.yml: version: '3'

services: caldera: build: context: . dockerfile: Dockerfile args: TZ: "UTC" #TZ sets timezone for ubuntu setup WIN_BUILD: "true" #WIN_BUILD is used to enable windows build in sandcat plugin image: caldera:server-v2.2 ports:

  1. docker compose build --no-cache
  2. docker compose up Expected behavior A clear and concise description of what you expected to happen.

Screenshots image

image

image

Desktop (please complete the following information):

Additional context I think that there are certain lines hardcoded with the port 8888

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

Guil33 commented 2 months ago

Sounds like #2885, you need to change the conf and rebuild, that should solve your issue.

plaskur-365-bank commented 2 months ago

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

github-actions[bot] commented 4 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days