Giter Club home page Giter Club logo

guardicore / monkey Goto Github PK

View Code? Open in Web Editor NEW
6.5K 241.0 762.0 85.85 MB

Infection Monkey - An open-source adversary emulation platform

Home Page: https://www.guardicore.com/infectionmonkey/

License: GNU General Public License v3.0

Python 72.58% Batchfile 0.10% CSS 4.39% HTML 0.04% JavaScript 7.80% Shell 1.50% PowerShell 1.19% HCL 1.95% Starlark 0.01% SCSS 0.85% TypeScript 9.53% Dockerfile 0.04% Java 0.01% Makefile 0.02%
penetration-testing security-tools security-automation infection-monkey adversary-emulation

monkey's Introduction

Infection Monkey

GitHub release (latest by date)

Build Status codecov

GitHub stars GitHub commit activity

Welcome to Infection Monkey! We're glad you could swing by.๐Ÿ’ Here's all the info you'll need to start monkeying around.

What is Infection Monkey?

Infection Monkey is an open-source adversary emulation platform that helps you improve your security posture using empirical data. The Monkey uses various methods to self-propagate across a network and reports its activities to a centralized command and control server known as the Monkey Island. ๐Ÿต๐Ÿ๏ธ You know, like malware, but โœจsafe.โœจ

How does it work?

Infection Monkey is comprised of two components:

  • Agent - A configurable network worm that can infect machines, steal data, and deliver payloads.
  • Monkey Island - A command and control server used to control and visualize the Infection Monkey's progress throughout the simulation.

Build up your malware antibodies ๐Ÿ’‰

Malware Vaccine

You can think of Infection Monkey as a kind of "malware vaccine." Prior to the invention of mRNA vaccines, biological vaccines worked as follows:

  1. Collect a sample of the virus.
  2. Through the magic of chemistry, create a weakened or inert form of the virus.
  3. Inject the weakened virus into the human body, allowing the immune system to build up a defense.

Once the immune system has built up a defense, it can recognize and fight off the real pathogen if it should ever infect the body.

Infection Monkey aims to use this same approach to combat computer viruses (or other types of malware.)

  1. Collect a sample of the malware.
  2. Analyze the malware and understand its behaviors.
  3. Modify Infection Monkey's configuration to enable behaviors that closely mimic those of the malware, but without causing damage to the target systems.
  4. Inject the Monkey Agent into the network and validate (empirically) that your security controls can detect, prevent, or otherwise mitigate the infection.
  5. If the infection is not successfully thwarted, take the necessary steps to "build up your immune response" by improving your security tools, policies, and processes.

Sun Tzu said, "if you know others and know yourself, you will not be imperiled in a hundred battles." Knowledge of both your adversary's tactics and your own defensive capabilities is necessary in order to successfully secure a network. Infection Monkey aims helps you to know both.

Be the chimpion of your network. Learn more about the Monkey at akamai.com/infectionmonkey.

Screenshots

Infection Map

Security report

Main Features

The Infection Monkey uses the following techniques and exploits to propagate to other machines.

  • Multiple propagation techniques:
    • Predefined passwords
    • Common logical exploits
    • Password stealing using Mimikatz
  • Multiple exploit methods:
    • Log4Shell
    • RDP
    • SSH
    • SMB
    • WMI
    • and more, see our documentation hub for more information.

Setup

Check out the Setup page and the Getting Started guide in our documentation.

The Infection Monkey supports a variety of platforms, documented in our documentation hub.

Building the Monkey from the source

To deploy the development version of Monkey you should refer to readme in the deployment scripts folder or follow the documentation in the documentation hub.

Build status

Branch Status
Develop Build Status
Master Build Status

Tests

Unit Tests

In order to run all of the Unit Tests, run the command pytest in the monkey directory.

To get a coverage report, first make sure the pytest-cov package is installed using pip install pytest-cov. Run the command pytest --cov-report=html --cov . in the monkey/ directory. The coverage report can be found in htmlcov/index.html.

Blackbox tests

In order to run the Blackbox tests, refer to envs/monkey_zoo/blackbox/README.md.

License

Copyright (c) Guardicore Ltd

See the LICENSE file for license rights and limitations (GPLv3).

monkey's People

Contributors

acepace avatar barakarg avatar barakhoffer avatar brazilian2019 avatar cakekoa avatar danielguardicore avatar dependabot[bot] avatar dhayalanb avatar eliaonceagain avatar fak3 avatar ilija-lazoroski avatar itaymmguardicore avatar itsikkes avatar maorcore avatar marketingyeti avatar msal-guardicore avatar mssalvatore avatar ophirharpazg avatar orannadler avatar ordabach avatar prajwalm2212 avatar shaynehmad avatar shivank1234 avatar shreyamalviya avatar skyplabs avatar snyk-bot avatar urihershgc avatar vakarisz avatar withshubh avatar ybasford 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  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

monkey's Issues

Exploit: Set max_retries when copying monkey to the victim

In slow/problematic environments, like we experienced with NSX11 setup, host (many times its the hpvm) might repeatedly abort the smb copy of the monkey (which is 5MB+ file). In that case monkey stays in an endless loop of copy retries.

Failed to start Monkey Island Mongo Service

At first monkey-island.service wouldn't start but fixed it by removing bson

sudo pip uninstall bson
sudo pip uninstall pymongo
sudo pip install pymongo

But isn't starting also and I have no idea how to fix it

โ— monkey-island.service - Monkey Island Service
   Loaded: loaded (/lib/systemd/system/monkey-island.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-05-17 21:47:00 CEST; 5min ago
 Main PID: 5428 (start_server.sh)
    Tasks: 4 (limit: 4915)
   Memory: 19.8M
      CPU: 403ms
   CGroup: /system.slice/monkey-island.service
           โ”œโ”€5428 /bin/bash /var/monkey_island/ubuntu/systemd/start_server.sh
           โ””โ”€5429 python main.py

May 17 21:47:00 Broadband systemd[1]: Started Monkey Island Service.

โ— monkey-mongo.service - Monkey Island Mongo Service
   Loaded: loaded (/lib/systemd/system/monkey-mongo.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2017-05-17 21:47:02 CEST; 5min ago
  Process: 5501 ExecStop=/var/monkey_island/bin/mongodb/bin/mongod --shutdown (code=exited, status=127)
  Process: 5500 ExecStart=/var/monkey_island/bin/mongodb/bin/mongod --quiet --dbpath /var/monkey_island/db (code=exited, status=127)
 Main PID: 5500 (code=exited, status=127)
      CPU: 3ms

May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Control process exited, code=exited status=127
May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Unit entered failed state.
May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Failed with result 'exit-code'.
May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Service hold-off time over, scheduling restart.
May 17 21:47:02 Broadband systemd[1]: Stopped Monkey Island Mongo Service.
May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Start request repeated too quickly.
May 17 21:47:02 Broadband systemd[1]: Failed to start Monkey Island Mongo Service.
May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Unit entered failed state.
May 17 21:47:02 Broadband systemd[1]: monkey-mongo.service: Failed with result 'exit-code'.

"run.sh"_not_present

Expected Behavior

https://github.com/guardicore/monkey/tree/master/monkey_island says => run run.sh (located under /linux)

Actual Behavior

There is no "run.sh"

Steps to Reproduce the Problem

:~/monkey/monkey_island/linux# ls -alh
total 28K
drwxr-xr-x 3 root root 4.0K Feb 8 18:57 .
drwxr-xr-x 6 root root 4.0K Feb 9 20:11 ..
-rw-r--r-- 1 root root 102 Feb 8 18:57 clear_db.sh
-rw-r--r-- 1 root root 303 Feb 8 18:57 create_certificate.sh
-rw-r--r-- 1 root root 265 Feb 8 18:57 install.sh
-rw-r--r-- 1 root root 265 Feb 8 18:57 monkey.sh
drwxr-xr-x 3 root root 4.0K Feb 8 18:57 ubuntu

Specifications

  • Version: Kali 2018.1
  • Platform:
  • Subsystem:

UI: mark newly added hosts

When viewing the admin page, mark in some way new monkeys that were just added so it will be easier to notice

Export Island's data

The Monkey Island's DB has a lot of data useful for debugging and for general analysis. Exporting the data should be easy, and accessible through the island's interface

UI: add tunnel lines

add lines to show which monkey tunneled through which, for helping diagnose the exploitation route

Implement Oracle WebLogic Vulnerability

Expected Behavior

We'd like to implement an exploit for the Oracle WebLogic vulnerability (CVE-2017-10271).

List of URLs we should cover

  • /wls-wsat/CoordinatorPortType
  • /wls-wsat/CoordinatorPortType11
  • /wls-wsat/ParticipantPortType
  • /wls-wsat/ParticipantPortType11
  • /wls-wsat/RegistrationPortTypeRPC
  • /wls-wsat/RegistrationPortTypeRPC11
  • /wls-wsat/RegistrationRequesterPortType
  • /wls-wsat/RegistrationRequesterPortType11

Exploit logic should be similar to the Shellshock module.

Messy installation process

Hey guys,
I'm trying to wrap my head around the installation process:
Currently, your git readme file refers to the Setup page in the Wiki.
The setup page refers to the blog, where there is completely no installation steps.
The only installation steps i've found are in the monkey\monkey_island\readme.txt, and they are messy.

  1. I suggest to get all the info in one place.
  2. I recommend on creating an installation script for Debian and Ubuntu (using bash).
  3. Explaining more on the folders hierarchy as it is unclear.

Thank you very much, can't wait to try it.
Dviros.

Add kill triggers

Add multiple kill triggers to allow stopping the Monkey's operation.

  1. Add a crossplatform "kill file" that if found, prevents the Monkey from running in any configuration.
  2. Add a "safe list" in the C&C server to be checked by the Monkey before every attack attempt, if the machine is found in the list, no attack.
  3. The monkey will also check it's not on the safe list upon starting up.

SSHExploiter False Alarm

Hi,
It seems that the Monkey agent detects services and hosts that do not exist on the network, related only to the SSHExploiter:

image

How can I provide more info?

Thanks,
Dvir

Exploit: Identify host dissapearance in the middle of the connection

When hpvm session expires (i.e. max timeout), ot when a real machine brutally disappears in the middle of the attack, monkey should skip this victim after a while and not stuck in a loop.

Example of the loop:
2015-08-31 00:15:23,292 [3788:DEBUG] exploit.new_smb_connection.385: SMB connect
ion to <VictimHost 200.200.200.8> on port 445 failed, trying port 139 ([Errno 10
060] A connection attempt failed because the connected party did not properly re
spond after a period of time, or established connection failed because connected
host has failed to respond (200.200.200.8:445))
2015-08-31 00:15:48,875 [3788:DEBUG] exploit.new_smb_connection.391: SMB connect
ion to <VictimHost 200.200.200.8> on port 139 failed as well ([Errno 10060] A co
nnection attempt failed because the connected party did not properly respond aft
er a period of time, or established connection failed because connected host has
failed to respond (200.200.200.8:139))
2015-08-31 00:16:10,450 [3788:DEBUG] exploit.new_smb_connection.385: SMB connect
ion to <VictimHost 200.200.200.8> on port 445 failed, trying port 139 ([Errno 10
060] A connection attempt failed because the connected party did not properly re
spond after a period of time, or established connection failed because connected
host has failed to respond (200.200.200.8:445))

Support subnet in config

The monkey should be able to scan a specific subnet (or several subnets) by listing the subnet in the config, and not by specific IPs

Monkey - Windows 64 builds fail when using ShellShock module

Windows 64 builds fail when using Shellshock, with the following error
2016-09-05 13:52:31,088 [11988:ERROR] monkey.start.173: Exception while attacking <VictimHost 10.0.1.160> using ShellShockExploiter: Gevent is required for grequests.

This doesn't happen in other builds.

UI - Color code the telemetry log

We should color code the telemetry as it's very noisy. Status reports (state, tunnel, system_info_collection), scan attempts, exploit attempts.

Maybe green/yellow/red.

TypeError: _cast_by_example

Expected Behavior

Not raise a TypeError

Actual Behavior

Raises a TypeError

Steps to Reproduce the Problem

  1. Call _cast_by_example with a value which isn't None and example as a tuple with a minimum length of 1.
>>> _cast_by_example('value', ('example',))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<input>", line 14, in _cast_by_example
TypeError: 'NoneType' object is not iterable

The problem is in this line:

if value is None or value == tuple(None):

The issue is calling tuple(None):

>>> tuple(None)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: 'NoneType' object is not iterable

Potential Fix

The problem line is almost exactly the same as this line (four lines below the problem line):

if value is None or value == [None]:

After looking at that, it seems like a potential fix would be either:

if value is None or value == (None,):
# or
if value is None or value == tuple([None]):

Both of these produce a tuple with one element which is None.

>>> (None,)
(None,)
>>> tuple([None])
(None,)

I didn't send a PR since I wasn't exactly sure if this would be correct and if so, which one of these would be preferred.

Upgrade 32bit monkey on 64bit windows

Currently, the monkey can't tell if the target windows machine is 32bit or 64bit, so the 32bit version is used for both.
There are several problems with this. In order to solve the issue, the monkey should upgrade to 64bit after it's started

Detect and display cross-segment traffic between specific subnets

The user should be able to easily specify subnet pairs which shouldn't be accessible from one another.
The monkey should be able to detect whether or not they are accessible (given it's on one of the networks).
The monkey island should display all irregularities on the report.

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.