Skip to content

Instantly share code, notes, and snippets.

View TheTechromancer's full-sized avatar

TheTechromancer

View GitHub Profile
#!/usr/bin/env python3
import sys
import asyncio
from bbot.scanner import Scanner
try:
file = sys.argv[-1]
except KeyError:
@TheTechromancer
TheTechromancer / clean_dns_records.py
Created October 11, 2022 20:39
A simple python script to filter out unresolved/wildcard DNS records.
#!/usr/bin/env python3
import sys
import string
import random
import dns.resolver
import threading
import tldextract
import concurrent.futures
This file has been truncated, but you can view the full file.
# top subdomain append/prepends
# derived from top 1 million subdomains: https://github.com/bitquark/dnspop
401055 {}
8350 {}2
8035 {}1
4012 {}3
2766 {}4
2585 {}01
2183 {}5
@TheTechromancer
TheTechromancer / kill_detached_mosh_sessions.sh
Created May 12, 2021 16:22
Kill all detached mosh sessions
kill $(last -f /var/run/utmp | egrep -o 'mosh \[[0-9]+\]' | egrep -o '[0-9]+')
@TheTechromancer
TheTechromancer / session_logging.sh
Created February 4, 2021 20:18
Enable complete session logging (input and output) for both normal shells and individual tmux panes
# default tmux config
cat <<EOF > "$HOME/.tmux.conf"
set -g mouse on
set -g history-limit 50000
# List of plugins
set -g @plugin 'tmux-plugins/tmux-logging'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
@TheTechromancer
TheTechromancer / dhcp_option_121.py
Created November 9, 2019 22:16
DHCP Option 121 (Routes) with Python 3 for pfSense, etc.
#!/usr/bin/env python3
from ipaddress import *
routes = [
# destination # router
('10.0.0.0/24', '172.16.0.2'),
('0.0.0.0/0', '172.16.0.1')
]