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 的用处更多的是体现在了 repeater 和 monitor 上,所以这里不必多做停留。

例如:

tcp_target = Target(SocketConnection(host='127.0.0.1', port=17971))
Parameters:
  • connection (itarget_connection.ITargetConnection) – 到目标系统的连接对象

  • monitors (List[Union[IMonitor, pedrpc.Client]]) – 当前 Target 对象的监视器列表。

  • monitor_alive – 当监视器处于活跃状态时会调用的一个函数列表。

  • repeater (repeater.Repeater) – 发送时所用的中继器,默认为 None。

  • procmon – 用于添加进程监视器的接口。(已弃用)

  • procmon_options – 同上。

close()[source]

Close connection to the target.

Returns:

None

monitors_alive()[source]

等待监视器启动(活跃)/与 RPC 服务器建立连接。 当某个 target 被添加到 session 中时,target 的每一次重启都会调用该方法。 在成功 probing 后,会调用一个回调函数,并将 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]

设置当前 Target 对象的 fuzz 数据记录器–用于发送和接收 fuzz 数据。

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.