Skip to content

Instantly share code, notes, and snippets.

View nickcjohnston's full-sized avatar

Nicholas Johnston nickcjohnston

View GitHub Profile
@nickcjohnston
nickcjohnston / Solution.py
Last active March 7, 2020 01:41
CTF Programming Problem
#!/usr/bin/python3
# to make this work you must run "sudo pip3 install BeautifulSoup4"
import requests, base64
from bs4 import BeautifulSoup
s = requests.session()
url = "http://127.0.0.1/index.php"
import board
import digitalio
import time
from adafruit_circuitplayground import cp
# Setup
cp.pixels.brightness = 0.5
seconds = 0
run_timer = False
################
# ARDUINO PART #
################
#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN 9
#define SS_PIN 10 //SDA
#define SCK_PIN 12
#define MOSI_PIN 13
import sys
import datetime
from ebaysdk.finding import Connection
#usage: python3 ebay-find-short-auctions.py ebay.yaml KEYWORDS
config = sys.argv[1]
keywords = " ".join(sys.argv[2:])
api = Connection(config_file=config, siteid="EBAY-US")
#!/usr/bin/python3
# Requires
# pip3 SpeechRecognition
# apt python-pyaudio python3-pyaudio
import speech_recognition as sr
recog = sr.Recognizer()
mic = sr.Microphone(device_index=6)
while True:
@nickcjohnston
nickcjohnston / python_malware_bulk.py
Last active November 10, 2019 13:10
Quick shot at doing some high-level static analysis on a large collection of ELFs
import sys
import os
import hashlib
import magic
import multiprocessing
from time import sleep
import json
import r2pipe
from multiprocessing import Queue
@nickcjohnston
nickcjohnston / loganalysis.py
Created November 7, 2019 18:32
python log data mining
#!/usr/bin/python3
# Script assumes a "browsing session" is all traffic from a unique IP.
# Yes, it's not ideal. I'm just playing around.
import sys
from collections import defaultdict
from collections import Counter
# dictionary of the form {ip:[urls, requested, by, that, ip]}
sessions = defaultdict(list)
@nickcjohnston
nickcjohnston / ascii_art_shellcode.py
Last active October 17, 2019 20:56
ascii_art_shellcode.py
# Note, you must disable ASLR for this to work
# sudo sysctl kernel.randomize_va_space=0 on debian
# Usage: python3 ./string_shellcode.py art.ascii
# Program will spit out exploit string and vuln.out file
# Running the exploit:
# printf "PROGRAM_OUTPUT_STRING" | ./vuln.out
# yay?
import sys, os, io
@nickcjohnston
nickcjohnston / neoled.ino
Last active November 27, 2018 14:29
ATTiny85, OLED, NeoPixel
#include <Tiny4kOLED.h> //needs TinyWireM
#include <Adafruit_NeoPixel.h>
// NeoPixel variables
#define N_LEDS 8
#define LED_PIN 1
#define LED_BRIGHTNESS 127
Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
// Pins

Keybase proof

I hereby claim:

  • I am nickcjohnston on github.
  • I am njohnston (https://keybase.io/njohnston) on keybase.
  • I have a public key whose fingerprint is CDEA B61D 2A1B C5AD 6432 372B 98EB 6715 7B1F 1FB4

To claim this, I am signing this object: