Skip to content

Instantly share code, notes, and snippets.

Avatar

Connor Nelson ConnorNelson

View GitHub Profile
View sandbox.py
import os
import socket
import subprocess
import signal
import ctypes
def sandbox(target, *, privileged=True):
CLONE_NEWNS = 0x00020000 # New mount namespace group
CLONE_NEWCGROUP = 0x02000000 # New cgroup namespace
@ConnorNelson
ConnorNelson / printmaps.js
Created May 16, 2022
Print Google Maps Better
View printmaps.js
const width = "8.5in";
const height = "11in";
function sleep(s) {
var sleepTime = 1000;
return new Promise(resolve => setTimeout(resolve, sleepTime));
}
var body = document.querySelector("body");
var content = document.querySelector("#content-container");
@ConnorNelson
ConnorNelson / debug.py
Last active Feb 4, 2021
Remote Python Debugging
View debug.py
if __name__ == "__main__":
try:
main()
except Exception as e:
import sys, os, traceback
traceback.print_exc()
os.system("pip install remote-pdb")
View ropshipai_plot.py
import requests
import matplotlib.pyplot as plt
response = requests.get("https://oooverflow.io/dc-ctf-2020-finals/final_tick.json")
data = response.json()
teams = {e["id"]: e["name"] for e in data["teams"]}
services = {e["id"]: e["name"] for e in data["services"]}
View signup_for_class.js
// google-chrome --headless --disable-gpu --remote-debugging-port=9222 <website>
// ssh -L localhost:1337:localhost:9222 <server>
// document.querySelector("#username").value = "<username>";
var attempts = 0;
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
@ConnorNelson
ConnorNelson / hack_the_planet.py
Created Mar 16, 2018
iCTF 2018 - Hack The Planet
View hack_the_planet.py
#!/usr/bin/env python2
# This code was written 10 hours before the competition, yikes
# Any bugs are your problem
import socks # pip install PySocks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, '127.0.0.1', 4444)
socket.socket = socks.socksocket