Git Product home page Git Product logo

ctf-scoreboard's Introduction

CTF-Scoreboard

A scoreboard used for CTF jeopardy style events

This is a scoreboard that can be used for jeopardy style tournaments. It was developed by us to be used in our capture the flag security events.

Installation

Packages

You need to have NodeJS, Redis and MySQL installed:

We have tested the scoreboard with Ubuntu 12.04 64 bits, NodeJS versions 0.6.12 and 0.8.1, Redis version 2.2.12 and 2.4.15.

sudo apt-get update
sudo apt-get install nodejs redis-server mysql-server

Npm

This will install the needed node packages

npm install --production

Database

In the folder DB you will find two SQL scripts to import, tournament.sql (Complete database) and salts.sql (Password salts).

cd BD
mysql -u username -p < tournament.sql
mysql -u username -p < salts.sql

Configuration

Go back to the main folder and copy dbconfig-example.js to dbconfig.js. Next dbconfigure the dbconfig.js file to use your MySQL database, it will look like this,

var dbconfig = {};

dbconfig.db = {};
dbconfig.dbHashes = {};

// Complete DB
dbconfig.db.host = 'localhost'; // <-- Insert host
dbconfig.db.user = 'root'; // <-- Insert user
dbconfig.db.password = 'password'; // <-- Insert password
//Don't Change.
dbconfig.db.database = 'torneio';

// Password Salt DB
dbconfig.dbHashes.host = 'localhost'; // <-- Insert host
dbconfig.dbHashes.user = 'root'; // <-- Insert user
dbconfig.dbHashes.password = 'password'; // <-- Insert password
//Don't Change.
dbconfig.dbHashes.database = 'passsalts';

module.exports = dbconfig;

Go back to the main folder and copy config-example.js to config.js. Edit the options to suit your needs.

var config = {};

config.host = "0.0.0.0";
config.appPort = 3000;
config.brand = "exampleCTF";
config.url = "https://localhost:3000";

module.exports = config;

SSH Keys

You can generate the privatekey.pem and certificate.pem files using the following commands:

cd keys
openssl genrsa -out privatekey.pem 2048
openssl req -new -key privatekey.pem -out certrequest.csr
openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem

Run

Testing

Now you just need to run node.

cd CTF-Scoreboard
node app.js

Production

We recommend using pm2 to handle this app as a daemon. To install pm2:

sudo apt-get install pm2

Then install the node script with

cd CTF-Scoreboard
pm2 start app.js --name "CTFScoreboard"

Have the scripts run on startup:

pm2 startup ubuntu

You can then browse to https://server-address:3000 and login with username Administrator and password 123456

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.