Skip to content

Instantly share code, notes, and snippets.

@oaass
oaass / getenvaddr.c
Created March 28, 2016 00:01
Get address of environmental variable
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *ptr;
if(argc < 3) {
printf("Usage: %s <environment variable> <target program name>\n", argv[0]);
exit(0);
#!/usr/bin/env python
'''
Format string exploitation utility
by: Ole Aass (www.oleaass.com)
This script has one job, which is to overwrite one address with another
This script takes three inputs.
@oaass
oaass / filedec.py
Last active August 9, 2021 08:36
Helper script to try many different openssl cipher algorithms against a file
#!/usr/bin/env python
import subprocess
import argparse
import os
import sys
def yesno(message_type, default = 'y'):
if message_type == 'DELETE_FILES_IN_FOLDER':
question = 'The folder is not empty. Do you want to delete the files in it?'
@oaass
oaass / thpsetup.py
Last active April 12, 2023 00:54
This will install the additional tools to Kali recommended by "The Hacker Playbook". It will install the tools in /opt/tools
#!/bin/bash
echo ""
echo "=========================================================================="
echo "= Pentest Attack Machine Setup ="
echo "= Based on the setup from The Hacker Playbook ="
echo "=========================================================================="
echo ""
# Prepare tools folder
@oaass
oaass / brutezip.py
Created February 16, 2015 20:45
BruteZip - Zip archive password brute forcer
#!/usr/bin/env python
import zipfile
import argparse
import re
import os
from time import strftime
"""
Attempt to extract zip archive with password
"""
@oaass
oaass / pattern.py
Last active August 9, 2021 08:37
A small program to help making patterns to use in overflows, and also find the offset based on the value of EIP after overflowing
#!/usr/bin/python
#################### ####################
# #
# Written by Ole Aass (2015) #
# Inspired by Metasploit's pattern_(create|offset).rb #
# #
#################### ####################
import sys
@oaass
oaass / config-template.txt
Created May 18, 2014 00:56
Simple text template parser for making configs
<?php
define('DB_HOSTNAME', '{{hostname}}');
define('DB_USERNAME', '{{username}}');
define('DB_PASSWORD', '{{password}}');
define('DB_DATABASE', '{{database}}');
@oaass
oaass / dbce.py
Created November 23, 2013 23:36
Extract
#!/usr/bin/python
import sys, urllib3, getopt, re, time
start = time.time()
opts, args = getopt.getopt(sys.argv[1:], "t:T:C:f:p:o:q", ["target=","table=","columns=","format=","prepend=","output=","quiet"])
format = "single"
prepend = ''
outfile = ''
quiet = False
@oaass
oaass / gist:4577325
Last active December 11, 2015 08:59
<?php
$required = array('hostname', 'username', 'password', 'database', 'driver');
$config = array(
'password' => 'pass',
'database' => 'mydb',
'charset' => 'utf8',
'port' => '1234'
);
$errors = array_diff($required, array_flip($config));
<?php
class DatabaseException extends Exception
{
public function missingDriver()
{
print 'No such driver was found';
}
public function missingInterface($class, $interface)