Giter VIP home page Giter VIP logo

centralised-monitoring-and-control-system's Introduction

Centralised Monitoring And Control System

A centralised server to manage and monitor remote clients. A framework purely in python.

logo

INTRODUCTION


Centralised Monitoring And Control System(CMCS) is the combination of a remote host handler(MotherNode) and a script(client) purely written in python that can bring the client system under the administrative authority of the MMotherNode.The server script is named server.py.. The server provides the functionality of simultaneously handling and listening for multiple incoming socket connections. The code base consists of four client side codes namely:

ciscontrols.py This is for Checking and Implementing few CIS Compliance And Benchmarks.

client.py The Client-Side code to initiate a reverse TCP connection

dependencyclient.sh A bash script to check all the required dependencies(binaries) are installed or not

splunkenable.py To start splunk-forwarder on remote clients to monitor their logs in Splunk-UI

This project has been made public so anyone can contribute to this project.

OS REQUIREMENTS


The Program has been made and tested to work on Centos7 and DEBIAN 9

FEATURES


  • The Server can interact with one client while it is still listening for incoming connection from other clients.
  • New connections are appended to a table that can be used later.
  • The client script(agent) provides feature of persistence on platforms like centos or debian(adding a cronjob in crontab.)
  • The script copies itself into the admin folder in the home directory and autoruns on reboot so that it works even if the original file is deleted by user.
  • It works over wan also provided there is an ip connectivity between the MotherNode and the client.
  • CIS Benchmarks that are applicable for the remote host can be listed and applied remotely.
  • Splunk Forwarder can be configured on the remote host.
  • Os,Memory and cpu statistics of the remote host can be monitored.
  • List of Users (privileged and non-privileged ) present on the remote system can be viewed.
  • Files can be transferred to and fro between server and client.
  • Some commands that can be run on the clients are :-
COMMAND DESCRIPTION
exit back to mothership(stay connected to the bot)
help see this table
screenshot take a screenshot of bot and save to cwd of mothership
shell* execute a shell command on bot
grab*<file_name> transfer a file from cwd of bot to cwd of mothership
upload* transfer a file from cwd of mothership to cwd of bot
cd* change cwd of bot
status get os memory and cpu statistics of remote client
cischeck get current cis complaint status of remote client
cisenable make remote system cis complaint
message send message to the remote host
splunkenable enable splunk forwarder on remote host
users get a list of users on the remote host
  • The help command(for e.g.) outputs:

screen shot 2017-11-26 at 8 31 44 am

  • The showclients command outputs:

screen shot 2017-11-26 at 8 31 44 am

  • The status command is used to view the system-information of the connected clients:

screen shot 2017-11-26 at 8 31 44 am

  • The users command outputs:

screen shot 2017-11-26 at 8 31 44 am

One can choose which user to view(system or normal):

screen shot 2017-11-26 at 8 31 44 am

  • Few more examples of other commands:

cd:

screen shot 2017-11-26 at 8 31 44 am

grab:

screen shot 2017-11-26 at 8 31 44 am

  • The cischeck command checks for the current status of CIS Compliance and Benchmarks of the client:

screen shot 2017-11-26 at 8 31 44 am

  • The cisenable command enables all the disabled CIS Compliance and Benchmarks:

screen shot 2017-11-26 at 8 31 44 am

before administring the splunkenable command splunkserver and gui must be set up and listening on server side

screen shot 2017-11-26 at 8 31 44 am

  • Running the splunkenable command and waiting for the splunk forwarder to get configured in the remote host:

screen shot 2017-11-26 at 8 31 44 am

  • Completion of splunk forwarder configuration in the remote host(client) and connection to server established(debian):

screen shot 2017-11-26 at 8 31 44 am

  • A user with knowledge of python can write his own functionalities that can be easily incorporated into the existing clients.

  • User can quit the script safely using the exit command and the clients will go to sleep for 10 sec.After which they will go back to the task of trying to connect back to the MotherNode.So when the person starts the mothernode again his clients will connect back again:

screen shot 2017-11-26 at 8 31 44 am

HOW TO INSTALL


MOTHERNODE

  • To install just open the terminal and type:
git clone https://github.com/neiltyagi/Centralised-Monitoring-And-Control-System.git
  • Install dependencies:
./dependencyserver.sh

To launch the MotherNode

python3 server.py <ip address> <port>

THE IP ADDRESS MUST BE YOUR LOCAL IP IF YOU WANT TO USE IN LAN. TO USE IN WAN USE YOUR GLOBAL IP WITH APPROPRIATE PORT FORWARDING ON THE ROUTER. refer https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router

CLIENT

NOTE agent is by the name of client.py

  • Open the client.py file using any text editor
  • Edit the IP and port fields to the IP and port you used above
  • Save the file.
  • copy the complete client folder to the remote host you wish to administer
  • install the Dependencies.
./dependecyclient.sh
  • run the client script as root.
python3 client.py

UPDATES


New updates and bug fixes rolling out soon.

centralised-monitoring-and-control-system's People

Contributors

neiltyagi avatar

Watchers

 avatar  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.