Let's assume that there is a hypothetical java service you need to communicate with:
@RestController
@RequestMapping("/serve")
public class ServiceController implements ApplicationContextAware {| from argparse import ArgumentParser | |
| from binascii import hexlify, unhexlify | |
| from code import InteractiveConsole | |
| from cryptography.hazmat.primitives import hashes, hmac, padding | |
| from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes | |
| from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC | |
| from enum import Enum | |
| from os import urandom | |
| from sys import exit, stdin | |
| from textwrap import wrap |
When conducting exploit development with pwntools you will often want to utilize the pwnlib gdb feature which will ease the usage of gdb and gdb scripts. Let's look into a simple example.
Assume that you have the following code you are analyzing:
// Compile: gcc -o /tmp/example -no-pie -fno-stack-protector example.c && chmod +x /tmp/example