Giter VIP home page Giter VIP logo

centsecure's Introduction

CentSecure

A tool for automating parts of CyberCenturion.

Website & Docs

Build Status


Overview

CentSecure is a tool for automating parts of CyberCenturion. We are focusing on tasks which are easy (e.g. running a single command) and/or time consumung (e.g. removing backdoors).

โš ๏ธ Warning: Use of this tool when it is open source is against CyberCenturion and CyberPatriot rules. However, you may still use it for inspiration for your own tools.

CyberCenturion is a blue-teaming exercise run by Cyber Security Challenge UK which involves securing 3 virtual machines. See more about how it works here.

CentSecure fixes security holes automatically which gets some of the 'lower hanging fruits' leaving us to focus on some of the harder things. It is designed to work on all platforms and adapt to the platform that it is being run on. Instead of having a bash script for Linux based systems and a batch script for Windows based systems, it makes sense to keep everything in one place.

Usage

Run CentSecure with Python: python centsecure.py

$ python centsecure.py --help
[#] Searching for plugins...
usage: centsecure.py [-h] [--list-plugins] [--run-plugin N [N ...]]
                     [--run-all] [--disable-root-check]
                     [--disable-python-check]

Automatically fixes common security vulnerabilities.

optional arguments:
  -h, --help            show this help message and exit
  --list-plugins, -l    Lists all plugins
  --run-plugin N [N ...], -r N [N ...], -p N [N ...]
                        Run specific plugins
  --run-all, -R         Run all available plugins
  --disable-root-check, --no-root, -d
                        Disable root check
  --disable-python-check
                        Disable Python version check

Default behaviour is to attempt to run all plugins

These are the most common parameters:

  • python centsecure.py - Run with all of the 'default' plugins. This will run all of the plugins except some of the more destructive ones.
  • python centsecure.py -R - Run all of the plugins.
  • python centsecure.py -r ssh -r pam - Run just the SSH and PAM plugins.
  • python centsecure.py -l - List all of CentSecure's plugins.

Installation Scripts

We have installation scripts for both Ubuntu and Windows which are in the scripts folder. Simply clone the repository (or download as a ZIP from GitHub) and run one of the scripts from this folder to install Python and CentSecure dependencies.

Manual Installation

If you don't want to use the installation scripts, you can manually install CentSecure. Read our Installation Guide for more information on manually installing dependencies.

centsecure's People

Contributors

jake-walker avatar limefax avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

centsecure's Issues

Services

Check running services (e.g. FTP, RDP, Telnet, UPnP, Remote Registry, etc...)

Pam

Implement a better way of checking/installing cracklib

Password Policies

  • Minimum password length
  • Max password age
  • Min password age
  • Lockout policy

Firefox Config

Enable warnings when installing add-ons, block dangerous downloads, automatically update, etc...

Software

Add needed software and remove banned software

To be able to backup directories as a tar file

e.g. if we wanted to back up a home directory, it might contain 'illegal stuff', so archiving will remove any possibility of that being detected.
Also home directories might be quite big, so it might be a good idea to compress as well

Account Management

Ask for list of accounts to create and whether they need to be admin or not. Then create users in the list, remove users not in the list and promote/demote users.

win32net Module

This needs a custom installation at the moment:
python -m pip install pywin32
Navigate to the python install folder
python Scripts/pywin32_postinstall.py -install

Pam breaks sudo

[sudo] password for a: 
sudo: PAM authentication error: Module is unknown

Backup folder

Implement an easy way to backup files that payloads will change

Add common function that can run complex shell stuff

e.g. common.run_full("for usr in $(cut -d: -f1 /etc/shadow); do [[ $(chage --list $usr | grep '^Last password change' | cut -d: -f2) > $(date) ]] && echo \"$usr :$(chage --list $usr | g rep '^Last password change' | cut -d: -f2)\"; done")

Password Policies

  • Minimum password length
  • Max password age
  • Min password age
  • Lockout policy

Linux services

Detect all services running, and prompt user whether to disable them or not.
e.g. samba, avahi, ftp...

Software for Ubuntu Changes

e.g.

[?] (8/368) Would you like to keep the program 'alacarte' (y/n/i)? i
alacarte/oldoldstable,now 3.11.91-2 all [installed]
  easy GNOME menu editing tool
[?] (8/368) Would you like to keep the program 'alacarte' (y/n/i)?

or even just the easy GNOME menu editing tool bit

Create installer scripts

The current way of generating binaries doesn't work very well because they only work on the exact OS that they were built on (e.g. binary built on Ubuntu 19.10 doesn't work on Ubuntu 16.04). So instead have 2 installer scripts (Windows and Linux) which:

  • Install Python
  • Install dependencies (e.g. git)
  • Clone repository to a folder
  • Add files to path

Account Management

Ask for list of accounts to create and whether they need to be admin or not. Then create users in the list, remove users not in the list and promote/demote users. Also change passwords where appropriate

Clean up documentation

After Round 3, this probably wants to be made public so the documentation needs cleaning up and removing.

Prohibited Files

Delete files ending in a list of extensions. For example: .mp3, .mp4, .ogg, .wav, etc...

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.