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 / shellcode_wrapper_linux.c
Last active August 29, 2015 13:57
Moved from private to public
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
@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 / 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 / screenshot_browser.py
Last active December 27, 2015 01:28
Headless browser screenshoter
#!/usr/bin/env python2
import os
import sys
import time
import subprocess
try:
from pyvirtualdisplay import Display
except ImportError:
@hugsy
hugsy / jdwp-shellifier.py
Created December 9, 2013 07:54
Standalone script to universally execute command on an open JDWP service
##############################################################
#
# Universal JDWP shellifier
#
# References
# * http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/jdwp-spec.html
# * http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html
#
# Note: this script DOES NOT read output from command executed on backend. You should
# only use it to create a reverse shell
@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
#include <stdio.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <string.h>
#define MSG "ptrace protected"
int main(int argc, char** argv, char** envp)
@hugsy
hugsy / gist:32e4fdf200dd471defc9e32dda4891e7
Last active September 14, 2016 13:53
CTF(x) 2016 dat-boinary
#!/usr/bin/python2
# [+] Opening connection to 172.28.128.3 on port 1338: Done
# [*] Smash null byte
# [*] Reading from memory
# [*] Leaked puts@glibc at 0xb7665650
# [*] system@glibc is at 0xb7640190
# [*] Overwriting puts@got with system@glibc
# [*] Triggering
# [*] Switching to interactive mode