satella.debug.tainting package

Submodules

satella.debug.tainting.environment module

class satella.debug.tainting.environment.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.tainting.tainteds module

class satella.debug.tainting.tainteds.TaintedObject(v)

Bases: Generic[T]

satella.debug.tainting.tainteds.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.tainting.tainteds.might_accept_tainted(taint_result=False)

For methods that might accept a tainted value during execution

This both unpacks your first argument if is was a TaintedObject, you’ll receive it’s value :param taint_result: result will be tainted

Parameters:

taint_result (bool) –

satella.debug.tainting.tainteds.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]

Module contents

class satella.debug.tainting.TaintedObject(v)

Bases: Generic[T]

class satella.debug.tainting.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.tainting.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.tainting.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]