Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstreaming vagd, pwntools virtualization #2434

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ The table below shows which release corresponds to each branch, and what date th
- [#2405][2405] Add "none" ssh authentication method
- [#2427][2427] Document behaviour of remote()'s sni argument as string.
- [#2382][2382] added optional port, gdb_args and gdbserver_args parameters to gdb.debug()
- [#2434][2434] upstreaming [vagd](https://github.com/gfelber/vagd) functionality #2434

[2360]: https://github.com/Gallopsled/pwntools/pull/2360
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
Expand All @@ -105,6 +106,7 @@ The table below shows which release corresponds to each branch, and what date th
[2405]: https://github.com/Gallopsled/pwntools/pull/2405
[2427]: https://github.com/Gallopsled/pwntools/pull/2405
[2382]: https://github.com/Gallopsled/pwntools/pull/2382
[2434]: https://github.com/Gallopsled/pwntools/pull/2434

## 4.13.0 (`beta`)

Expand Down
3 changes: 3 additions & 0 deletions docs/source/globals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ This is a quick list of most of the objects and routines imported, in rough orde
- ``ROP``
- :mod:`pwnlib.rop`
- Automatically generate ROP chains using a DSL to describe what you want to do, rather than raw addresses
- ``Virtualization``
- :mod:`pwnlib.virtualization`
- Automatically virtualize our exploit in different environments
- ``gdb.debug`` and ``gdb.attach``
- :mod:`pwnlib.gdb`
- Launch a binary under GDB and pop up a new terminal to interact with it. Automates setting breakpoints and makes iteration on exploits MUCH faster.
Expand Down
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Each of the ``pwntools`` modules is documented here.
update
useragents
util/*
virtualization
virtualization/*
windbg

.. toctree::
Expand Down
28 changes: 28 additions & 0 deletions docs/source/virtualization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. testsetup:: *

from pwn import *

:mod:`pwnlib.virtualization` --- Virtualizing your exploits
=============================================================

.. automodule:: pwnlib.tubes


Types of Virtualization
----------------------------

.. toctree::
:maxdepth: 3
:glob:

virtualization/*


:mod:`pwnlib.virtualization.pwnvirt` --- Base class
-----------------------------------------------------


.. automodule:: pwnlib.virtualization.pwnvirt

.. autoclass:: pwnlib.virtualization.pwnvirt.pwnvirt()
:members:
11 changes: 11 additions & 0 deletions docs/source/virtualization/sshvirt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. testsetup:: *

from pwn import *
context.arch = 'amd64'
context.terminal = [os.path.join(os.path.dirname(pwnlib.__file__), 'gdb_faketerminal.py')]

:mod:`pwnlib.virtualization.sshvirt` --- Working with Sshvirt
===============================================================

.. automodule:: pwnlib.virtualization.sshvirt
:members:
1 change: 1 addition & 0 deletions pwn/toplevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
from pwnlib.util.sh_string import sh_string, sh_prepare, sh_command_with
from pwnlib.util.splash import *
from pwnlib.util.web import *
from pwnlib.virtualization.sshvirt import sshvirt

# Promote these modules, so that "from pwn import *" will let you access them

Expand Down
3 changes: 3 additions & 0 deletions pwnlib/tubes/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ def __init__(self, user=None, host=None, port=22, password=None, key=None,
NOTE: The proxy_command and proxy_sock arguments is only available if a
fairly new version of paramiko is used.

Note: alternativly use :meth:`.virtulization.sshvirt`.


Example proxying:

.. doctest::
Expand Down
3 changes: 3 additions & 0 deletions pwnlib/virtualization/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from __future__ import absolute_import

__all__ = ['sshvirt']
Loading