This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Cross platform, rootless, and fast debootstrap. | |
Designed to work anywhere you can run Python and Docker/Podman (e.g. a Mac laptop). | |
* Tested only with Ubuntu Focal and Jammy | |
* Right now LZMA decoding takes up most of the time. Parallelize it? Python's LZMA | |
library does release the GIL. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright 2021 Josh Snyder | |
# See license and documentation in lambda_function.py | |
set -x -o errexit -o nounset | |
ebs_name() { | |
nvme id-ctrl -o binary $1 | cut -c3073-3104 | tr -d ' ' | |
} | |
export AWS_DEFAULT_REGION=$AWS_REGION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scientific American | |
May 1973 | |
Volume 228 | |
Number 5 | |
Cryptography and Computer Privacy | |
by Horst Fiestel | |
Computer systems in general and personal "data banks" in particular | |
need protection. This can be achieved by enciphering all material and authenticating |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A little x86-64 loader for Linux's binfmt_misc. | |
* | |
* Compile with: gcc -O3 -static -nostdlib -o loader loader.c | |
* | |
* Register as: | |
* mount -t binfmt_misc none /proc/sys/fs/binfmt_misc | |
* echo ':amd64:E::amd64::/path/to/loader:O' > /proc/sys/fs/binfmt_misc/register | |
* | |
* Then just run your favorite shellcode. Sample: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moving from running to port closed took: 3.147979 s | |
Moving from port closed to port open took: 0.000000 s | |
Moving from running to port closed took: 2.366330 s | |
Moving from port closed to port open took: 0.000000 s | |
Moving from running to port closed took: 2.998677 s | |
Moving from port closed to port open took: 0.000000 s | |
Moving from running to port closed took: 2.605815 s | |
Moving from port closed to port open took: 0.024404 s | |
Moving from running to port closed took: 2.754971 s | |
Moving from port closed to port open took: 0.009866 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- this uses a squashfs root image with a writable overlay | |
- only a single application service is running (sshd) | |
- the instance was a c5.large that had already booted once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- This run was on a c5.large which had been booted up before | |
- Set MODULES=dep in /etc/initramfs-tools/initramfs.conf | |
- Deleted a bunch of initramfs-tools hooks, including especially: iscsi mdadm lvm2 | |
- Removed a bunch of stock ubuntu services | |
* snapd | |
* ec2-instance-connect | |
* cryptsetup-initramfs | |
* udisks2 | |
* unattended-upgrades | |
* plymouth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
josh@ubuntu:~/hasher$ dd if=/dev/zero bs=65536 count=16384 | ./xxHash/xxh128sum | |
16384+0 records in | |
16384+0 records out | |
16024760318c6298efd1151033ad2e9f stdin | |
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.23966 s, 4.5 GB/s | |
josh@ubuntu:~/hasher$ dd if=/dev/zero bs=65536 count=16384 | ./a.out | |
16384+0 records in | |
16384+0 records out | |
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.210685 s, 5.1 GB/s | |
16024760318c6298efd1151033ad2e9f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.lang.Runnable; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.ThreadFactory; | |
public class CGroupThreads { | |
static class CGThread extends Thread { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aiohttp.client_exceptions import ClientError | |
import asyncio | |
from asyncio import Queue | |
from aiohttp.resolver import AsyncResolver | |
import json | |
import os | |
import random | |
from blake3 import blake3 | |
from hashlib import md5 | |
from socket import socketpair |