Skip to content

Instantly share code, notes, and snippets.

View claudijd's full-sized avatar
🦬

Jonathan Claudius claudijd

🦬
View GitHub Profile
@claudijd
claudijd / shark.py
Created July 3, 2019 18:20
demoing global override and comms
thing = "foo"
class Baz():
def override_thing(self):
global thing
thing = 1
def update_thing(self):
@claudijd
claudijd / poc.sh
Created April 16, 2019 15:56
Script to poll app_metadata and group membership
#!/usr/bin/env bash
# Pass in your BEARER_TOKEN to this script to make it dance
mkdir -p ./testing
while true; do
echo "$(date): Polling /api/v2/users/ad%7CMozilla-LDAP%7Cjclaudius and dumping app_metadata and groups to file"
curl -H "Authorization: Bearer $BEARER_TOKEN" "https://auth.mozilla.auth0.com/api/v2/users/ad%7CMozilla-LDAP%7Cjclaudius" 2> /dev/null | jq -r '"\(.app_metadata)|\(.groups)"' > ./testing/$(date +%s)
sleep 5
done
@claudijd
claudijd / pickle_random_testing.py
Last active November 14, 2018 00:08
A demo of pickle usage vs. random usage respective to existing and proposed
import pickle
import os.path
import random
# Old pickle queue logic (summarized)
pickle_cache_file = "pickle.queue"
reset_list_count = 0
import random
emails = []
sample_size = 20
with open("emails.txt") as f:
for line in f:
emails.append(line)
for email in random.sample(emails, 20):
@claudijd
claudijd / amqp lambda
Created October 26, 2018 01:14
amqp "lambda"
require "bunny"
# Start a communication session with RabbitMQ
conn = Bunny.new
conn.start
# open a channel
ch = conn.create_channel
# declare a queue
@claudijd
claudijd / agent.rb
Created October 26, 2018 01:13
amqp agent
require "bunny"
# Start a communication session with RabbitMQ
conn = Bunny.new
conn.start
ch = conn.create_channel
q = ch.queue("test1")
loop do
@claudijd
claudijd / cloudformation-template-create-stack.json
Created September 26, 2018 21:36
cloudformation-template-create-stack.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for this Serverless application",
"Resources": {
"ServerlessDeploymentBucket": {
"Type": "AWS::S3::Bucket"
}
},
"Outputs": {
"ServerlessDeploymentBucketName": {
@claudijd
claudijd / result.txt
Created September 17, 2018 15:11
Example SSH scan result...
(master) $ curl -i https://sshscan.rubidus.com/api/v1/scan/results?uuid=d46c613f-a7b1-429e-92e4-2bdb1aa858e6
HTTP/1.1 200 OK
Server: nginx/1.10.0 (Ubuntu)
Date: Mon, 17 Sep 2018 15:10:29 GMT
Content-Type: application/json
Content-Length: 1640
Connection: keep-alive
Access-Control-Allow-Methods: GET, POST, OPTIONS, HEAD
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 86400
@claudijd
claudijd / gist:f88803af5c44e817678b3eb95f056b93
Created September 6, 2018 17:40
Crude mechanism to detect typo attacks on RubyGems
require 'levenshtein-ffi'
class String
def edit_distance(other)
raise unless other.is_a?(::String)
diff = Levenshtein.distance(self, other)
end
end
# Arbitrary gem list to test to determine if they are bad or not
@claudijd
claudijd / gist:7d3f32e0e01a6ddd4e7284ac2abb651b
Created August 16, 2018 22:46
NPM Sec Warnings on Install....
WARN notice [SECURITY] atob has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=atob&version=2.0.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
WARN notice [SECURITY] tough-cookie has the following vulnerabilities: 1 high, 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=tough-cookie&version=0.9.15 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
WARN notice [SECURITY] request has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=request&version=2.29.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
WARN notice [SECURITY] hawk has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hawk&version=1.0.0 - Run `npm i npm@latest -g` to upgrade your npm version, and t