Skip to content

Instantly share code, notes, and snippets.

View 3m3x's full-sized avatar

3m3x 3m3x

View GitHub Profile
@3m3x
3m3x / cli.go
Last active December 16, 2019 04:24
Poor-man's CLI in Go
/*
Objective:
- to dynamically and arbitrarily call functions of varying signature
- to look up help info stored against a function
Example:
- given the command "func1" and parameter "abc"
- call the function by that name (if present), passing in "abc"
- given a non-existent function name, return an error message
@3m3x
3m3x / wifi-info.py
Created October 19, 2019 14:18
Show detailed info about the surrounding wifi networks
#!/usr/bin/env python
#
# Needs root priv to run
#
from pprint import pprint as pp
import re
import subprocess
import sys
@3m3x
3m3x / README.md
Last active February 12, 2025 04:44
Update proxy list in proxychains config

What?

A thin Python script to update the proxy list in proxychains.conf with output from proxybroker.

Why?

Well, the proxies pulled down by proxybroker are often stale or useless for our purposes.

And updating proxychains.conf with new proxies is a pain in the ass.

Ok

Just run it in the background and never be without usable proxies again (⌐■_■)

@3m3x
3m3x / Google-Functions-filesystem.txt
Created September 20, 2019 09:51
Filesystem layout of a Google Functions container
/
/bin
/bin/bash
/bin/bunzip2
/bin/bzcat
/bin/bzcmp
/bin/bzdiff
/bin/bzegrep
/bin/bzexe
/bin/bzfgrep
@3m3x
3m3x / proc_cheat_sheet.sh
Last active September 20, 2019 08:40
Useful commands to run against /proc
# Obtain the (IPv4) addresses for all network interfaces
awk '/32 host/ { print f } {f=$2}' <<< "$(</proc/net/fib_trie)"
# Get info about the CPU
cat /proc/cpuinfo
# List the available filesystems
cat /proc/filesystems
# See what filesystems are mounted
@3m3x
3m3x / networking.sh
Created September 19, 2019 05:16
General networking cheat sheet
# Look up all DNS records
nslookup -type=any example.com
dig example.com ANY +noall +answer
# Get your current IP from the Internet's point of view
curl -s http://ifconfig.co
@3m3x
3m3x / wordpress-recon.sh
Last active September 13, 2019 14:17
Get info on Wordpress installs
export API_TOKEN=YOUR_WPVULNDB_API_TOKEN
# Get all vuln info foor Wordpress 5.2.3
curl -H "Authorization: Token token=$API_TOKEN" https://wpvulndb.com/api/v3/wordpresses/523
# Get all of the vulnerabilities that affect a particular plugin
curl -H "Authorization: Token token=API_TOKEN" https://wpvulndb.com/api/v3/plugins/eshop
# Get all of the vulnerabilities that affect a particular theme
curl -H "Authorization: Token token=API_TOKEN" https://wpvulndb.com/api/v3/themes/pagelines
@3m3x
3m3x / nmap-scan-diff.sh
Created September 13, 2019 11:45
Nmap a target periodically and be updated on any changes
#!/bin/sh
#
# Taken from https://nmap.org/book/ndiff-man-periodic.html
#
# Add the following to your crontab to run the scan at 1PM each day:
#
# 0 13 * * * /home/YOUR_HOME_DIR/bin/nmap-scan-diff.sh
#
TARGETS="192.168.1.1"
@3m3x
3m3x / aws_cli_cheat_sheet.sh
Last active September 12, 2019 08:01
AWS CLI cheat sheet
# Anonymously read and write to S3 bucket
aws s3 ls s3://$RANDOM_BUCKET/ --region us-east-1 --no-sign-request
aws s3 cp $HOME/my_file.js s3://$RANDOM_BUCKET/js/ --region us-east-1 --no-sign-request
# Show all hosted zones
aws route53 list-hosted-zones | jq '.HostedZones [] .Name'
# Show route tables
aws ec2 describe-route-tables | \jq '.RouteTables | .[] | .Routes [] | .GatewayId + " " + .DestinationCidrBlock' | sort | uniq
@3m3x
3m3x / mal_filename_post.py
Last active September 10, 2019 12:26
Malicious POSTing with the requests library
#!/usr/bin/env python3
import requests
LOGIN_URL = 'http://localhost:8888/login'
sesh = requests.Session() # create cookie-persisting session
login_page = sesh.get(LOGIN_URL)
assert login_page.status_code == 200