class Tainter(object):
Entry point object for tainting data.
Taint
s can be created by using the simple_taint function. The last_taint method can be used to retrieve the started taint.
Please refer to the taint
package documentation for more information.
Examples
>>> trace = reven_server.trace >>> tainter = reven2.preview.taint.Tainter(trace)
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | last |
Get the last taint started by simple_taint |
Method | simple |
Request the server to start a taint such that its parameters are the arguments to this function. |
Method | taint |
Request the server to start a taint from the TaintState passed as parameter. |
Static Method | _handle |
Undocumented |
Instance Variable | _taint |
Undocumented |
Instance Variable | _trace |
Undocumented |
Request the server to start a taint such that its parameters are the arguments to this function.
As this function offers a simplified API, it starts the taint with a maximum of two different taint markers.
Warnings
Each successive call to this method will cancel and discard the previously started taint if any.
Taint parameters:
- Tainted data: passed by tag0 and tag1, tag0 tainted data s labeled by tag0, tag1 tainted data is labeled by tag1. Tainted data can be one of: string, Iterable,
reven2.arch.register.Register
,TaintedRegisterSlice
, integer (interpreted as a ds prefixed logical address),reven2.address.LogicalAddress
,reven2.address.LinearAddress
,reven2.address.LogicalAddressSegmentIndex
,reven2.address.PhysicalAddress
,TaintedMemories
orreven2.MemoryRange
. - Tainted range: Taint is propagated through all the Transitions between from_context and to_context
- Taint direction: Forward if is_forward else Backward
Examples
>>> trace = reven_server.trace() >>> tainter = reven2.preview.taint.Tainter(trace) >>> # taint in forward on the full trace, starting at the first context, >>> # "rax" with tag0, [ds:0xffffd001ea0d6040 ; 8] with tag1 >>> taint = tainter.simple_taint(tag0="rax", tag1="[ds:0xffffd001ea0d6040 ; 8]") >>> # The same taint, with the arguments expressed differently. >>> taint = tainter.simple_taint(tag0=reven2.arch.x64.rax, tag1=0xffffd001ea0d6040) >>> # # A slightly different taint, where tag0 tags both `rax` and the memory address, and where nothing it tagged with `tag1`. >>> taint = tainter.simple_taint(tag0=[reven2.arch.x64.rax, 0xffffd001ea0d6040])
Warning
A reven2.register_slice.RegisterSlice
will be converted to the containing byte if it is not aligned, except flags.
Information
Parameters | |
tag0:_Union[ | Initially tainted data marked with the tag0 taint marker. The accepted types for this parameter are the following:
|
tag1:_Optional[ | Initially tainted data marked with the tag1 taint marker. The accepted types for this parameter are the same as for tag0 |
from_Optional[ | reven2.trace.Context Context before the first transition in the requested taint range. |
to_Optional[ | reven2.trace.Context Context after the last transition in the requested taint range. |
isbool | bool, True for forward direction and False for backward direction. |
Returns | |
Taint | A Taint instance. |
Request the server to start a taint from the TaintState
passed as parameter.
A TaintState
can be obtained from the results of a previous taint.
Information
Parameters | |
state:TaintState | The state from we start the new taint. |
from_Optional[ | Context before the first transition in the requested taint range. If None, then computed to resume the taint from which the state was extracted. |
to_Optional[ | Context after the last transition in the requested taint range. Always greater than from_context. If None, then computed to resume the taint from which the state was extracted. |
is_Optional[ | True for forward direction and False for backward direction. If None, then the same direction as the taint from which the state was extracted. |
Returns | |
Taint | Undocumented |
def _handle_tag(tagname, tag):
Undocumented
Parameters | |
tagname:str | Undocumented |
tag:_Union[ | Undocumented |
Returns | |
_List[ | Undocumented |