Skip to content

Instantly share code, notes, and snippets.

View ryancdotorg's full-sized avatar

Ryan Castellucci ryancdotorg

View GitHub Profile
H4sICK4p5GECA2Zsb3BweS5pbWcA7PdTrzDM0gWKTtu2bdu2bdu2bVvPtG3btm3b2O/6zm84yb7Y
nXSnqscopNIXPT7bARLi5rvv/74sABDAuwAAOgIA2gEBGgEUFDv/c5AA3h4iRuZvIkYDTgEjFn4H
2oH+w9oBgWaQnYGu3jQ1AocAgAQOF9sBwNvAGSca5VsxZhC6AAH/o80gMPZHDkUORA5eAgAAIAD8
f+v/fUu1Eg4fDrwXADDyrRmumgfABWQG4eqtGWAGLWy4Mmy4GW4G4Xcg4APM6Tpy6v9YlLNRFBGU
v0Ou74wTjIv/XfUBAEVORREAHEYRAhzCt25GAUYQRk5FAP4OuJ5FTkbOtgMA/w7At25EUQJc/g9m
jKD8z4tgBHiBb92JYowcYmAQcN2xACgAb0f+78l0jgPXA9wKdQAA9wIAP9kx/nUA+D6VXP3+/20C
6qYEFvYOpgSe9q7kTqYEpnZW9p6WduYELhamBAqGdsaG1qbOwvZ2BMwEwipihASa9q4E7qb/EW3s
7a3/xzOzdyIwJDCzMTTnh4VSsbB0/s+2d3DwJLAwdCawtzMlJJCwtzH5z6L5L+5/FcxNXVz+F2hI
4GDxH05gbGhjQ0dHBwsFC6VqbkHzf4U5Gcid/w8wNSEwtPtvO1v/Z/2v1H+opROBs4urmRmBkaGx
9f/FqVv8ryP3/9/BTyD/XxZPU2dCApX/Uhlb/C+Nnbkp4f+YonYupk4EDobOzu72TiZcBP8NABAI
@ryancdotorg
ryancdotorg / dnaas.c
Created October 30, 2013 23:20
Wrapper library to use /dev/null as a service on Linux via LD_PRELOAD
/* This is a wrapper library that will give your server the power of
* /dev/null as a service, as seen at http://devnull-as-a-service.com/
*
* Compile:
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so
*
* Try:
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16
*
* Install:
This file has been truncated, but you can view the full file.
-----BEGIN CERTIFICATE-----
MIIVBzCCE++gAwIBAgIUEMtRDRZal/Km6p9yqH7cSA9zhpUwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDYwNjIyNTMyNloXDTI1MDcw
NzIyNTMyNlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEA7AeWO/Gr29/ISHfVamyWegpSu3pnhN2VP+VUwJCAbmYw
BWTEfhAP5CZg/84FHsDSqaVs0BHZIs8I6/pW0bjmHy65GiJ2kDRFHZVcZAxln41J
vgWiJjzyMUc+kajXiVgJpM5+INryEin9sn9pkAeGRnxyPgHr4mW61R8LsIgkClFQ
CHrG42o6mG/ZRxitkPZ+9Jwo86ZKqARwXhvu4KLzR5PAgWM+u34M6iWVFziVBgpP
qlDZ3kuap3sjg3WuLLCdZuSDQDFiSJjF9JgmjLluLZVUO8XOmJqv/rSAvwzxIbpA
9dpHsz0bYXkZElbk8p26iaauWYHmrv7VzGbDcImRJwIDAQABo4ISTzCCEkswghGy
-rwxr-xr-x 1 ryanc ryanc 2696256 Jun 6 03:38 openssl-0.9.7a
OpenSSL 0.9.7a Feb 19 2003
-rwxr-xr-x 1 ryanc ryanc 2700456 Jun 6 03:37 openssl-0.9.7b
OpenSSL 0.9.7b 10 Apr 2003
-rwxr-xr-x 1 ryanc ryanc 2700696 Jun 6 03:36 openssl-0.9.7c
OpenSSL 0.9.7c 30 Sep 2003
-rwxr-xr-x 1 ryanc ryanc 2687784 Jun 6 03:35 openssl-0.9.7d
OpenSSL 0.9.7d 17 Mar 2004
-rwxr-xr-x 1 ryanc ryanc 2706504 Jun 6 03:34 openssl-0.9.7e
OpenSSL 0.9.7e 25 Oct 2004
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD4ouzi+xIV9tDq
enf7f/aEbnG/Li/9GT2KF3ofEe8taqAxKxmK0W1diGQMMWMX71Wb2cMjoCYWDWFd
qMF5zusvXqALWpiPMj52s/A8Fgo2ROf8MrWa91mjKjvuZmWFB8h+4L45PPP17ZyC
XgMSqRMIykhm0F/HN+B42t+7+11nWU3rXF7173uhLvk5MjAP+SH031ug32BAz6jq
w8sjXfLG/7/HI3ObZKEGCWEIUpA/HL7PU8XW2r2UH/NGnoUYB7xk235cGrYirtT1
3IuG5bhf6a7gMG4HuDBjchUDyOGsm9StOUizP4MvYWSwj1Zkj0qv0pL3BLfed9r+
BotGdH7hAgMBAAECggEAdG5LMuFyrzFk1KCkBfR+2rYjcuzskP+cV0m2KM2LrL9l
I5E0xVJb/fRMMX+BEWjEtJZNcKXin+oFIchQTbutW4HavWZf0ZKsOIb7pQ+HGbG7
1thiPZ697Y/t/64YtSqXY37X5VLbRVtPMqdWlgrxvGiJbgf/CfnrFn0cT1me/DEj
@ryancdotorg
ryancdotorg / decrypt.py
Created December 23, 2021 00:05
Decrypt firmware images for (some) EnGenius devices
#!/usr/bin/env python3
import sys
key = b'\xac\x78\x3c\x9e\xcf\x67\xb3\x59'
filename = sys.argv[1]
def decrypter(reference):
n = len(key)
@ryancdotorg
ryancdotorg / builder.sh
Last active April 22, 2024 16:00
Script to statically cross compile various useful binaries (dropbear, socat, rsync, rpcapd, tcpdump, openssl, zstd) using musl-libc via musl.cc toolchains,
#!/bin/bash
# From https://gist.github.com/ryancdotorg/84275935f0b82578d8c222e2e915fc78
# built binaries at https://ryanc-musl-bins.s3.amazonaws.com/SHA256SUMS.html
set -eo pipefail
set -x
export BUILD_SCRIPT_DATE="$(date -r "$0" -Iseconds)"
PV_VERSION=1.8.5
@ryancdotorg
ryancdotorg / wzip.py
Last active April 8, 2024 14:20
Partial/streaming zip downloader
#!/usr/bin/env python3
# SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense
# Copyright (c) 2023, Ryan Castellucci, No Rights Reserved
import io, sys
import datetime
import argparse
import requests
import operator
import struct
// This will look for a form that has titles to select from a dropdown list,
// add "Mx" as an option if not already present, and mark "Mx" as active.
// WARNING: This will not work on all sites, and subtle breakage may occur
// that is not immediately obvious. Please get in touch if you have ideas
// for improvement. You need to save the URL below as a bookmark, and then
// you can select it from your bookmarks to run it on the current page.
javascript:(D=>{D.querySelectorAll("option[value^=mrs i]").forEach(N=>{for(var r=D.createElement("option"),p=N.parentNode,o=p.children,t=0;t<o.length;++t)if(/^mx/i.test(o[t].value))return o[t].selected=!0;r.value=r.innerText=N.value.replace(/rs/i,s=>"R"==s[0]?"X":"x"),p.appendChild(r),r.selected=!0})})(document)