satella.debug package

Subpackages

Module contents

class satella.debug.TaintedObject(v)

Bases: Generic[T]

class satella.debug.TaintingEnvironment

Bases: object

A round of tainting. Taints will be invalidated at the end. Basically any Python opcode that relates to tainting will be tainted itself.

As an added extra, function values will be tainted as well if at least one of the parameters has been tainted

Use like this:

>>> with TaintingEnvironment() as env:
>>>     a = taint(a)
>>>     b = a + 5
>>>     ...

Warning

Using environment tainting will slow down your Python scripts since they install a per opcode handler.

Warning

Using functions that take at least one tainted argument is supposed to return a tainted result, but I couldn’t get that shipped in time at this involved some serious tweaking with the Python bytecode.

enabled
static get_session_in_progress()

Obtain current tainting session in progress

Raises:

RuntimeError – no tainting session started yet

Return type:

TaintingEnvironment

get_tainted_variables()

Return all, of the tainted variables

Return type:

Iterator[T]

old_python
satella.debug.access_tainted(v)

If v is tainted, this will extract it’s value.

If it is not, v will be returned

Parameters:

v (Union[T, TaintedObject[T]]) –

Return type:

T

satella.debug.taint(v)

Taints the object if necessary. If already tainted will leave it as is

Raises:

RuntimeError – no tainting session in progress

Parameters:

v (T) –

Return type:

TaintedObject[T]