Nebula

Cloud C2 Framework, which at the moment offers reconnaissance, enumeration, exploitation, post exploitation on AWS, but still working to allow testing other Cloud Providers and DevOps Components.

Nebula started as a project to unify all Cloud + DevOps Pentest and Security Techniques for a better assessment of the Infrastructures. It is build with modules for each provider and each functionality. As of April 2021, it only covers AWS, but is currently an ongoing project and hopefully will continue to grow to test GCP, Azure, Kubernetes, Docker, or automation engines like Ansible, Terraform, Chef, etc.

Currently covers:

  • S3 Bucket name bruteforce

  • IAM, EC2, S3, STS and Lambda Enumeration

  • IAM, EC2, STS, and S3 exploitation

  • SSM Enumeration + Exploitation

  • Custom HTTP User-Agent

  • Enumerate Read Privileges (working on write privs)

  • Reverse Shell

  • No creds Reconnaisance

There are currently 67 modules covering:

  • Reconnaissance

  • Enumeration

  • Exploit

  • Cleanup

  • Reverse Shell

Installation

Docker

From Dockerhub

Clone the Nebula Repo from Github and pull Nebula Docker image:

and then run main.py through:

Remember to not forget -v option, because it allows files to be saved on the system even after removing the docker image.

Using DockerFile

Clone the Nebula Repo from Github and build Docker image locally:

then run main.py through:

Remember to not forget -v option, because it allows files to be saved on the system even after removing the docker image.

Adding port mapping

If you want to run a shell, also add the -p option:

Installed on System

Nebula is coded in python3.8 and tested on python3.8 and 3.9. It uses boto3 library to access AWS. To install, just install python 3.8+ and install libraries required from requirements.txt

Then install session-manager-plugin. This is needed for SSM modules:

On windows devices, since less is not installed, I got one from https://github.com/jftuga/less-Windows The prebuilt binary is saved on directory less_binary. Just add that directory to the PATH environment variable and it will be ok.

Then just run main.py

Usage

Help

Running help command, will give you a list of the commands that can be used:

Enum Privs

When you have a set of credentials, you can enter getuid to get the user or enum_user_privs to check the Read permission of a set of credentials.

GetUID

If the creds do not have the below privs on himself,

you will get an error:

Enum_User_Privs

This command checks List and Describe Privileges on a set of credentials.

Modules

Listing modules

You can list all the modules or specific module:

And like that you can use:

Searching for modules

Use search command to search modules with a specific word:

Using Modules

To use a module, just type use and the name of the module. The 3 brackets will have the name of the module.

Options

Using options, we can list the information on the module:

To set options, use set and the name of the option:

Also unsetting them, using unset.

Running the module

To run the module, if it requires credentials, you will need to have imported a set of credentials with the permission required to run it. This is shown on a module's options as:

To run it, just enter run. Depending on the output, it will either show a pagainated view, or just print it. The pagination, uses less binary, which for Windows uses the binary from https://github.com/jftuga/less-Windows. A copy of the exe is on less_binary directory. The output is also saved on files on the workspace directory:

Credentials

Inputing Credentials

Nebula can use both AccessKeyID + SecretKey combination and AccessKeyID + SecretKey+SessionKey combination to authenticate into the infratructure. To insert a set of credentials, use:

And you will get some inputs allowing you to set them. Session token can be added when entering credentials, by inputing y when asked Do you also have a session token?[y/N].

Using Credentials

To use another credential, just enter:

Current Credentials

When you enter the credentials, they are automatically made the current credentials, meaning the ones you will authenticate with. To check the current credentials, use:

Removing Credentials

In case you don't want your credentials, you can can remove them using:

Dumping and importing credentials

In case you want your credentials saved on the machine, you can use:

And they will be saved on a file containing the time and date of the dump on directory credentials on Nebula directory. To import them, just enter:

Workspaces

Nebula uses workspaces to save the output from every command. The output is saved as json data (except for s3_name_fuzzer which saves it as XML) on a folder created on directory workspaces.

Create Workspaces

To create one, enter:

When created, the first brackets will contain the name of the workspace you are working at. If you want to use an existing workspace, just type:

Workspaces are required to be used, so even if you are not using any at the moment, while running a module, it will ask you to create one with random name or to just create one with a custom name yourself.

List workspaces

To get a list of workspaces, use:

Remove Workspaces

To remove a workspace, enter:

Reverse Shell

To create a Reverse Shell, you need to create a stager and run a listener. To use this feature, you need to have Nebula run as root (to open ports).

Stager

To generate a stager, use modules on stagers:

The options to fill are:

  • HOST: The IP or domain of the C2 Server

  • Port: The C2 Server Port

  • Format: Currently only supports python raw file and elf binary

  • Callback-Time: The time in seconds for which the sessions should call back. It calls back even if a current session is up, and even if the server crushes or is closed, so that you don't loose access to the machine.

  • Output File Name: The name of the output file.

Running the module will generate a stager saved on ./workspaces/workspacename/stagername

Listener

The listener is simple. Just configure Host (by default set to 0.0.0.0) and Port and it creates the server. To run the listener, you need to have Nebula run as root.

User Agents

User agents can be set as linux ones, windows ones or custom. To show them, just use show.

To unset a user agent, enter:

Which will have the system's user agent.

Last updated

Was this helpful?