Code Monkey home page Code Monkey logo

Comments (22)

unkempthenry avatar unkempthenry commented on May 20, 2024 1

In caldera/conf there's a settings.yaml file where the SSL cert and private key can be specified. By default these live in caldera/conf/cert.pem and caldera/conf/key.pem respectively.

Running the commandline specified in the logging output should generate the needed pem files openssl req -new -x509 -days 3652 -subj /CN='hostname --fqdn'/OU= ervers/O='hostname -d'/C=US -nodes -out conf/cert.pem -keyout conf/key.pem .

However, I think newer versions of openssl might throw an error at that line because it's missing a newly required agument. If that happens you can run openssl req -new -x509 -days 3652 -nodes -out conf/cert.pem -keyout conf/key.pem and follow the interactive prompt to fill out all the fields.

from caldera.

unkempthenry avatar unkempthenry commented on May 20, 2024

Check your python version. You need 3.5+ . Check out the installation instructions here https://caldera.readthedocs.io/en/latest/installation.html

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

my mistake I had python 3 and 2 both installed and accidentally ran with 2. I am getting a new error now.

File "C:\Users\John\AppData\Local\Programs\Python\Python37\lib\site-packages\p
ymongo\helpers.py", line 210, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: Oplog collection reads are not allowed while in
the rollback or startup state.

from caldera.

dm-mitre avatar dm-mitre commented on May 20, 2024

@mgraf2 what version of mongodb and pymongo are you using?

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

pymongo 3.5.1, and mongodb version 4.0.

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

I was able to get past that with a lower version of mongodb, but now I am getting the following error:

C:\Users\John\Desktop\caldera-master 2\caldera>C:\Users\John\AppData\Local\Progr
ams\Python\Python37\python.exe caldera.py
Enter PEM pass phrase:DEBUG:app.server:Planner has started
DEBUG:asyncio:Using selector: SelectSelector
INFO:app.server:Planner closed
Process Process-1:
Traceback (most recent call last):
File "C:\Users\John\AppData\Local\Programs\Python\Python37\lib\site-packages\m
ongoengine\queryset\queryset.py", line 95, in _iter_results
raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\John\AppData\Local\Programs\Python\Python37\lib\multiprocessing
\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\John\AppData\Local\Programs\Python\Python37\lib\multiprocessing
\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\John\Desktop\caldera-master 2\caldera\app\server.py", line 165,
in sigint_handler
target()
File "C:\Users\John\Desktop\caldera-master 2\caldera\app\server.py", line 306,
in planner_process
loop.run_until_complete(start_operations(rebuild_mappings))
File "C:\Users\John\AppData\Local\Programs\Python\Python37\lib\asyncio\base_ev
ents.py", line 568, in run_until_complete
return future.result()
File "C:\Users\John\Desktop\caldera-master 2\caldera\app\updates.py", line 71,
in start_operations
for step in CodedStep.objects(name__nin=[x.name for x in operation_steps
.all_steps]):
RuntimeError: generator raised StopIteration

from caldera.

unkempthenry avatar unkempthenry commented on May 20, 2024

@mgraf2 Would you mind trying this with Python 3.6? I know I said 3.5+ earlier, but I'd like to rule out python version as the cause here.

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

I can try that, I am now seeing this I think I am closer. What config file do I add this to?

INFO:app.server:No SSL certificate or key found. Generating a self-signed SSL c
rtificate for you.
'openssl' is not recognized as an internal or external command,
operable program or batch file.
ERROR:app.server:Could not locate certificate chain. Please generate with opens
l and add to configuration file.
e.g. 'openssl req -new -x509 -days 3652 -subj /CN='hostname --fqdn'/OU=
ervers/O='hostname -d'/C=US -nodes -out conf/cert.pem -keyout conf/key.pem'

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

I finally got it to work, thank you for all your help!

from caldera.

unkempthenry avatar unkempthenry commented on May 20, 2024

@mgraf2 nice! Did you wind up switching to Python 3.6?

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

Yes I wound up switching to python 3.6, also didn't realize when running caldera.py it was asking for pem password which is printed to the cmd prompt but it gets hidden by a bunch of other stuff thats printed out; probably should have it wait for user to input pem password before continuing. I kept hitting enter without realizing it was asking for pem password and then it would exit with the error code. Can we expect other adversaries to be added to Caldera in a future update or is the user expected to add these on their own?

from caldera.

w0rk3r avatar w0rk3r commented on May 20, 2024

I'm trying to run caldera on a centos, all dependencies installed and python3.6, getting the first error

pymongo.errors.OperationFailure: Oplog collection reads are not allowed while in the rollback or startup state.

Any tip to get this solved and running?

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

I switched to Mongodb 3.0.1, and that seemed to do the trick.

from caldera.

dm-mitre avatar dm-mitre commented on May 20, 2024

@mgraf2 has the solution. We're currently working on MongoDB 4.0 support

from caldera.

w0rk3r avatar w0rk3r commented on May 20, 2024

Oh, so that's it...i will try, thank you guys :D

from caldera.

ericgatm4 avatar ericgatm4 commented on May 20, 2024

@dm-mitre want to be clear I must use MongodB3.6 not 4.0 as it's not supported yet. It looks the only download on Mongodb site is 4.0 though

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

Download here, i think I used 3.5.

https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl?_ga=2.51450720.857413503.1532134468-1839883456.1532134468

from caldera.

mgraf2 avatar mgraf2 commented on May 20, 2024

3.01 rather

from caldera.

ericgatm4 avatar ericgatm4 commented on May 20, 2024

from caldera.

dm-mitre avatar dm-mitre commented on May 20, 2024

@mgraf2 @ericgatm4 @w0rk3r We pushed some updates to support MongoDB 4.0 and also a docker-compose script which should make installation and running much easier. Let us know if you have any problems.

from caldera.

stevenbrz avatar stevenbrz commented on May 20, 2024

@dm-mitre
It seems like the current build is incompatible with Python 3.7 as I ran into the following until downgrading to Python 3.6.x


Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\mongoengine\queryset\queryset.py", line 95, in _iter_results
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\caldera-master\caldera\app\server.py", line 127, in run
    web_process(settings, debug)
  File "C:\Users\Administrator\Desktop\caldera-master\caldera\app\server.py", line 250, in web_process
    for connection in ActiveConnection.objects:
RuntimeError: generator raised StopIteration

DEBUG:app.server:Planner has started
INFO:app.server:Loading default ATT&CK definitions
Process Process-1:
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\mongoengine\queryset\queryset.py", line 95, in _iter_results
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
    self.run()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Administrator\Desktop\caldera-master\caldera\app\server.py", line 168, in sigint_handler
    target()
  File "C:\Users\Administrator\Desktop\caldera-master\caldera\app\server.py", line 303, in planner_process
    attack.load_default(attack_mappings)
  File "C:\Users\Administrator\Desktop\caldera-master\caldera\app\attack.py", line 90, in load_default
    for db_tech in AttackTechnique.objects:
RuntimeError: generator raised StopIteration

from caldera.

unkempthenry avatar unkempthenry commented on May 20, 2024

@stevenbrz , I've updated the version of mongoengine pinned in requirements.txt . I believe this will fix the error you received above running under Python 3.7.

from caldera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.