Skip to main content

Yet another pwn sandbox in CTF!

Project description

PwnSandboxForCTF

Yet another sandbox for CTF challenge in AWD mode

This is a ptrace sandbox. (It was a chroot sandbox)

It will send SIG_KILL under certain circumstances:

  • Child process attempting to open files with 'flag' in its name by open/openat/name_to_handle_at. (/tmp/asdflagasd etc.)
  • Child process attempting to create a symlink or hardlink for file with 'flag' in its name by symlink/symlinkat/link.
  • Child process attempting to call illegal syscall. (execve/execveat/stub_execveat)

ELF64 and ELF32 supported, including PIE

Installation

pip install pwnsandbox

or

python setup.py install

It will install a console script 'pwn_sandbox'.

Usage

usage: pwn_sandbox [-h] input_bin

Yet another pwn sandbox for CTF by @unamer(https://github.com/unamer)

positional arguments:
  input_bin   /path/to/your/input binary

optional arguments:
  -h, --help  show this help message and exit

There will be a binary output named binary_sandbox in your binary's folder

Requirement

  • python 2.7
  • pwntools
  • lief Already included in project cause newest lief sucks.

Known issues

  • Centos NOT supported
  • Might crash on ELF contains multi loadable segments. (I haven't seen this type of ELF yet)
  • Sandbox might be bypassable, but it isn't designed as an impenetrable shield anyway. (issues are welcome.)
  • DO NOT use newest lief or you will be fucked when processing non-pie ELF32 file.

TODO

  • Find a clean method to jump back to oep
  • New method to support centos

Changelog

[0.3] - 2019-01-08

Added

  • Various bug fix.
  • Add more syscall in filter scope.

[0.2] - 2019-01-07

Added

  • Update project description.
  • Revert lief version.

[0.1] - 2019-01-05

Added

  • Reconstruct project.
  • Initial ptrace sandbox.

Project details


Download files

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

Source Distribution

pwnsandbox-0.31.tar.gz (1.8 MB view details)

Uploaded Source

File details

Details for the file pwnsandbox-0.31.tar.gz.

File metadata

  • Download URL: pwnsandbox-0.31.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15rc1

File hashes

Hashes for pwnsandbox-0.31.tar.gz
Algorithm Hash digest
SHA256 ec9fec1de095eaddf985e750dfc2502e9c65cf3d286767633f34e7580f78dbca
MD5 acb827c21289e272c5577176c68c2383
BLAKE2b-256 62d53717cf58b58030c9748f71a657a143a67e1e23203cb256e89936b2e1303b

See more details on using hashes here.

Supported by

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