Skip to content

Instantly share code, notes, and snippets.

View mgeeky's full-sized avatar
💭
Wanna sip a sencha?

Mariusz Banach mgeeky

💭
Wanna sip a sencha?
  • Binary-Offensive.com
  • Poland
  • X @mariuszbit
View GitHub Profile
@mgeeky
mgeeky / encrypt.rb
Created March 22, 2016 17:51
Simple File Encryption utility (with support for Blowfish, GOST, IDEA, AES) capable of encrypting directories.
#!/usr/bin/ruby
#
# Script that performs encryption and decryption of files and directories.
# In latter case producing encrypted ZIP package that will get decompressed automatically
# after decryption.
#
# Mariusz B., 2016 v0.1
#
require 'optparse'
@mgeeky
mgeeky / CharFreqs.py
Created March 22, 2016 17:53
Characters frequency counting utility, handy when it boils down to Al-Kindi cryptanalysis.
# Prints out characters occurences frequency
# This can be used in Al-Kindi related cryptographic
# analysis
from sys import argv
import operator
text = ""
occurs = {}
freqs = {}
@mgeeky
mgeeky / PhrackPhiles.py
Created March 22, 2016 17:54
Phrack e-zines renaming utility. When having phrack philes downloaded, it will crawl through the phrack.org, collect articles captions and apply them to files.
#!/usr/bin/python
# This script traverses on PHRACK e-zines directory
# and for each downloads corresponding contents. This
# is used to name every file (phile) in issue directory
# with a name as title from webpage contents.
#
# MGeeky, 2012
import os
@mgeeky
mgeeky / RFCGatherer.py
Created March 22, 2016 17:55
RFC files gathering and renaming utility.
#!/usr/bin/python
import httplib
from sys import exit
from string import strip, replace
import os
from os.path import normpath
import re
@mgeeky
mgeeky / vigenere.py
Created March 22, 2016 17:56
Very old script of mine implementing Vigenere's cipher encrypt/decrypt.
#!/usr/bin/python
#
# Simple encoder/decoder of Vigenere cipher
#
#-----------------------------------------
from string import *
g_Tabula = []
@mgeeky
mgeeky / encshell.py
Created March 22, 2016 17:58
x86 Shellcode XOR-based encoder intended to do away forbidden chars. Came handy to me several times :-)
#!/usr/bin/python
# This script reads binary file specified in first
# parameter and then encodes every byte by simply
# XORing it with custom value (specified in second param)
# and writes output to another file.
# If second parameter wasn't specified (i.e XOR argument)
# then 0xAA is taken by default. In addition it prepends shellcode
# with simple decoding routine and appends decode-end marker
# if needed.
@mgeeky
mgeeky / list_import_modules.py
Created March 22, 2016 17:59
Lists imported modules from all of the PE EXE/DLL files along the specified path. Helpful when looking for DLL Search-Order Hijacking weak points.
import sys
import os
import pefile
rootPath = sys.argv[1]
modules = set()
def scanFile(f):
try:
@mgeeky
mgeeky / nested_dirs.py
Created March 22, 2016 18:01
Creates nested directories structure. May come handy in testing utilities recursive path-traversing algorithms, their recursion limits as well as during preparation of Zip Bombs.
#!/usr/bin/python
import os, sys
g_ABC = 0
def recurrent_mkdir( path, lvl, dirs ):
if lvl == 0:
return
@mgeeky
mgeeky / shellc2bin.py
Created March 22, 2016 18:01
Shellcode 2 binary script that reads C-formatted array from clipboard and converts it to binary output written to desired file.
#!/usr/bin/python
# This script converts shellcode's C-char array with hex
# values to ASCII-HEX binary file with shellcode inserted in it.
# ASCII-HEX values can be read either from file (if specified
# in first param) or from Win32 clipboard (if on win32 platform)
import sys
import random
import struct
@mgeeky
mgeeky / simple_infector.c
Last active March 22, 2016 18:08
Poorly coded, but doing it's job - simple PE infection utility, leveraging append-section technique. (one of those codes when my code style fu was not the way it meant to be, apologize for that)
#include <windows.h>
#include <cstdio>
///////////////////////////////////////////////
IMAGE_DOS_HEADER *g_iDosHdr;
IMAGE_FILE_HEADER *g_iFileHdr;
IMAGE_OPTIONAL_HEADER *g_iOptionalHdr;
IMAGE_SECTION_HEADER g_iNewSectHdr,