This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
run_command() { | |
ident=$1 | |
cmd=$2 | |
>&2 echo "[+] Sending command to :: $i"; | |
params='{"command": ["'$cmd'"]}' | |
# Read why unbuffer is needed here: https://github.com/aws/amazon-ssm-agent/issues/354 | |
unbuffer aws ssm start-session --document-name 'AWS-StartNonInteractiveCommand' --parameters "$params" --target $ident | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redis = require("redis"); | |
const fs = require('fs'); | |
const redisMonitor = redis.createClient({ | |
host: "portal.hackazon.org", | |
port: 17011 | |
}) | |
redisMonitor.monitor(function (err, res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import base64 | |
import tarfile | |
import hashlib | |
import datetime | |
import tempfile | |
from Crypto.Cipher import AES | |
from werkzeug.utils import secure_filename | |
from flask import Flask, request, jsonify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import datetime | |
import tarfile | |
from werkzeug.utils import secure_filename | |
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
app.config['UPLOAD_DIR'] = 'uploads' | |
app.config['AUTO_EXTRACT_TAR'] = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import datetime | |
from werkzeug.utils import secure_filename | |
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
app.config['UPLOAD_DIR'] = 'uploads' | |
@app.route('/', methods=['POST']) | |
def upload_file(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: @cyberbutler | |
# Description: pipe the output of log files to slack | |
# Usage: | |
# _> export SLACKHOOKURL=<your slack hook url here> | |
# _> tail -f -n0 /var/log/access.log [...other.log] | slack-piper.sh | |
while read line | |
do | |
payload="{\"text\":\"\`\`\`$(echo $line | sed 's/"/\\"/g' | tr -d "\r"| grep -v "==>" | grep -Ev "^$")\`\`\`\"}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spreadsheet_id = "INSERT SHEET ID HERE"; | |
function createTheForm() { | |
createForm("CompetitionOne") | |
} | |
function lookupValueFromSpreadsheet(field, lookup_field, keyfield="CompetitionId", sheetname="CompetitionParameters") { | |
const charList = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generic FileBeat Processor | |
filebeat.inputs: | |
- type: log | |
enabled: true | |
paths: | |
- /var/log/bash.log | |
fields: | |
infralogtype: bash # Tagging style borrowed from RedELK | |
fields_under_root: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
beats { | |
port => 5044 | |
} | |
} | |
filter { | |
if [infralogtype] == "bash" { | |
grok { | |
match => { "message" => "^%{SYSLOGTIMESTAMP:syslog_timestamp}\s%{HOSTNAME}\s.+?:\s(?<json_message>.*)$"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RETRN_VAL=$?; | |
if [ -f /tmp/lastoutput.tmp ]; then | |
LAST_OUTPUT=$(cat /tmp/lastoutput.tmp); | |
rm /tmp/lastoutput.tmp; | |
fi; | |
logger -S 10000 -p local6.debug "{\ | |
\"user\": \"$(whoami)\", \ | |
\"path\": \"$(pwd)\", \ | |
\"pid\": \"$$\", \ |