Skip to content

Instantly share code, notes, and snippets.

@averagesecurityguy
averagesecurityguy / id_rsa.pub
Last active April 6, 2016 03:18
ISSA Presentation
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKsydz5gVrN3Ixi1qC2otXfjs1gs9CQFHKLE+C6RRClzCSxdb7midOkAtm7cY3WQXUxeuBzy+i7+GlLCm8rub8TSg5Mx3K1IiEW2WQe7i5fL+fQwCT1W8IKa7q5V5oYOALNvIcjs2tfdMQQjPQlWaeWl21p5wgdT8oeczpx+hGLR4ipTc/KFFnj3gDQ0BiYezoPG06oZG7f7skOlfDK9M9WbDEwmhtqR4KyRIYQbsyTMGKmVidXnoSVgA7YBH6zjJUSlbURlm0G21+U79KH5SY/k5jprsQ6WHmzz/0SieYpikH2n9bmbd8/oazRX7agduD3ky+WjP2S9CYK3asVr6l [email protected]
@averagesecurityguy
averagesecurityguy / output
Last active February 17, 2016 19:55
Sudoers Check
[-] root is allowed to execute all programs as any user.
[-] %sudo is allowed to execute all programs as any user.
[-] %admin is allowed to execute ALL with no password.
[*] alan is allowed to execute /bin/ls, /bin/kill on ALL as root, bin : operator, system.
@averagesecurityguy
averagesecurityguy / readme.md
Last active February 16, 2016 15:56
Strip TLDs from Large Domain List

You can use the above script with parallel to speed up the process. You need to do some prep work first.

  1. Split the large file into 100 smaller files: split -n 100 domains.txt domains_
  2. Make a list of the smaller files and save it: ls -l domains_* | awk '{ print $9 }' > dom_files.txt
  3. Run the script with parallel: parallel -a dom_files.txt -j 10 ./strip.py
  4. Cat all of the domain_*_strip.txt files together: cat *_strip.txt > domains_stripped.txt
@averagesecurityguy
averagesecurityguy / axfr.py
Created January 28, 2016 21:43
Simple Python script to do an AXFR against every name server in a domain.
#!/usr/bin/env python3
import sys
import dns.resolver
import dns.reversename
import dns.zone
import dns.exception
TIMEOUT = 15.0
@averagesecurityguy
averagesecurityguy / html_structure_hash.py
Created November 2, 2015 17:44
Calculate Hashes for HTML Structure
#!/usr/env/bin python3
import requests
import re
import hashlib
import sys
tag_re = re.compile(r'<.*?>')
if len(sys.argv) != 2:
@averagesecurityguy
averagesecurityguy / handshake.py
Last active October 19, 2015 03:37
Scapy WTF???
# The goal of this script is to complete a three-way handshake with a netcat listener on port 8888. Tcpdump
# shows the SYN packet being sent but I'm getting a RST/ACK instead of a SYN/ACK packet from netcat. I've
# configured Iptables to drop any RST packets where the source and destination are the same as the server's
# IP address, but the output from iptables -L -nv shows the rule is not being hit. Any ideas what is going on?
#
# I think I've decided that scapy is good for processing pcaps or gathering stats while sniffing traffic but
# for actually sending packets, it sucks. I know I can create the socket with Python and use the stream with
# Scapy but I really don't want to do that.
# Suppress Scapy IPv6 warning
@averagesecurityguy
averagesecurityguy / csrf.py
Created October 14, 2015 20:33
Burp Extension to Extract CSRF Token from Response and Insert it into Next Request
# I was testing a web app recently where each POST request updated the session cookie
# and generated a new CSRF token in a hidden input field in the body of the response.
# By default, Burp's Session handling rules will only use the cookie jar for Spider
# and Scanner. I modified the rules to use the cookie jar for Intruder and Repeater
# as well. In addition, Burp will only update the cookie jar from Proxy and Scanner
# so I had to allow Repeater, Spider, and Intruder to update the cookie jar as well.
# This allowed me to use a fresh cookie with each request as required by the app.
#
# To get a fresh CSRF token with each request I had to write an extension. The
# extension processes any responses that it receives from any tool except Proxy and
@averagesecurityguy
averagesecurityguy / send.py
Created October 7, 2015 03:45
Scapy Issue
from scapy.all import *
http = IP(dst="10.0.2.15)/TCP(dport=80)/"GET /index.html HTTP/1.0\r\n\r\n"
send(http)
sendp(http, iface="eth0")
@averagesecurityguy
averagesecurityguy / bust.sh
Last active August 29, 2015 14:22
Gobuster and Fuzzdb
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: bust.sh URL"
exit 1
fi
APPTEST_DIR="/Users/shaywood/apptest"
DISC="$APPTEST_DIR/fuzzdb/discovery/PredictableRes"
@averagesecurityguy
averagesecurityguy / gist:1fb34475ff0c89f937f4
Created March 10, 2015 16:00
SecurityCenter File Upload Example
#!/usr/bin/env python
import requests
import random
import json
import os
token = ''
cookie = ''
server = ''