This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <string.h> | |
void vuln(const char* content, int size) { | |
if (size < 12) | |
return; | |
if (content[0] == 'G' && content[1] == 'O' && content[2] == 'T' && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pwn import * | |
PATH = "./prison_heap_hard" | |
ENV = {"LD_PRELOAD":"./libc-2.27.so"} | |
REMOTE = False | |
OFFSET_LEAK = 0x3ED8C0 | |
OFFSET_SYSTEM = 0x000000000004f440 | |
OFFSET_FREEHOOK = 0x00000000003ed8e8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pwn import * | |
PATH = "./prison_heap" | |
ENV = {"LD_PRELOAD":"./libc-2.27.so"} | |
REMOTE = True | |
OFFSET_LEAK = 0x3EBCA0 | |
OFFSET_SYSTEM = 0x000000000004f440 | |
OFFSET_FREEHOOK = 0x00000000003ed8e8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Este otro ejemplo está hecho para el cliente de un juego basurilla que hice con unos amigos: | |
https://github.com/klesoft/Anime-Battle-Online | |
El objetivo es crear un aimbot. Para ello, hookeamos la función recvfrom y parseamos los paquetes, | |
de manera que podamos tener las posiciones de los jugadores en todo momento. También hookeamos | |
la función sendto para guardar el socket y el sockaddr, de manera que podamos pasarlos como argumentos | |
cuando más tarde llamemos nosotros a sendto para enviar un paquete que dispare a la posición | |
del jugador seleccionado. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ejemplo de uso de la librería detours para el hooking de funciones. | |
En este caso hookeamos la función sendto del módulo winsock de windows, que se encarga | |
de enviar un paquete en protocolo udp (es el que usa el target). | |
Para encontrar la función usaremos sigscanning, que nos permite buscar en memoria | |
un patrón de bytes generado por un plugin de OLLYDBG. | |
[EXPLICACIÓN DETOUR] | |
En esta imagen se ve muy bien: | |
http://www.malwaretech.com/wp-content/uploads/2015/01/CodeFlow.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python | |
# GDB dashboard - Modular visual interface for GDB in Python. | |
# | |
# https://github.com/cyrus-and/gdb-dashboard | |
import ast | |
import os | |
import re | |
import struct |