Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software (NGiNX & Apache (httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker etc.)
OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest config
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
#!/bin/ksh | |
set -o errexit -o pipefail -o nounset -o noclobber -o noglob | |
set +o monitor | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
# Convert the IP to an integer so do calculations on it | |
dottedQuad2int() { | |
local IFS=. | |
local ip | |
set -A ip $* 0 0 0 0 |
How to configure FreeBSD and applicable applications to work with Yubikey for authentication. This serves as my work-in-progress documentation of the configuration knobs needed to make this work properly.
- FreeBSD ssh with piv smartcard slot on Yubikey (pkcs11 via
libykcs11.so
) - FreeBSD ssh with fido support on Yubikey
- FreeBSD Firefox/Chromium with fido + webauthn support on Yubikey
- FreeBSD local console and gdm authentication using pam on Yubikey
- FreeBSD official YubiKey tools
- FreeBSD 13.2 Testing (Aug 2023)
- FreeBSD stable/13 Testing (Aug 2023) with OpenSSH_9.3p2
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
# /etc/sysctl.conf | |
# Clemens Gruber, 2014 | |
# | |
# Uncomment this to prevent users from seeing information about processes that | |
# are being run under another UID. | |
security.bsd.see_other_uids=0 | |
## I/O |
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
""" Calculate the subnet mask, its binary representation, number of host and | |
network bits, and the total number of hosts for a given CIDR address. | |
Usage: python cidr.py [cidr] | |
Notes: Pipe the command to jq to pretty print the JSON. Python 2 or 3 compatible. | |
Examples: | |
python cidr.py 10.0.0.0/24 | |
python cidr.py 172.0.0.0/16 | jq | |
""" | |
from __future__ import print_function |
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/python3 | |
import os | |
shodan = ["104.131.0.69", "104.236.198.48", "155.94.222.12","155.94.254.133", "155.94.254.143", "162.159.244.38", "185.181.102.18", "188.138.9.50", "198.20.69.74", "198.20.69.98", "198.20.70.114", "198.20.87.98", "198.20.99.130", "208.180.20.97", "209.126.110.38", "216.117.2.180", "66.240.192.138", "66.240.219.146", "66.240.236.119", "71.6.135.131", "71.6.146.185", "71.6.158.166", "71.6.165.200", "71.6.167.142", "82.221.105.6", "82.221.105.7", "85.25.103.50", "85.25.43.94", "93.120.27.62", "98.143.148.107", "98.143.148.135"] | |
for ip in shodan: | |
os.system("iptables -A INPUT -s {} -j DROP".format(ip)) |
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
a.myhost.com { | |
tls off | |
root /var/www/ | |
proxy / localhost:8091 | |
log log/access.a.log | |
} | |
b.myhost.com { | |
tls off | |
root /var/www/ |
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
Open Firmware, 2.0 | |
To continue booting the MacOS type: | |
BYE<return> | |
To continue booting from the default boot device type: | |
BOOT<return> | |
ok | |
0 > boot scsi/sd@3:0 -a | |
OF_open bootpath= | |
read stage 2 blocks: 0. done! | |
starting stage 2... |
NewerOlder