Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / example.js
Created June 9, 2016 23:19 — forked from oleavr/example.js
Interceptor context example
'use strict';
Module.enumerateExports('libssl.so', {
onMatch(e) {
if (e.type === 'function')
Interceptor.attach(e.address, createHook(e.name, e.address));
},
onComplete() {
}
});
import angr
import analysis
class MemoryWrite(analysis.Analysis):
def __init__(self, option):
super(MemoryWrite, self).__init__(option)
self.mem_write_check()
def mem_write_check(self):
print("[+] Initializing memory write analysis")
@Manouchehri
Manouchehri / Dalvik-x86-execution.txt
Created October 1, 2016 16:30 — forked from huberflores/Dalvik-x86-execution.txt
Wrapping java code to dalvik code, and executing it using Dalvik x86
/*
* author Huber Flores
*/
#Wrapping a java class into dex.
#Remember to add "dex" command to .bashrc file so that you can call the command from any place
#dex is an utility that comes with the Android SKD, and it's located in .../android-linux-x86_64/sdk/platform-tools/
#export PATH=$PATH:/home/ubuntu/android-sdk-linux/platform-tools:/home/ubuntu/CyanogenModBuild/environment/bin
@Manouchehri
Manouchehri / parse_pbzx2.py
Created June 3, 2016 01:01 — forked from pudquick/parse_pbzx2.py
A pbzx stream decoder for the format found within Yosemite package payloads.
# v2 pbzx stream handler
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5
#
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
import struct, sys
@Manouchehri
Manouchehri / align-git.py
Created October 5, 2016 17:29 — forked from simos/align-git.py
Align a tarball to a commit in a git repository
#!/usr/bin/env python
import os
import subprocess
# We want to reach back to a commit where the following file is identical in the tarball.
FILENAME="page_alloc.c"
# We created this file with: git log | grep '^commit' | awk '{ print $2}' > /tmp/commit-list.txt
commit_file = open("/tmp/commit-list.txt", "r")
from pwn import *
#Setup context
context(arch='i386', os='linux')
context.log_level = 'debug'
#Open connection to the process
#Remote
sock = remote(<host>, <port>)
from pwn import *
#Setup context
context(arch='i386', os='linux')
context.log_level = 'debug'
#Open connection to the process
#Remote
sock = remote(<host>, <port>)
@Manouchehri
Manouchehri / sitecrawler.js
Created October 16, 2016 03:18 — forked from Je55eah/sitecrawler.js
Website Crawler using PhantomJS
var targetAddress = 'http://www.autohotkey.com/board/';
var fileCount = 0;
phantom.onError = function(msg, trace) {
var msgStack = ['PHANTOM ERROR: ' + msg];
if (trace && trace.length) {
msgStack.push('TRACE:');
trace.forEach(function(t) {
msgStack.push(' -> ' + (t.file || t.sourceURL) + ': ' + t.line + (t.function ? ' (in function ' + t.function +')' : ''));
});
#!/usr/bin/python
import socket, ssl, select, time, re
from thread import start_new_thread
from struct import pack
TYPE_ENUM = 0
TYPE_STRING = 2
TYPE_BYTES = TYPE_STRING
def clean(s):
@Manouchehri
Manouchehri / cowroot.c
Created October 22, 2016 00:26 — forked from rverton/cowroot.c
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten