Skip to content

Instantly share code, notes, and snippets.

@wido
wido / random-ipv6-addr.py
Last active May 31, 2023 18:43
Generate a random IPv6 address
#!/usr/bin/env python3
"""
Generate a random IPv6 address for a specified subnet
"""
from random import seed, getrandbits
from ipaddress import IPv6Network, IPv6Address
subnet = '2001:db8:100::/64'
@victoredwardocallaghan
victoredwardocallaghan / gist:9425974
Created March 8, 2014 05:52
Stopping SSH Brute Force attacks with PF.
# Make table to keep track of IP's of SSH brute forcers:
table <bruteforce> persist
# Make sure they are unable to connect to the system after being appended to table:
block quick from <bruteforce>
# The rule how one is appended to the table..
# By connecting with more then 5 clients to the SSH port
# and try reconnect 5 times within 30 secs, append client machine to the table:
pass inet proto tcp from any to any port ssh \