Skip to content

Instantly share code, notes, and snippets.

@paulc
paulc / board.c
Created April 21, 2020 14:39
stm32f411ce_blackpill_w25q64
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
hostname: centos-2gb-nbg1-1
instance-id: 3449213
local-ipv4: ''
network-config:
config:
- mac_address: 96:00:00:33:00:b1
name: eth0
subnets:
- dns_nameservers:
- 213.133.100.100
@paulc
paulc / dev.sh
Created September 22, 2019 15:18
Automatically create dev jails
#!/bin/sh
set -e
TEMPLATE=${TEMPLATE:-dev-template}
JAIL_USER=${JAIL_USER:-user}
init() {
iocage create -r LATEST -n $TEMPLATE ip4_addr="lo1|10.1.0.1/24"
iocage exec $TEMPLATE /bin/sh -e <<EOM
@paulc
paulc / app.py
Created January 3, 2019 10:24
NACL Box
import base64,binascii,json
from libnacl import CryptError
from libnacl.public import SecretKey,PublicKey,Box
from chalice import Chalice
app = Chalice(app_name='t1')
server_key = {
"priv": "d995cb203b1b11406a1cfe1fa9d27a1117dbb216d8a8c9452239520a07537103",
@paulc
paulc / ps.S
Created January 3, 2019 10:08
FreeBSD ps (asm)
; nasm -o ps.o -f elf64 ps.S
; ld -o ps ps.o
BITS 64
section .data
arg0:
db "/bin/ps", 0
arg1:
@paulc
paulc / rc.conf
Created December 29, 2018 12:19
FreeBSD IPv6 Only
clear_tmp_enable="YES"
syslogd_flags="-ss"
sendmail_enable="NONE"
hostname="jailv6"
keymap="uk.kbd"
sshd_enable="YES"
sshd_flags="-o PermitRootLogin=prohibit-password -o ListenAddress=2001:470:1d41:1::35:1"
ntpdate_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
@paulc
paulc / install-task.ps1
Created December 29, 2018 12:01
Bhyve Metadata Stuff
New-Item -Path "C:\Program Files\VMBoot" -ItemType Directory -Force
@"
`$ts = (Get-Date).toString("yyyyMMdd-HHmmss")
`$logfile = "C:\log-vmboot-`$ts.txt"
`$server = "http://169.254.1.1:8080"
`$name = `$env:computername
`$if = Get-WmiObject win32_networkadapterconfiguration | where -property ipenabled
@paulc
paulc / box.go
Last active November 23, 2018 00:15
Go stuff
package main
import (
"encoding/gob"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"log"
"os"
@paulc
paulc / hook.js
Last active April 2, 2018 22:37
Frida PwnAdventure Hooks
// Globals
const actors = [];
const player = null;
const vec3 = Memory.alloc(12);
const sprintmod = 500.0;
// Get method references
#!/bin/sh
IFACE=${1?Usage: $0 <iface>}
tcpdump -i $IFACE -x -l 'icmp[icmptype] == 8' 2>/dev/null | awk '
/0x0020/ { packet = $4$5$6$7$8$9 }
/0x0030/ { packet = packet$2$3
if (gsub("00+$","",packet) > 0) {
print packet
system("pkill tcpdump")