Skip to content

Instantly share code, notes, and snippets.

@stek29
stek29 / unlocknvram.c
Last active April 16, 2023 14:29
async_wake nvram
// iOS 11 moves OFVariables to const
// https://twitter.com/s1guza/status/908790514178301952
// however, if we:
// 1) Can find IODTNVRAM service
// 2) Have tfp0 / kernel read|write|alloc
// 3) Can leak kernel address of mach port
// then we can fake vtable on IODTNVRAM object
// async_wake satisfies those requirements
// however, I wasn't able to actually set or get ANY nvram variable
// not even userread/userwrite
@stek29
stek29 / optobw.sh
Created December 20, 2022 23:05
restore folder structure in Bitwarden after migrating from 1Password
#!/usr/bin/env bash
set -euo pipefail
# Step 0: Log in
if ! op whoami >/dev/null 2>/dev/null; then
eval "$(op signin)"
fi
if [ "$(bw status | jq -r .status)" != "unlocked" ]; then
@stek29
stek29 / proxygram-nginx.conf
Created February 24, 2019 21:52
config for nginx to proxy webogram
server {
server_name gram.com;
location / {
root /var/www/gram;
try_files $uri $uri/index.html;
# protect with basic auth, we don't want to get banned by rkn
auth_basic "webogram";
auth_basic_user_file /var/www/gram.htpasswd;
@stek29
stek29 / cloner.py
Last active July 13, 2022 05:00
t.me/stickerclonerbot -- Can somebody host this?
import requests
import io
from PIL import Image
import re
from queue import Queue
import threading
class BotException(Exception):
pass
@stek29
stek29 / k8sint.go
Created June 11, 2022 03:01
decode kubernetes internal etcd encoding to YAMLs
package main
import (
"fmt"
"io/ioutil"
"os"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/runtime/serializer/json"
@stek29
stek29 / iOS 4 (pre LwVM)
Created March 10, 2018 01:47
ioreg -c IOMedia -r -l
+-o unknown vendor unknown product Media <class IOMedia, registered, matched, $
| {
| "Leaf" = No
| "Writable" = Yes
| "BSD Minor" = 0
| "Preferred Block Size" = 4096
| "BSD Major" = 14
| "BSD Name" = "disk0"
| "Size" = 8120172544
| "Content Hint" = ""
do shell script "diskutil mount disk0s3"
tell application "System Events"
tell application "System Preferences"
set current pane to pane id "com.apple.preference.startupdisk"
activate
delay 1
end tell
tell application process "System Preferences"
@stek29
stek29 / twauth.py
Created June 11, 2022 02:57
twitter oob ouath python3
#!/usr/bin/env python
"""
requirements.txt:
certifi==2021.10.8
charset-normalizer==2.0.12
httplib2==0.20.4
idna==3.3
oauth2==1.9.0.post1
oauthlib==3.2.0
pyparsing==3.0.8
/*
* Copyright 2017 Adam H. Leventhal. All Rights Reserved.
*/
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
@stek29
stek29 / kube-apiserver-args.yaml
Created May 22, 2022 00:19
kube apiserver nginx http balancing poc
- command:
- kube-apiserver
- --bind-address=127.0.1.1
- --requestheader-allowed-names=front-proxy-client
- --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
- --requestheader-extra-headers-prefix=X-Remote-Extra-
- --requestheader-group-headers=X-Remote-Group
- --requestheader-username-headers=X-Remote-User
- --secure-port=6443
- ... more args ...