Skip to content

Instantly share code, notes, and snippets.

View ageis's full-sized avatar
💭
available for hire in Bay Area https://cointel.pro/resume

Kevin M. Gallagher ageis

💭
available for hire in Bay Area https://cointel.pro/resume
View GitHub Profile
### Keybase proof
I hereby claim:
* I am ageis on github.
* I am ageis (https://keybase.io/ageis) on keybase.
* I have a public key whose fingerprint is 2258 6762 C39A 5DFF F7D7 FDC5 5F4F 4788 5921 D69C
To claim this, I am signing this object:
@ageis
ageis / gist:3b96c48698d94c9c8419
Last active October 2, 2022 11:32
Making Tor Hidden Services Slightly More Secure
Andy Greenberg of WIRED reports that the FBI has finally revealed how they allegedly located the server on which Silk Road was hosted, and it didn't require parallel construction. http://www.wired.com/2014/09/the-fbi-finally-says-how-it-legally-pinpointed-silk-roads-server
It was a security fail.
According to FBI agent Christopher Tarbell, as related by Greenberg: "They found a misconfiguration in an element of the Silk Road login page, which revealed its internet protocol (IP) address and thus its physical location... And when they entered that IP address directly into a browser, the Silk Road's CAPTCHA prompt appeared."
While I can only speculate about what gave away the IP address, here's a few suggestions for avoiding the latter problem, which should make your .onions slightly more secure.
First off, the webserver never should have responded to HTTP requests on the server's IP address. Only traffic which comes through the Tor hidden service, which connects to the webserver's port 80 on the loopback in
@ageis
ageis / openpgp-card-guide.md
Last active December 11, 2023 09:36
Quick GPG Smartcard Guide

Keybase proof

I hereby claim:

  • I am ageis on github.
  • I am ageis (https://keybase.io/ageis) on keybase.
  • I have a public key whose fingerprint is 2C84 664F 26AA E27B AD57 90FD B604 C32A D5D7 C6D8

To claim this, I am signing this object:

Building a grsec-patched Linux kernel for Debian 8 and DigitalOcean

It's possible to run a custom (instead of hypervisor-managed) kernel for use with Debian 8.x on a DigitalOcean droplet.

We'll build one with grsecurity, "an extensive security enhancement to the Linux kernel that defends against a wide range of security threats through intelligent access control, memory corruption-based exploit prevention, and a host of other system hardening".

Note: The stable patches for Linux 3.14.x and 3.2.x are not publicly available anymore, so we'll be applying the free 4.3.x (test) patch. The URLs and filenames in this document may become outdated, so fetch the latest from grsecurity.net and kernel.org.

Install dependencies:

## Address Space Protection
# Disable privileged io: iopl(2) and ioperm(2)
# Warning: Xorg without modesetting needs it to be 0
kernel.grsecurity.disable_priv_io = 1
kernel.grsecurity.deter_bruteforce = 1
kernel.grsecurity.deny_new_usb = 0
kernel.grsecurity.harden_ipc = 1
## Filesystem Protections
@ageis
ageis / Generating stronger DH parameters for nginx
Last active December 10, 2023 13:55 — forked from plentz/nginx.conf
Generating stronger DH parameters for nginx's SSL
# run in the terminal, then set as ssl_dhparam in nginx.conf
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
@ageis
ageis / pgpgrep.py
Created December 20, 2016 22:37
Mass-decrypt PGP messages in Thunderbird folders for CLI-based email searchability
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import subprocess
import argparse
import re
import mailbox
import email.utils
import os
@ageis
ageis / systemd_service_hardening.md
Last active April 19, 2024 23:47
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@ageis
ageis / smartcard-reset.txt
Created August 25, 2017 20:48
Raw hex gpg-agent commands to reset OpenPGP smartcard(s) to factory defaults
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40