Skip to content

Instantly share code, notes, and snippets.

$ ./hashcat -b
hashcat (v6.2.6-549-gd3f7c5132) starting in benchmark mode
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
The device #1 has been disabled as it most likely also exists as an OpenCL device, but it is not possible to automatically map it.
You can use -d 1 to use Metal API instead of OpenCL API. In some rare cases this is more stable.
@dustyfresh
dustyfresh / pandas-m1.md
Created March 28, 2021 17:06
install pandas and numpy on the macbook M1
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ pip install --upgrade pip
$ pip install Cython
$ pip install numpy --no-use-pep517
$ pip install pandas
@dustyfresh
dustyfresh / inkyphat-crypto-ticker.py
Created November 18, 2020 00:54
Crypto price ticker with the inkyphat eink display
#!/usr/bin/env python3
import cryptocompare
from time import sleep
from inky import InkyPHAT
from random import shuffle
from datetime import datetime
from PIL import Image, ImageDraw, ImageColor, ImageFont
def log(msg):
#print(msg)
@dustyfresh
dustyfresh / hashtables.py
Created April 22, 2020 23:50
script for quickly generating hash tables from a password list
#!/usr/bin/env python
import json
import time
import hashlib
import multiprocessing as mp
class Hashes(object):
def md5(s):
return hashlib.md5(str(s).encode()).hexdigest()
@dustyfresh
dustyfresh / tshark.md
Last active December 31, 2024 16:53
Systemd service to capture all traffic on ports 53/80/443. tshark will store up to 10MB of data per pcap file, and keep store up to 2GB of captures on disk. Once 2GB disk limit is reached, tshark will rotate older pcaps. Change the filecount in the capture script if you want to store more traffic on disk.

Continuous capture

Tested on Ubuntu 18.04.

Install tshark

You will want to allow non-root users to capture packets. These users must be part of the wireshark group.

$ sudo apt update
@dustyfresh
dustyfresh / gzip_remote_file.py
Created March 30, 2020 22:48
read gzipped data from a remote file as a string
import io
import gzip
import requests
data = requests.get('https://url/file.txt.gz', stream=True)
in_ = io.BytesIO()
in_.write(data.content)
in_.seek(0)
gunzipped_bytes_obj = gzip.GzipFile(fileobj=in_, mode='rb').read()
data = gunzipped_bytes_obj.decode()
@dustyfresh
dustyfresh / ssh-dd.sh
Created March 28, 2020 15:20
dd remote server over SSH
#!/bin/bash
ssh root@host "dd if=/dev/sda1" | dd of=host.img
@dustyfresh
dustyfresh / fast_resolv.py
Last active March 26, 2020 22:39
fast DNS resolution
#!/usr/bin/env python
import json
import dns.resolver
import multiprocessing as mp
def worker(hostname, results):
resolv = dns.resolver.Resolver()
resolv.nameservers = [
'8.8.8.8', # Google
'8.8.4.4', # Google
@dustyfresh
dustyfresh / default.conf
Last active May 10, 2022 12:53
Hardened nginx config
# Security enhancements and custom Nginx server header
#
# Requirements:
# $ apt install nginx vim
# $ apt install libnginx-mod-http-headers-more-filter
# $ vim /etc/nginx/sites-enabled/default
#
# Further reading http://docs.hardentheworld.org/Applications/Nginx/
#
server {
@dustyfresh
dustyfresh / secrets.yara
Last active October 11, 2022 21:26
yara signatures converted from trufflehog regexes for identifying secrets in text files
/*
Yara signatures for identifying secrets in text files. Requires libmagic!
Mostly all stolen from Trufflehog regexes:
- https://github.com/dxa4481/truffleHogRegexes/blob/master/truffleHogRegexes/regexes.json
*/
import "magic"