Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

dustyfresh dustyfresh

🎯
Focusing
View GitHub Profile
@dustyfresh
dustyfresh / hashtables.py
Created Apr 22, 2020
script for quickly generating hash tables from a password list
View hashtables.py
#!/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 Sep 18, 2020
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.
View tshark.md

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 Mar 30, 2020
read gzipped data from a remote file as a string
View gzip_remote_file.py
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 Mar 28, 2020
dd remote server over SSH
View ssh-dd.sh
#!/bin/bash
ssh root@host "dd if=/dev/sda1" | dd of=host.img
@dustyfresh
dustyfresh / fast_resolv.py
Last active Mar 26, 2020
fast DNS resolution
View fast_resolv.py
#!/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 Apr 12, 2020
Hardened nginx config
View default.conf
# 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 Feb 18, 2020
yara signatures converted from trufflehog regexes for identifying secrets in text files
View secrets.yara
/*
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"
@dustyfresh
dustyfresh / gdpr.txt
Created Jan 20, 2020
GDPR text, but replaced cookies with biscuits
View gdpr.txt
27 April 2016
On the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (General Data Protection Regulation)
(Text with EEA relevance)
THE EUROPEAN PARLIAMENT AND THE COUNCIL OF THE EUROPEAN UNION,
Having regard to the Treaty on the Functioning of the European Union, and in particular Article 16 thereof,
@dustyfresh
dustyfresh / pwnagotchi_ids.py
Last active Oct 20, 2019
script to grab each pwnagotchi unit's fingerprint. You can redirect this output to a list and loop through each fingerprint to broadcast messages to ALL pwnagotchi units OwO
View pwnagotchi_ids.py
#!/usr/bin/env python
'''
$ ./pwnagotchi_ids.py | while read fingerprint; do pwngrid -send $fingerprint -message "( ͡° ͜ʖ ͡°)"; done
'''
import json
import requests
def main():
blacklist = open('./blacklist.txt', 'r').read().splitlines()
page = 0
You can’t perform that action at this time.