Target

class boofuzz.Target(connection, monitors=None, monitor_alive=None, max_recv_bytes=10000, repeater=None, procmon=None, procmon_options=None, **kwargs)[source]

Bases: object

Target descriptor container.

Takes an ITargetConnection and wraps send/recv with appropriate FuzzDataLogger calls.

Encapsulates pedrpc connection logic.

Contains a logger which is configured by Session.add_target().

Example

tcp_target = Target(SocketConnection(host=’127.0.0.1’, port=17971))

Parameters:
  • connection (itarget_connection.ITargetConnection) – Connection to system under test.

  • monitors (List[Union[IMonitor, pedrpc.Client]]) – List of Monitors for this Target.

  • monitor_alive – List of Functions that are called when a Monitor is alive. It is passed the monitor instance that became alive. Use it to e.g. set options on restart.

  • repeater (repeater.Repeater) – Repeater to use for sending. Default None.

  • procmon – Deprecated interface for adding a process monitor.

  • procmon_options – Deprecated interface for adding a process monitor.

Changed in version 0.4.2: This class has been moved into the sessions subpackage. The full path is now boofuzz.sessions.target.Target.

close()[source]

Close connection to the target.

Returns:

None

monitors_alive()[source]

Wait for the monitors to become alive / establish connection to the RPC server. This method is called on every restart of the target and when it’s added to a session. After successful probing, a callback is called, passing the monitor.

Returns:

None

property netmon_options
open()[source]

Opens connection to the target. Make sure to call close!

Returns:

None

pedrpc_connect()[source]
property procmon_options
recv(max_bytes=None)[source]

Receive up to max_bytes data from the target.

Parameters:

max_bytes (int) – Maximum number of bytes to receive.

Returns:

Received data.

send(data)[source]

Send data to the target. Only valid after calling open!

Parameters:

data – Data to send.

Returns:

None

set_fuzz_data_logger(fuzz_data_logger)[source]

Set this object’s fuzz data logger – for sent and received fuzz data.

Parameters:

fuzz_data_logger (ifuzz_logger.IFuzzLogger) – New logger.

Returns:

None

Repeater

class boofuzz.repeater.Repeater(sleep_time)[source]

Bases: object

Base Repeater class.

Parameters:

sleep_time (float) – Time to sleep between repetitions.

abstract log_message()[source]

Formats a message to output in a log file. It should contain info about your repetition.

abstract repeat()[source]

Decides whether the operation should repeat.

Returns:

True if the operation should repeat, False otherwise.

Return type:

Bool

abstract reset()[source]

Resets the internal state of the repeater.

abstract start()[source]

Starts the repeater.

The following concrete implementations of this interface are available:

TimeRepeater

class boofuzz.repeater.TimeRepeater(duration, sleep_time=0)[source]

Bases: Repeater

Time-based repeater class. Starts a timer, and repeats until duration seconds have passed.

Raises:

ValueError – Raised if a time <= 0 is specified.

Parameters:
  • duration (float) – The duration of the repitition.

  • sleep_time (float) – Time to sleep between repetitions.

log_message()[source]

Formats a message to output in a log file. It should contain info about your repetition.

repeat()[source]

Decides whether the operation should repeat.

Returns:

True if the operation should repeat, False otherwise.

Return type:

Bool

reset()[source]

Resets the timer.

start()[source]

Starts the timer.

CountRepeater

class boofuzz.repeater.CountRepeater(count, sleep_time=0)[source]

Bases: Repeater

Count-Based repeater class. Repeats a fixed number of times.

Raises:

ValueError – Raised if a count < 1 is specified.

Parameters:
  • count (int) – Total amount of packets to be sent. Important: Do not confuse this parameter with the amount of repetitions. Specifying 1 would send exactly one packet.

  • sleep_time (float) – Time to sleep between repetitions.

log_message()[source]

Formats a message to output in a log file. It should contain info about your repetition.

repeat()[source]

Decides whether the operation should repeat.

Returns:

True if the operation should repeat, False otherwise.

Return type:

Bool

reset()[source]

Resets the internal state of the repeater.

start()[source]

Starts the repeater.