Skip to content

Instantly share code, notes, and snippets.

View 0xTowel's full-sized avatar

0xTowel

View GitHub Profile
@0xTowel
0xTowel / naslr.c
Last active November 14, 2017 20:39
Naslr - A POC to start a bash shell with no ASLR via SYS_personality.
/* Naslr: Starts a bash shell with no ASLR
* Build: gcc naslr.c -o naslr
*
* Towel - 2017
*/
#include <sys/personality.h>
#include <syscall.h>
#include <unistd.h>
#include <stdlib.h>
#include <err.h>
@0xTowel
0xTowel / SeeSP.c
Created November 13, 2017 20:48
Simple program that prints the stack pointer. Useful for manual ASLR checking.
/* SeeSP: Print the value of the stack pointer.
* Build: gcc SeeSP.c -o SeeSP
*
* Towel - 2017
*/
#include <stdio.h>
#include <inttypes.h>
int main(void)
{
@0xTowel
0xTowel / bsgs.py
Last active August 1, 2023 16:49
Simple Baby-Step-Giant-Step implementation in Python3 for finding discrete logs with a prime modulus
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Towel 2017
from math import ceil, sqrt
def bsgs(g, h, p):
'''
Solve for x in h = g^x mod p given a prime p.