Skip to content

Instantly share code, notes, and snippets.

@friedbutter
friedbutter / gist:593e4bf1c88ee2612c99
Created November 20, 2015 01:35 — forked from jjo-sec/gist:0ead6f9a9f91e420f7c8
PE icon extraction using pefile
"""
extracts the first 18 bytes of the icon header from RT_GROUP_ICON data,
appends with a dword value 22 to signify the offset
and then appends the raw icon data from RT_ICON
"""
def extract_icon(pe):
"""
pe is a pefile object
"""
rt_string_idx = [entry.id for entry in pe.DIRECTORY_ENTRY_RESOURCE.entries].index(pefile.RESOURCE_TYPE['RT_GROUP_ICON'])
@friedbutter
friedbutter / gist:0b03932fad8e5ce39773
Created October 7, 2015 20:42 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
#
# Modified slightly by Andreas Thienemann <athienemann@schubergphilis.com> for clearer exploit code
# and 64k reads
#
# This version of the exploit does write received data to a file called "dump" in the local directory
# for analysis.
@friedbutter
friedbutter / libdnet_python.rb
Created March 20, 2014 05:19 — forked from benhagen/libdnet_python.rb
For installing scapy on mac osx
require 'formula'
class LibdnetPython <Formula
depends_on 'libdnet'
url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz'
homepage 'http://code.google.com/p/libdnet/'
sha1 '71302be302e84fc19b559e811951b5d600d976f8'
def install
ENV["CFLAGS"] = "-O3 -w -pipe"