Giter Club home page Giter Club logo

ovisbot's Introduction

drawing

OvisBot

Open source Discord bot for CTF teams


Code Style: Black

OverviewInstallationDocumentationContributionLicense

Overview

OvisBot is a modular, feature-extensive Discord bot for managing CTF teams through discord. It facilitates collaboration and organisation by providing well defined commands to create/delete/update discord category/channels in order to structure CTF problems and provide more efficient team commmunication. In addition the bot provides basic utility functions to assist the solving process of CTF challenges (encoding schemes, etc.. ). Finally, promotes competitiveness amongst team members by providing a aut-synchronised leaderboard to common cybersecurity training platforms such as CryptoHack and Hack The Box,

Note that the majority of the features are provided by isolated plugins and thus they can be enabled/disabled on demand.

This is a self-hosted bot, therefore it requires to be hosted on a private server in order to be used. Further instructions to do so are provided below. It also required a running instance of MongoDB on the server but still, the docker-based installation instructions take care of that.

Installation

There are couple ways to install the bot but generally the installing using docker-compose is the most convenient way to do it. Nevertheless, don't hesitate to use any other methods that suits you.

Installing using pip

To install using pip run the following command

pip install ovisbot

The above will install ovisbot in your python environment and will introduce the ovisbot cli. The cli provides commands to launch and interact with ovisbot.

At runtime, the bot requires a running MongoDB server. An easy way to run a local mongodb server is using docker. You skip this step if you already have one running

docker run -d -p 27017-27019:27017-27019 --name mongodb mongo

Since OvisBot requires some predifined configuration before launch, it is necessary the you set your environment variables accordingly. Alternatively you can create a .env file that defined the required variables. Refer to .env.example for an example.

OvisBot cli provides the setupenv command which assists the creation of a .env file. Therefore to contrinue run and fill in the variables.

ovisbot setupenv

At the end of the process a new .env file will be create in your current directory.

Finally to launch the bot, run:

ovisbot run

Installing using docker

Installation using docker takes care of running mongo db automatically without requiring any extra steps. To achieve this, docker-compose is utilised therefore make sure that you have docker and docker-compose installed on your system.

Firstly clone this repository:

git clone https://github.com/cybermouflons/ovisbot ovisbot && cd ovisbot

For the next step make sure that you have your environment variables configured properly and run:

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Contribution

Have a feature request? Make a GitHub issue and feel free to contribute. To get started with contributing refer to CONTRIBUTE.md.

Current Contributors:

License

Released under the GNU GPL v3 license.

ovisbot's People

Contributors

apogiatzis avatar cents02 avatar cfalas avatar chsotiriou avatar dependabot[bot] avatar kgeorgiou avatar npitsillos avatar sikkis avatar xmpf avatar

Stargazers

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

Watchers

 avatar  avatar

ovisbot's Issues

Add automatic discord command help docs

Help pages with the documentation for commands should be generated and attached to !help automatically.

These should be populated from the documentation of each command function

Add ctf link as optional arg to !ctf setcreds command

!ctf setcreds is used to set the shared credentials for a particular CTF however, a common issue that has been raised was that members couldn't find the link to login. As such, it would be useful to change the structure of the setcreds command as follows:

!ctf setcreds <username> <password> [<ctf_link>]

Note that the CTF link is optional at the moment to avoid confusion.

Add challenge edit and delete commands

New functionality must be added for editing and deleting challenges.

Command structure should something like:

!ctf renamechall <name> <new_name>
!ctf deletechall <name>

Add translations for strings

Now that internationalisation is supported, we must update all the strings to be English by default and provide a cypriot equivalent for the CY locale setting.

Integrate with wolfram alpha API

It would be handy to create a command that integrates with Wolfram Alpha API. This would allow for short computational queries through the bot. i.e. timezone conversion, general question, arithmetic computation etc.

Possible command structure could be:

!wolfram <query>

Although there is a limit of 2000 API calls per month for the free plan, they are probably more than enough for the demands of the bot.

Refactor ctf cog to decouple challenge specific commands

Within CTF channel:

!challenge new -n <challenge_name> -t <tag1,tag2,> -p

!challenge remove -n <challenge_name> (or id?) -A (admin only)

!challenge list

[Pending Emoji] id1 Challenge1 web,crypto 1337 | 2 kouroupettoi looking at it: kostis, giannis
[Done Emoji] id2 Challenge2 stego 420 | Ekanonise ta o kathigitis o kostis
...

!challange start -n challenge_name (or id?)

Ate Peppo mou!

!challenge abandon -n challenge_name (or id?)

Pellos pou en na ksanagorasei diastimoploio pou ton Kitsio.

!challenge solved -n challenge_name (or id?) -f

O! Inta orea kantila!

Meetup command

Develop a collection of commands around organising and managing meetups

Add reminder utility

It would be convenient to add reminder and alarm functionality in the utility commands.

The idea is to be able to set reminders for yourself, the whole team or specific roles.
The command can have the following structure
!utils reminder <reason> <timedelta> [<scope>]

The "scope" argument is for choosing whether the reminder is for the whole team of specific individuals

Enhancement Utils

URL Grabbing Mechanism

Zolos should be able to grab urls shared in any channel (using a regex to match the URI) and post it to a dedicated channel #links (only zolos should have write permissions to that channel) for archive purposes.

Exploit Searching

Use websites like sploitus.com, exploit-db to search for exploits. This can be useful during CTFs and pentesting
eg: !searchploit wordpress

Reverse Shell "Generator"

From a list of known "payloads" such as pentestmonkey, dynamically configure code with LHOST,LPORT and send it back in the channel.
eg: !rshell 127.0.0.1 4444

Attack Vector Payloads

Find attack payloads for XSS, SQLi, XXE, ...
eg: !payload SQLi MySQL

Hash Cracking

Use hashid python module to identify hash format, and try to crack them using websites like crackstation.net
eg: !hashcrack 098f6bcd4621d373cade4e832627b4f6

Reconnaisance

Use various tools such whois, nslookup, traceroute, ... to provide information about a target
eg !recon website.com

Add unsolve

A challenge specific command unsolve must be added to enable rollback of accidental solve commands and/or forgetting to mention teammates

Store bot configuration in DB

It would be more appropriate to store the bot's configuration in the database such that each new install can be fully customisable and persistent. Also, this is the foundation for customizability through a discord channel.

Add maintenance mode

Admins should be able to toggle maintenance mode which will effectively disable commands of the group and return a maintenance message instead.

This is to allow for more controlled update/testing whilst in production.

Ideally, the bot should be tested in test/stage environments but you know... shit happens...

Fix CTF channel enumeration

Bot assumes that any categories other than text and voice channels are CTF categories and therefore CTFs are enumerated as such. It would be more robust to enumerate CTFs using the database instead of the channel categories.

Create notes at CodiMD for each new challenge

At the moment, useful progress for a challenge is being lost in channel conversations and pinning is not convenient for referring back + not all members have pinning permissions.

CodiMD is an open-source platform for writing and sharing notes in real-time. There is a hosted version of CodiMD here (https://notes.status.im/)

Thus, it would be useful if for each new challenge added a new guest notebook is created that is linked back to the discord channel. Any useful progress, summary, code snippets and exploits can then be added to the notebook decoupled from the conversations such that new members that join the challenge can quickly be up to date with the status of the challenge.

Pin the CTF Credentials

To make it easier to view the credentials for the CTF, they should be pinned in the CTF channel.

Add ctftime writeups command

A ctftime wirteups command would fetch a number of recent writeups from ctftime. This will be good for random studying and easy fetch of writeups and will be the foundation for a writeup subscribe feature in the future.

Add scheduled archiving for finished ctfs

Archiving of CTF channels is currently performed manually.

It would be more convenient to implement a scheduled archiving process automatically for each finished CTFs.

The time until archiving should be possible to set from the bot settings.

Add ctf archive command

A new command ("archive") should be added which archives old CTF details and deletes channels/roles from the server

Migrate dependencies to pipenv

Currently, the project uses the convention requirements.txt file to define dependencies.

As a result, it becomes difficult to separate development from runtime dependencies. It would be possible to create a separate requirements.dev.txt file but this would add unnecessary maintenance burden.

A more ideal solution is to use a more feature-complete dependencies manager like Pipenv or Poetry. In general, poetry has demonstrated superior performance however Pipenv has a larger community and I am also more familiar with it as well.

Enhancement: !ctftime writeups

!ctftime writeups <ID> should return the list of submitted writeups for each challenge of specified CTF Event as acquired from ctftime.org API

Add hash cracking plugin with hashcat

Develop commands to perform seamless hash cracking with hashcat in the backend.

Should be developed as a plugin for modularity. Apply limits on:

  • time
  • number of cracking processes at a time

Hack The Box Integration

Allow members to link their hack the box profiles.

Use that to show leaderboard, ranking, stats.

React on edited commands as well.

Currently, zolos only reacts on commands sent. It is convenient to act to edited commands as well to allow fixing typos on commands sent

Split help command to categories

The help commands returns a huge response..
It would be nicer if it was split to core, ctf, ctftime, misc so if you run
!help ctf would return only help for commands in the ctf extension.

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.