Skip to content

Instantly share code, notes, and snippets.

View pry0cc's full-sized avatar
💭
Hacking the Planet

pry0cc pry0cc

💭
Hacking the Planet
View GitHub Profile
#!/bin/bash
host="$1"
remote_url="https://$host"
exe_url="$remote_url/epa/scripts/win/nsepa_setup.exe"
decom_dir="/tmp/extract/$RANDOM"
mkdir -p "$decom_dir"
#!/bin/bash
#
# https://github.com/Nyr/openvpn-install
#
# Copyright (c) 2013 Nyr. Released under the MIT License.
# Detect Debian users running the script with "sh" instead of bash
if readlink /proc/$$/exe | grep -q "dash"; then
echo "This script needs to be run with bash, not sh"
@pry0cc
pry0cc / asn.rb
Created June 14, 2020 21:18
A VERY quick and dirty ruby script to pull ASN ranges from a query.
#!/usr/bin/env ruby
require 'json'
require 'mechanize'
require 'nokogiri'
@agent = Mechanize.new
country = "us"
@pry0cc
pry0cc / enum.sh
Created June 16, 2020 00:18
Axiom enum.sh to start and delete instances for each enum
#!/bin/bash
base="bb-enum"
machines=$(axiom-ls | awk '{ print $1 }' | grep -v "Name")
domains=($@)
counter=1
log="/tmp/enum_log.txt"
init_scan() {
name="$1"
@pry0cc
pry0cc / do-ranges.txt
Created June 24, 2020 19:40
A list of DigitalOcean US ranges.
103.253.144.0/22
104.131.0.0/18
104.131.128.0/20
104.131.144.0/20
104.131.160.0/20
104.131.176.0/20
104.131.192.0/19
104.131.224.0/19
104.131.64.0/18
104.236.0.0/18
for ip in $(cat 1000.txt); do echo "Scanning $ip..."; cn=$(timeout 2 python3 dumpCN.py "$ip"); echo "{\"ip\":\"$ip\", \"cn\":\"$cn\"}" | tee -a results.txt | jq; done
@pry0cc
pry0cc / typosmash.sh
Last active April 5, 2022 19:16
A script that uses interlace and urlcrazy to multi-threadedly check if domains are available for TypoSquats
#!/bin/bash
echo "" > $1.txt
urlcrazy $1 -f csv | cut -d "," -f 2 | grep -v "Typo" > domains.txt 2>&1 | grep -v "warn"
interlace -tL domains.txt -threads 100 -c "curl -s \"https://api.scaleway.com/domain/v2alpha2/available-domains?search=_target_\" | jq -r '.[][] | select(.a
vailable==true) | .domain' >> $1.txt" >> /dev/null 2>&1
rm -f domains.txt
/usr/bin/cat $1.txt
rm $1.txt
@pry0cc
pry0cc / webserver.sh
Created July 19, 2020 21:27
A quick docker lets-encrypt webserver with php.
#!/bin/bash
DOMAIN="$1"
mkdir -p $HOME/www
docker run --detach --name nginx-proxy --restart=always --publish 80:80 --publish 443:443 --volume /etc/nginx/certs --volume /etc/nginx/vhost.d --volume /usr/share/nginx/html --volume /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
docker run --detach --name nginx-proxy-letsencrypt --restart=always --volumes-from nginx-proxy --volume /var/run/docker.sock:/var/run/docker.sock:ro jrcs/letsencrypt-nginx-proxy-companion
docker run --restart=always -d --name "apache-php" -v $HOME/www:/var/www/html -e "VIRTUAL_HOST=$DOMAIN" -e "LETSENCRYPT_HOST=$DOMAIN" php:7.3-apache
@pry0cc
pry0cc / cold
Created August 13, 2020 22:23
A quick script to generate an on-the-fly CSV of resolved assets. Useful for generating asset discovery lists.
#!/bin/bash
(echo "Subdomain,IP,Region,Country,Organization,Netblock,Link Type" && while read line; do ip=$(echo $line| cut -d " " -f 2); name=$(echo $line | cut -d " " -f 1); echo -n "$name,"; echo $ip | ipi '[.ip,.city,.region,.country,.company.name,.asn.name,.asn.route,.asn.type] | @csv'; done) | tee -a assets.csv
@pry0cc
pry0cc / autocomplete.txt
Created August 14, 2020 15:20
Axiom command auto complete, just for ZSH (those who haven't installed it recently)
export PATH="$PATH:$HOME/.axiom/interact"
source $HOME/.axiom/functions/autocomplete.zsh
compdef _axiom-ssh axiom-rm
compdef _axiom-ssh axiom-ssh
compdef _axiom-ssh axiom-select
compdef _axiom-ssh axiom-backup
compdef _axiom-ssh axiom-vpn
compdef _axiom-restore axiom-restore
compdef _axiom-deploy axiom-deploy