Host Abstraction Layer: Tubes

Updated Jan 12, 2017

Similar to the "Filesystem" abstraction layer, we should also extend the available operations to reflect basic tube instantiation.

For example, let's say that I have a process-like object (which may be local, remote via SSH, or via ADB).

I ma want to spawn another process on the same host (e.g. gdbserver to attach to it), or listen on a port, or create a connection.

Currently, this is difficult and has some special-case code -- an abstraction layer would make things nice and neat.

A lot of the code is littered with conditional checks against types of objects, to see if they are e.g. a local process, SSH process, or Android process.

This code would be greatly simplified if there were an abstraction layer that provided basic file I/O. Since the bounding set on functionality is what is provided by Paramiko's SFTP object, we should just implement that interface.

For things which resemble processes, we can add a property e.g. hal or filesystem which is an object which exposes this functionality. An example use-case is fetching a core file, one could just process.filesystem.open('core').read().

Python3 Support

Updated Jan 3, 2017

Pwntools should support Python3. There is a pwntools-python3 project, and I have a futurized branch that works for most things, except the term module.

In particular, I'd prefer to avoid calling .encode and .decode everywhere, and avoid version-specific logic wherever possible.

In order to achieve this, it seems best to convert the internal usage of ASCII/Latin-1 strings (Python2 str) into bytearray objects. The bytearray type is unique in that it is native to both Python2 and Python3, and avoids all internal issues with encoding/decoding.

No results.