Skip to content

Instantly share code, notes, and snippets.

@NicolaiSoeborg
NicolaiSoeborg / harden.sh
Last active October 3, 2024 13:53
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 / build-ghidra.sh
Last active September 27, 2020 09:37
Building Ghidra
git clone [email protected]: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 / facebook-bridge.md
Created September 9, 2020 22:05
Setting up matrix - facebook bridge
$ 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.
# Install fail2ban (ratelimit auth) and google auth (MFA)
sudo apt install fail2ban libpam-google-authenticator
# Setup MFA:
google-authenticator
# I'm using: y, y, n, n, y
Add `auth required pam_google_authenticator.so` to the end of `/etc/pam.d/sshd`
Also comment out `@include common-auth` after doing the steps below.
#!/usr/bin/env python3
import bme680
from time import time, sleep
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
# Setup:
# python3 -m pip install bme680 prometheus-client
# sudo apt install --no-install-recommends prometheus prometheus-pushgateway
BURN_IN_TIME = 1800 # 30 min
pbKey32 = AesKdf(
data: sha256("123456:133337:987654"),
seed: TransformationKey, // 32 CryptoRandom bytes
rounds: 10.000
)
pbSecret = OtpUtil.DecryptData(
encryptedSecret,
pbKey32,
FromBase64String(m_otpInfo.EncryptionIV)
# General:
browser.urlbar.trimURLs = false;
browser.quitShortcut.disabled = true;
# (you might want to add some more from: https://github.com/pyllyukko/user.js/blob/master/user.js)
# Tracking:
privacy.donottrackheader.enabled = true;
privacy.trackingprotection.enabled = true;
privacy.trackingprotection.socialtracking.enabled = true;
@NicolaiSoeborg
NicolaiSoeborg / Ubuntu-cleanup.sh
Last active November 8, 2024 10:43
Remove some of the bloat coming with ubuntu-minimal + changing defaults + flatpak
sudo apt install git htop tmux curl vim xclip
sudo apt install --no-install-recommends neovim
# Remove Ubuntu-branded XUL crapware:
sudo apt purge xul-ext-ubufox
# Stuff that I don't use:
sudo apt autoremove --purge snapd gnome-software-plugin-snap
sudo apt remove whoopsie
sudo apt remove bluez bluez-cups bluez-obexd
Install Qubes OS 4.0.1
In dom0:
$ sudo vim /etc/yum.repos.d/qubes-dom0.repo
$ sudo vim /etc/yum.repos.d/qubes-templates.repo
Change to "Enabled=1" for the *-testing repos
Update dom0 packages
$ sudo qubes-dom0-update
Install Debian 10 (buster) template