Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block MarkBaggett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MarkBaggett /
Last active Aug 16, 2019
Determine a persons interests based on who they follow
from twython import Twython
from collections import Counter
import sys
twit = Twython(<your twitter APP KEY HERE> , < Your twitter Secret key here >)
c = Counter()
ignore_words = ['AND', "WE", "THAT","THAN","THEM", 'OF', "GET", "SO", "SOME",'THE', 'TO', 'FOR', 'MY', 'IN', 'IS', 'ARE', 'I', 'AT','ON', 'WITH', 'BY', 'NOT', 'THAT','TWEETS', 'WE', 'ALL', 'FROM', 'OWN', 'ABOUT', 'DO', 'YOU', 'OUR', 'THIS', 'THINGS', 'TEAM', 'YOUR', 'VIEWS', 'AN', 'TWITTER', 'THOUGHTS', 'MOST', 'NOW', 'OPEN', 'NEW', 'THERE', 'AS', 'WHO', 'ONE', 'OR', 'ALWAYS', 'IF', 'ME', 'THOSE', 'BE', 'AM', 'AROUND', 'LIKE', 'NO', 'SEE', 'GROUP', 'EXPRESSED', 'JUST', 'EVERY', 'BUT', 'MORE', "WHY", "BECAUSE", "SOLELY", "WITHIN", "SINCE", "ITS", "LOT", "OTHER","BOTH","UP","HERE","BETTER"]
MarkBaggett /
Last active Jul 4, 2019
Python Windows DLLs finding and calling
import pefile
import sys
import ctypes
import glob
import argparse
import itertools
def search_tables(thefile, pename, search = []):
if hasattr(thefile, "DIRECTORY_ENTRY_IMPORT"):
if args.verbose or args.dump:
MarkBaggett / 1 -
Last active Sep 17, 2019
Come To The Darkside - Pythons Sinister Secrets
View 1 -
MarkBaggett / Decorator_Example_code
Last active Nov 15, 2018
Decorators Demystified Presentation
View Decorator_Example_code
#Material for SANS Webcast:
#1) Variables can hold functions:
x = print
x("Hello {}, what is your {}".format("sir robin", "quest"))
#Watch it execute:,%20what%20is%20your%20%7B%7D%22.format%28%22sir%20robin%22,%20%22quest%22%29%29%0A&cumulative=false&curInstr=0&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false
MarkBaggett / escape_room
Last active Sep 10, 2018
Notes on an escape room using home assistant.
View escape_room
As requested here is a walk through for the "Escape room" challenge I threw together for a party at my house. This was developeed in about 5 hours. It took guests about 45 minutes to complete. I have several things I would like to do to improve it over the next could iterations.
Notes to the reader:
- Requires Home Assistant
- Requires App Daemon
- My home includes Philips Hue lights, Ecobee thermostat, arlo cameras, some smart TV's and other devices used in the challenges.
- It is not shown in the code below but I also have printed puzzles and ammo boxes with combination locks throughout the house. Generally a printed puzzle leads players to physical activity that triggers a "smart home puzzle" which leads them to a combination to unlock the next ammo box containing the next printed puzzle. Lather, rince, repeat.
- Not all puzzles are published here but this is enough to get your creative juices flowing.
- Th
View gist:29995da8bd4e22681ad8cf2bdb139fb2
#!/usr/bin/env python3
import argparse
import math
import random
import hashlib
import codecs
Given the following MD5 Rainbow table that was generate using this program, determine
the password for this hash bcccb2598de87da2952522eae448b356. You must use this program
MarkBaggett /
Created Nov 29, 2017
pxpowershell - A super simple interface to Powershell from Python
#!/usr/bin/env python
#Quick and Dirty Python Interface to Powershell from Python
#Requires pexpect module. Try "pip install pexpect"
import pexpect
from pexpect.popen_spawn import PopenSpawn
import re
import time
class pxpowershell(object):
def __init__(self, *args, **kwargs):
MarkBaggett /
Last active Apr 7, 2019
Python - SQLMAP - Tamper Script for Custom Caesar Cypher
#!/usr/bin/env python
from import kb
from lib.core.enums import PRIORITY
import string
__priority__ = PRIORITY.NORMAL
def dependencies():
MarkBaggett /
Last active Apr 21, 2019
Python - SCAPY - Full Packet Session Reassembly
#From here
def full_duplex(p):
sess = "Other"
if 'Ether' in p:
if 'IP' in p:
if 'TCP' in p:
sess = str(sorted(["TCP", p[IP].src, p[TCP].sport, p[IP].dst, p[TCP].dport],key=str))
elif 'UDP' in p:
sess = str(sorted(["UDP", p[IP].src, p[UDP].sport, p[IP].dst, p[UDP].dport] ,key=str))
You can’t perform that action at this time.