Skip to main content

pwntools with vagrant integration

Project description

VAGD

Vagrant integration in pwntools

Installation

pip install vagd

or

pip install .
pip install -r requirements.txt

Usage

use template.py and copy it to exploit.py fill out the constants

# run as process in VM
./exploit.py
# run as gdb server in VM requires tmux
./exploit.py GDB
# run on remote IP:PORT
./exploit.py REMOTE

I recommend using pwndbg.

Features

Vagd

Constructor for Vagd, initializes a new vagrant machine (if non existent)

Parameters:

required experimental name type description
X binary str binary to debug on vagrant vm
vagrantfile str location of Vagrantfile
vbox str vagrant box to use
files str | tuple other files to upload to vm, all files are uploaded to current working directory (home or tmp)
tmp bool if the created directory in the vm should be temporary, requires new upload after each execution
X fast bool fast debug, mounts library files locally with sshfs in newly created directory ./sysroot/lib/ for faster symbol reading
x ex bool enables experimental features for the whole object

Vagd.system

executes command on vm, interface to pwnlib.tubes.ssh.ssh.system

Parameters:

required name type description
x cmd str command to execute on vm

Return: pwnlib.tubes.ssh.ssh.system

Vagd.debug Experimental

Executes the provided binary with gdbserver on the vm and and attaches gdb.

Parameters:

required experimental name type description
argv list[str] command line arguments for binary
exe str exe to execute
env Dict[str, str] Environment variables to pass through to binary
ssh Any ignored
gdbscript str gdbscript to execute after gdb sessions hast attached to server
X api bool if a gdb python api interface should be created, is set as attribute gdb in return object
X sysroot str the sysroot to use for gdb. Not applicable if fast is set in Vagd constructor
X gdb_args list[str] additonal gdb command line arguments to add to gdb
**kwargs Any allows the usage of other pwntool arguments

Return: pwn.process

Vagd.process

Executes the provided binary as process on vm

required name type description
argv list[str] command line arguments for binary
**kwargs Any allows the usage of other pwntool arguments

Return: pwn.process

Vagd.pwn_debug

Executes the provided binary with gdbserver on the vm and and attaches gdb.

required name type description
argv list[str] command line arguments for binary
**kwargs Any allows the usage of other pwntool arguments

Return: pwn.process

Vagd.start

uses pwn.args to swap between Vagd.process, Vagd.pwn_debug and Vagd.debug if experimental is enabled (in constructor or via ex=True)

Parameters:

required experimental name type description
argv list[str] command line arguments for binary
gdbscript str gdbscript to execute after gdb sessions hast attached to server
X api bool if a gdb python api interface should be created, is set as attribute gdb in return object
X sysroot str the sysroot to use for gdb. Not applicable if fast is set in Vagd constructor
X gdb_args list[str] additonal gdb command line arguments to add to gdb
X ex bool enables experimental features if not already enabled in constructor
**kwargs Any allows the usage of other pwntool arguments

Return: pwn.process

Boxes

the following boxes were tested and work, box constants are inside Vagd.box

  • ubuntu/jammy64
  • ubuntu/focal64
  • ubuntu/bionic64
  • ubuntu/xenial64

currently Vagrantfile generation is only compatible distributions that use apt

Project details


Release history Release notifications | RSS feed

This version

0.1.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vagd-0.1.2.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

vagd-0.1.2-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file vagd-0.1.2.tar.gz.

File metadata

  • Download URL: vagd-0.1.2.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for vagd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 131fd418a2106d764e0878465f31955a08df3f2588c23a82fe037c6c0ed7aecd
MD5 e9089f0ed33dd6713de0a6d4cfca0052
BLAKE2b-256 14d557e441c00bec044463544078e9ac035790aa522c13fd1b331a818d527142

See more details on using hashes here.

File details

Details for the file vagd-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vagd-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for vagd-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b78aa879649b901332fdc3aa41c9a7d8af325fd415b6c000862b0425130b66db
MD5 74d028ef3c39de33d0846ce2dc02a4d3
BLAKE2b-256 cc4a2eb3b258e68327abe2523531265a2077b3db6d0828eb41220bb42320815a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page