/pwnlib-cpp

Minimal pwntools like library written in C++

Primary LanguageC++MIT LicenseMIT

Mini C++ Pwnlib

GitHub top language GitHub last commit GitHub issues

This is a small C++ library that implements some features from pwntools. It was mainly a hack I wrote to be used in an environment without python3 and pwntools.

Usage

exploit.cc:

#include "pwn.h"
#include <iostream>

using namespace pwn;

int main(int argc, char *argv[])
{
    // Debug mode
    // pwn::debug = true;
    auto win = 0x8048556;

    // We're all about precision exploits here
    auto payload = p32(win) * 50;

    auto io = Process("./vuln");
    // gdb::attach(io); // Must be used with tmux
    io.sendline(payload);
    std::cout << io.recvall() << std::endl;
    return 0;
}

Compile it with:

g++ exploit.cc pwn.cc -o exploit

pwn.cc and pwn.h should be in the same directory as exploit.cc.