This file contains 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
$ worm parse 01000000020d03632733cadb4398deff53e35fd7255296df9f5a8b8099c701d18fe4328d89351a1da6913276ad8f806f254e13816209e05d68fba914f7a74afa732a0abc56c4a50105aeb171934c5b3336db4ca2ff1dec200798ab0fc554520f2b12a7822684568d8a0de8a5115ae00476aad2607f29e30a559429f66f331d30e281b4f30ad7e799970106aab251c07774ad4d1d2dc4b3657e2b91d43dd41e54b4164dea9b025515d537334d68899e00ef494d54bc3cd6948655b61a8eec1bceebf907e2ab18c0ece009ac01077607cf7e024f2525071b4ecef46060ee23fb1d3ea5e5ed7ea00f44676391719466c071e2facfa35aa364b9c3aba5beb5c1f80b28b38aaef5e9d0f64cc81e2b4f0109ab9995885cb1603ea880323d22ce17752c05f5fb9b0631d1f48552e53f3afa9d3b8097faec35e907be7637543b59db2869bebcf2cda1151f4bf8c2a342e0fd24010a5fc9061809cf2ff11d4d50d3e9d55a0168d6ca4520802d81e5e5fb83af3dbbff297fe42b2e2a2678cbcfc049a99554859ef5046886c6bcb56f2705c44ea7f22c010b6c4e79c796094ec80b096bb495e54d21852a6194d4c35903e25705b97cecdd622cc1e7b4e9a9556a04ef3b255426703e3bc885873e64b0b8fa193f9fd8370c74010c70d7c1940647960e88fb5fe891012567d22394ae99c3beccc9a49b10e70223353e876d510 |
This file contains 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 json | |
import requests | |
import pdb | |
import os | |
BASE_URL = "https://auth.mozilla.auth0.com" | |
def get_bearer_token(): | |
url = BASE_URL + '/oauth/token' |
This file contains 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
log = open("/Users/jclaudius/.aws/config", "r") | |
for line in log: | |
print(line) |
This file contains 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 glob | |
import os | |
import os.path | |
import shutil | |
mydir = "/Users/jclaudius/Downloads/" | |
filelist = glob.glob(os.path.join(mydir, "*")) | |
for f in filelist: | |
if os.path.isdir(f): |
This file contains 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 shutil | |
path = "/Users/jclaudius/Desktop/" | |
moveto = "/Users/jclaudius/Desktop/Archive/" | |
files = os.listdir(path) | |
files.sort() | |
for f in files: | |
if not os.path.isdir(f): | |
src = path+f |
This file contains 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
# In boto | |
import boto | |
conn = boto.connect_s3(aws_access_key_id=aws_access_key_id,aws_secret_access_key=aws_secret_access_key) | |
bucket = conn.get_bucket(bucket_name, validate=False) | |
key = boto.s3.key.Key(bucket) | |
key.key = key_name | |
key.set_contents_from_filename(file_path) | |
url = "https://{}.s3.amazonaws.com/{}".format(bucket.name, key.name) |
This file contains 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 re | |
# Current | |
>>> re.search(r"((ssh|https)://)?(git@)?github.com[:/](?P<repo_name>[A-Za-z0-9\/\-_]+)(.git)?", "bananas://github.com:/") | |
'/' | |
# Proposed | |
>>> re.search(r"^((https|ssh)://)?(git@)?github.com/(?P<repo_name>[A-Za-z0-9\/\-_]+)(.git)?$", "https://github.com/org/foo").group("repo_name") | |
'org/foo' | |
>>> re.search(r"^((https|ssh)://)?(git@)?github.com/(?P<repo_name>[A-Za-z0-9\/\-_]+)(.git)?$", "https://github.com/org/foo.git").group("repo_name") |
This file contains 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 datetime | |
import time | |
# Simple connections management dict in Python example | |
connections = {} | |
class Connection: | |
def __init__(self): |
This file contains 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
'use strict'; | |
exports.handler = (event, context, callback) => { | |
const response = event.Records[0].cf.response; | |
const headers = response.headers; | |
// See https://wiki.mozilla.org/Security/Guidelines/Web_Security | |
headers['Strict-Transport-Security'] = [{'key': 'Strict-Transport-Security', 'value': 'max-age=63072000'}]; | |
headers['X-Content-Type-Options'] = [{'key': 'X-Content-Type-Options', 'value': 'nosniff'}]; | |
headers['X-Frame-Options'] = [{'key': 'X-Frame-Options', 'value': 'DENY'}]; |
This file contains 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
{ | |
"overall": "orange", | |
scanner_reports: { | |
"ssh_observatory": "green", | |
"http_observatory": "orange", | |
"dir_scan": "green", | |
"ssh_observatory": "green", | |
"ssh_observatory": "green" | |
} | |
} |
NewerOlder