Skip to content

Instantly share code, notes, and snippets.

🌍
Hack the planet!

David Buchanan DavidBuchanan314

🌍
Hack the planet!
Block or report user

Report or block DavidBuchanan314

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
View keybase.md

Keybase proof

I hereby claim:

  • I am davidbuchanan314 on github.
  • I am retr0id (https://keybase.io/retr0id) on keybase.
  • I have a public key ASB6O_-BfLaLrW9ng0jX25RMP-G7gg-GoRAVlUQu7ayqnQo

To claim this, I am signing this object:

View nopmark.c
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/time.h>
const size_t nop_len = 8L * 1024 * 1024 * 1024; // 8GiB
double time_double()
{
View connectmii.py
"""
This script sets up the bare minimum needed to get a Nintendo Switch console
to connect to a wifi network, without an actual internet connection.
Namely:
- A DNS server that points every record to the host running the server
- An HTTP server that responds with the `X-Organization: Nintendo` header.
This script must be run as root to acquire the permissions to listen on the
relevant ports.
@DavidBuchanan314
DavidBuchanan314 / dumb.py
Last active Apr 8, 2019
PoC web directory scanner using asyncio. It's fast. NOTE: This does not follow any particular HTTP spec and is probably very broken. AIOHTTP would be a more reliable solution, but in my tests it was a lot slower...
View dumb.py
import asyncio
from urllib.parse import quote
# dirb time: 1m36.7s
# 32 workers: 3.6s
DOMAIN = "www.google.com"
async def scan_worker(queue):
while True:
@DavidBuchanan314
DavidBuchanan314 / root_my_vm.py
Last active Nov 6, 2019
Get root any running *nix VM by patching it's memory from the host.
View root_my_vm.py
#!/usr/bin/python3
import sys
import os
import signal
PATTERN = b"root:x:0:0:root"
REPLACE = b"root::00:0:root"
View otw_advent_2018_day0.txt
01101101011001010111001001110010011110/ \010010000001101000011001010111100001101
101011000010111001100100000001011010 / f \ 0100000011011010110010101110010011100
10011110010010000001101000011001010 / a31 \ 111100001101101011000010111001100100
0000010110100100000011011010110010 / c0 8e \ 10111001001110010011110010010000001
101000011001010111100001101101011 / d88 e \ 0000101110011001000000010110100100
00001101101011001010111001001110 / c08ee08ed \ 010011110010010000001101000011001
0101111000011011010110000101110 / 08 ee83 1 \ 01100100000001011010010000001101
101011001010111001001110010011 / dbbc 0 0 7c \ 1100100100000011010000110010101
11100001101101011000010111001 / b eb17 ce88d 0 \ 100100000001011010010000001101
1010110010101110010011100100 / 0bfc a7c30 e 4cd \ 11110010010000001101000011001
View addless_add.c
#include <stdio.h>
#include <stdint.h>
#define ADD_LOBIT(a, b, c) ((a)^(b)^(c))
#define ADD_CARRY(a, b, c) ((a&b)|(b&c)|(c&a))
#define ADD_ROUND(i) \
c|=ADD_LOBIT((a>>(i))&1,(b>>(i))&1,carry)<<(i); \
carry=ADD_CARRY((a>>(i))&1,(b>>(i))&1,carry);
@DavidBuchanan314
DavidBuchanan314 / 35c3_collection.py
Created Dec 30, 2018
Dirty code, cleanup/writeup to follow...
View 35c3_collection.py
os = [t for t in ().__class__.__bases__[0].__subclasses__() if 'ModuleSpec' in t.__name__][0].__repr__.__globals__['sys'].modules["os.path"].os
opmap = {'POP_TOP': 1, 'ROT_TWO': 2, 'ROT_THREE': 3, 'DUP_TOP': 4, 'DUP_TOP_TWO': 5, 'NOP': 9, 'UNARY_POSITIVE': 10, 'UNARY_NEGATIVE': 11, 'UNARY_NOT': 12, 'UNARY_INVERT': 15, 'BINARY_MATRIX_MULTIPLY': 16, 'INPLACE_MATRIX_MULTIPLY': 17, 'BINARY_POWER': 19, 'BINARY_MULTIPLY': 20, 'BINARY_MODULO': 22, 'BINARY_ADD': 23, 'BINARY_SUBTRACT': 24, 'BINARY_SUBSCR': 25, 'BINARY_FLOOR_DIVIDE': 26, 'BINARY_TRUE_DIVIDE': 27, 'INPLACE_FLOOR_DIVIDE': 28, 'INPLACE_TRUE_DIVIDE': 29, 'GET_AITER': 50, 'GET_ANEXT': 51, 'BEFORE_ASYNC_WITH': 52, 'INPLACE_ADD': 55, 'INPLACE_SUBTRACT': 56, 'INPLACE_MULTIPLY': 57, 'INPLACE_MODULO': 59, 'STORE_SUBSCR': 60, 'DELETE_SUBSCR': 61, 'BINARY_LSHIFT': 62, 'BINARY_RSHIFT': 63, 'BINARY_AND': 64, 'BINARY_XOR': 65, 'BINARY_OR': 66, 'INPLACE_POWER': 67, 'GET_ITER': 68, 'GET_YIELD_FROM_ITER': 69, 'PRINT_EXPR': 70, 'LOAD_BUILD_CLASS': 71, 'YIELD_FROM': 72,
@DavidBuchanan314
DavidBuchanan314 / panopto_dl.py
Last active Aug 3, 2019
Panopto video downloader
View panopto_dl.py
import requests
import json
import os
import youtube_dl
PANOPTO_BASE = "https://cardiff.cloud.panopto.eu"
"""
Place the value of your .ASPXAUTH token in the following variable
"""
@DavidBuchanan314
DavidBuchanan314 / App.js
Created Nov 27, 2018 — forked from oliverjc/App.js
Cardiff Uni Phishing Attack
View App.js
import React, { Component } from 'react'
import axios from 'axios'
import { Helmet } from 'react-helmet'
import { createBrowserHistory } from 'history'
const browserHistory = createBrowserHistory({ forceRefresh: false })
var randomstring = require('randomstring')
const devtools = require('devtools-detect')
let DISABLE_PROTECTION = true
You can’t perform that action at this time.