From c2aeadc448295b58ca99d2fb638bbbe4cab55887 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 19 Mar 2014 20:14:04 +0100 Subject: add reaktor bonus commands --- .../root-image/krebs/etc/Reaktor/commands/onion | 3 ++ .../root-image/krebs/etc/Reaktor/commands/shares | 2 ++ filehooker/root-image/krebs/etc/Reaktor/config.py | 39 ++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 filehooker/root-image/krebs/etc/Reaktor/commands/onion create mode 100755 filehooker/root-image/krebs/etc/Reaktor/commands/shares create mode 100644 filehooker/root-image/krebs/etc/Reaktor/config.py (limited to 'filehooker/root-image/krebs') diff --git a/filehooker/root-image/krebs/etc/Reaktor/commands/onion b/filehooker/root-image/krebs/etc/Reaktor/commands/onion new file mode 100755 index 00000000..8631fa79 --- /dev/null +++ b/filehooker/root-image/krebs/etc/Reaktor/commands/onion @@ -0,0 +1,3 @@ +#!/bin/sh + +sudo -u tor cat /var/lib/tor/hidden_service/hostname || echo "no hidden service configured" diff --git a/filehooker/root-image/krebs/etc/Reaktor/commands/shares b/filehooker/root-image/krebs/etc/Reaktor/commands/shares new file mode 100755 index 00000000..1601d584 --- /dev/null +++ b/filehooker/root-image/krebs/etc/Reaktor/commands/shares @@ -0,0 +1,2 @@ +#!/bin/sh +df -h | grep '/media/' diff --git a/filehooker/root-image/krebs/etc/Reaktor/config.py b/filehooker/root-image/krebs/etc/Reaktor/config.py new file mode 100644 index 00000000..501edb70 --- /dev/null +++ b/filehooker/root-image/krebs/etc/Reaktor/config.py @@ -0,0 +1,39 @@ +import socket + +debug = False + +name = socket.gethostname() + +irc_alarm_timeout = 300 +irc_hammer_interval = 10 +irc_kill_timeout = 360 +irc_nickname = name +irc_server = 'irc.freenode.org' +irc_port = 6667 +irc_channels = [ + '#filehooker' +] + +def default_command(cmd): + return { + 'capname': cmd, + 'pattern': '^(?:' + name + '|\\*):\\s*' + cmd + '\\s*(?:\\s+(?P.*))?$', + 'argv': [ 'commands/' + cmd ] } + +commands = [ + default_command('caps'), + default_command('hello'), + default_command('reload'), + default_command('badcommand'), + default_command('rev'), + default_command('uptime'), + default_command('shares'), + default_command('onion'), + default_command('nocommand'), + # command not found + { 'pattern': '^(?:' + name + '|\\*):.*', + 'argv': [ 'commands/respond','You are made of stupid!'] }, + # "highlight" + { 'pattern': '.*\\b' + name + '\\b.*', + 'argv': [ 'commands/say', 'I\'m famous' ] } +] -- cgit v1.2.3