Skip to content

Instantly share code, notes, and snippets.

View jasimmonsv's full-sized avatar
🏴‍☠️

J.A. Simmons V jasimmonsv

🏴‍☠️
View GitHub Profile
@jasimmonsv
jasimmonsv / defang.sed
Last active June 27, 2022 21:54
SED URL and IP defang
# replaces IP addresses with brackets around `.` :: 192[.]168[.]1[.]42
s/\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/\1[.]\2[.]\3[.]\4/g
# replaces all http(s) instances with hxxp(s)
s/http/hxxp/g
@jasimmonsv
jasimmonsv / decrypt.py
Created November 6, 2021 01:59
Decryption Homework
#!/usr/bin/env python3
from base64 import b64decode
from base64 import b64encode
import os
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
@jasimmonsv
jasimmonsv / ip_mac.py
Created October 11, 2021 03:24
Get ip, mac address and associated IP addr from pcap file
!#/usr/bin/env python
from scapy.all import *
# Read in pcap file
packets = rdpcap("/path/to/packets.pcap")
nonstp = []
for pkt in packets:
# filter out STP packets
if pkt.dst == "01:80:c2:00:00:00":
@jasimmonsv
jasimmonsv / all_macs.py
Created October 11, 2021 03:21
Scapy list all mac address in a pcap file
!#/usr/bin/env python
from scapy.all import *
# Read in pcap file
packets = rdpcap("/path/to/packets.pcap")
nonstp = []
for pkt in packets:
# filter out STP packets
if pkt.dst == "01:80:c2:00:00:00":
@jasimmonsv
jasimmonsv / etouffee.md
Last active August 21, 2020 05:50
Loretta's Crawfish Etouffee

"Crawfish can be substituted with shrimp."

Ingredients

  • 2 lbs cleaned Crawfish or Shrimp
  • 2 medium onions, chopped
  • 1 clove garlic
  • 2 stalks of celery
  • 1 can rotel tomatoes (mash tomato)
  • 1 can cream of onion soup
  • 1 tablespoon flour
  • cooking oil
@jasimmonsv
jasimmonsv / README-Template.md
Created August 15, 2020 20:05 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jasimmonsv
jasimmonsv / client_credentials.oauth2.py
Last active April 18, 2019 21:04
Obtaining Client Credentials token for OAUTH2
import requests
url = 'https://domain.auth.us-east-1.amazoncognito.com/oauth2/token'
payload = {
'grant_type': 'client_credentials',
'client_id': '<client_id>',
'client_secret': '<client_secret>'}
res = requests.post(url, data=payload)
res.json()['access_token']
@jasimmonsv
jasimmonsv / all_aws_lambda_modules_python.md
Created March 14, 2019 02:31 — forked from gene1wood/all_aws_lambda_modules_python.md
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7

This gist contains lists of modules available in Python 2.7 3.6 and 3.7 in AWS Lambda.

It also contains the code to run in Lambda to generate these lists. In addition there is a less_versbose module in the code that you can call to get a list of the top level modules installed and the version of those modules (if they contain a version in the module)

@jasimmonsv
jasimmonsv / random_test_artifacts.py
Last active August 7, 2018 23:09
randomization artifacts for unittests
import random
import string
def rand_string(rrange=25):
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(rrange))
def rand_email():
return '{}@{}.{}'.format(rand_string(10), rand_string(7), rand_string(3))
@jasimmonsv
jasimmonsv / lambda_2_lambda.py
Created August 7, 2018 01:35
Invoke Lambda from within another Lambda
import json
import urllib
import boto3
lam = boto3.client('lambda')
def lambda_handler(event, context):
payload = {}
payload['key1'] = 'key1'
payload['key2'] = 'key2'