Giter Site home page Giter Site logo

cohab_processes's Introduction

Cohab_Processes

This Aggressor script is intended to help internal Red Teams identify suspicious or foreign processes ("Cohabitation") running in their environments.

Red Teams may assemble a list of "known" processes (either independently or in collaboration with Blue force) and feed it to the aggressor script. This list of processes might include those seen "at least x times in our network" in order to establish a baseline. Once the script has been loaded into CobaltStrike, beacon output will be altered/color coded for the following commands:

  1. shell tasklist
  2. ps
  3. TrustedSec's tasklist BOF (You do not have to use this BOF, but it is highly recommended)

Any processes returned as output from the above commands that are NOT found on the "known" processes list will be highlighted in RED for further investigation/scrutiny.

shell tasklist:

image

ps:

image

TrustedSec tasklist BOF:

image

Setup

The list of known processes must be in a text file, one process per line.
Edit line 3 in Cohab_Processes.cna and specify your list of "known" processes.
Load the .cna script into CobaltStrike and enjoy.

I have included 'knownprocesses.txt' as an example so that users can observe the behaviour of this script before going to the effort to assemble the list of "known" processes in their environment.

TrustedSec Tasklist BOF

A small modification is required to TrustedSec's tasklist BOF in order to make it compatible with this script. I had to effectively add a "end of BOF" tag to the output in order for the Aggressor script to identify that the BOF was done sending output and to stop trying to read/color code things.

image

I recommend grabbing the full package from their repo and then modifying the tasklist BOF (CS-Situational-Awareness-BOF/src/SA/tasklist/entry.c) to match the one I have included here. This is necessary because the full repo contains some helper/header files that you will need to recompile entry.c.

Limitations

This methodology for identifying potential cohabitation IS severely limited. It will not for example identify or catch things like:

  1. Process injection- where malware has been injected into and is running in a legitimate, "known" process.
  2. DLL sideloading or hijacking- where malware has been loaded by a legitimate, "known" process by residing in a DLL that the process loads/runs.

This script serves as a way to help catch the "low hanging fruit".

Credit

Thanks to TrustedSec for their great BOF repo Inspiration and some code snippets taken from harleyQu1nn's ProcessColor.cna

cohab_processes's People

Contributors

octoberfest7 avatar

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.