Skip to content

Instantly share code, notes, and snippets.

$ ls ~/.tor/keys/
OR keys:
* `secret_id_key` => identity key (PEM RSA private key)
* `secret_onion_key` => ? (PEM RSA private key)
* `secret_onion_key_ntor` => A relay's Curve25519 short-term onion key.
ed25519 keys:
* `ed25519_master_id_public_key` => The public part of a relay's Ed25519 permanent identity key.
@NicolaiSoeborg
NicolaiSoeborg / facebook-bridge.md
Created September 9, 2020 22:05
Setting up matrix - facebook bridge
@NicolaiSoeborg
NicolaiSoeborg / build-ghidra.sh
Last active September 27, 2020 09:37
Building Ghidra
git clone git@github.com:NationalSecurityAgency/ghidra.git
cd ghidra
# You need gradle v5.x or higher! (Ubuntu 20.04 ships 4.x)
gradle --init-script gradle/support/fetchDependencies.gradle init
gradle buildGhidra
# Now ghidra will be in: build/dist/ghidra_*_DEV_*.zip
@NicolaiSoeborg
NicolaiSoeborg / harden.sh
Last active April 27, 2024 12:59
deb/apt based security tools
# Verify deb checksums:
sudo apt install debsums
# RNG tools:
sudo apt install rng-tools5
# TPM tools
sudo apt install tpm2-tools
# Monitor for ARP spoofing
@NicolaiSoeborg
NicolaiSoeborg / smittestop-scrape.py
Created November 17, 2020 23:11
Scrape smittestop status
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}'
@NicolaiSoeborg
NicolaiSoeborg / forwarder.py
Last active March 18, 2021 10:35
MITM proxy program to forward (tee) traffic between two TCP ports
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)
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"
])
@NicolaiSoeborg
NicolaiSoeborg / BME680-logger.py
Last active January 30, 2022 16:03
Save and plot data from BME680 (Raspberry Pi)
#!/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():
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:
# 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: