This file contains hidden or 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
#include <string.h> | |
/* | |
gcc -c -o hook.o hook.c | |
gcc -shared -o hook.so hook.o | |
LD_PRELOAD=./hook.so ./binary | |
*/ | |
int getentropy(char *s, int size) { | |
memset(s, 0x41, size); |
This file contains hidden or 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
# Edit: this doesn't work, I can't get the upstream part to be "raw" | |
# Also this error: "http.request.tls.server_name" will be "signal.xn--sb-lka.org" and not the inner SNI | |
signal.xn--sb-lka.org { | |
#respond / "HELLO" | |
map {http.request.tls.server_name} {my_placeholder} { | |
chat.signal.org "chat.signal.org:443" | |
ud-chat.signal.org "chat.signal.org:443" | |
textsecure-service.whispersystems.org "chat.signal.org:443" |
This file contains hidden or 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 io import BytesIO | |
from time import sleep, time | |
from picamera import PiCamera | |
from PIL import Image, ImageChops | |
import numpy as np | |
def take_image(cam, stream): | |
stream.seek(0) | |
# stream.truncate() # resize to current position | |
print("Taking image") |
This file contains hidden or 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 io import BytesIO | |
from time import sleep, time | |
from picamera import PiCamera | |
from PIL import Image, ImageChops | |
import numpy as np | |
def take_image(cam, stream): | |
cam.capture(stream, resize=(320, 240), format='jpeg') | |
# "Rewind" the stream to the beginning so we can read its content | |
stream.seek(0) |
This file contains hidden or 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
# Start matrix with tor proxy: | |
# torsocks python3 -m synapse.app.homeserver --config-path /etc/matrix/homeserver.yaml | |
# /etc/matrix/homeserver.yaml | |
listeners: | |
- port: 8448 | |
type: http | |
tls: false # <-- needs to be false | |
bind_addresses: ['127.0.0.1'] | |
resources: |
This file contains hidden or 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
Problem: | |
Error TS2688: Cannot find type definition file for 'frida-gum' | |
Solution: | |
yarn add --dev @types/frida-gum | |
Problem: | |
[TypeScript error: /node_modules/@types/frida-gum/index.d.ts(2317,15): Error TS2300: Duplicate identifier 'File'.] | |
Solution: |
This file contains hidden or 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 | |
import json, os, sqlite3 | |
from datetime import datetime | |
from random import randint | |
from time import time, sleep | |
try: | |
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient # pip3 install azure-storage-blob | |
except: pass | |
def get_db(): |
This file contains hidden or 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 time import time | |
from functools import partial | |
import random | |
import trio # python3 -m pip install --upgrade trio | |
FTP_RESPONSE = "\r\n".join([ | |
"220 ProFTPD 1.3.1 Server (ProFTPD)", | |
"220 " + "".join(random.choice('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') for _ in range(1001)), | |
"331 Password required" | |
]) |
This file contains hidden or 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 trio # python3 -m pip install --upgrade trio | |
from functools import partial | |
async def forward_from_a_to_b(a, b): | |
async for chunk in a: | |
print(f"=> {chunk}", flush=True) | |
await b.send_all(chunk) | |
This file contains hidden or 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 re | |
import time | |
import httpx | |
URL = "https://smittestop.dk/status/" | |
r = httpx.get(URL) | |
assert r.status_code == 200, f'{r.status_code}: {r.content}' |