scapy.ansmachine

Answering machines.

class scapy.ansmachine.AnsweringMachine(self)[源代码]

基类:Generic[_T]

bg(*args: Any, **kwargs: Any) AsyncSniffer[源代码]
filter: str | None = None
function_name = ''
is_request(req: Packet) int[源代码]
abstract make_reply(req: Packet) _T[源代码]
parse_all_options(mode: int, kargs: Any) Tuple[Dict[str, Any], Dict[str, Any]][源代码]
parse_options() None[源代码]
print_reply(req: Packet, reply: _T) None[源代码]
reply(pkt: Packet, send_function: Callable[[...], None] | None = None, address: Any | None = None) None[源代码]
run(*args: Any, **kargs: Any) None[源代码]
static send_function(x: List[Packet] | Packet | SetGen[Packet] | _PacketList[Packet], iface: NetworkInterface | str | None = None, **kargs: Any) PacketList | None[源代码]

Send packets at layer 3

参数:
  • x -- the packets

  • inter -- time (in s) between two packets (default 0)

  • loop -- send packet indefinitely (default 0)

  • count -- number of packets to send (default None=1)

  • verbose -- verbose mode (default None=conf.verb)

  • realtime -- check that a packet was sent before sending the next one

  • return_packets -- return the sent packets

  • socket -- the socket to use (default is conf.L3socket(kargs))

  • iface -- the interface to send the packets on

  • monitor -- (not on linux) send in monitor mode

返回:

None

send_options: Dict[str, Any] = {'verbose': 0}
send_options_list = ['iface', 'inter', 'loop', 'verbose', 'socket']
send_reply(reply: _T, send_function: Callable[[...], None] | None = None) None[源代码]
sniff() None[源代码]
sniff_bg() None[源代码]
sniff_options: Dict[str, Any] = {'store': 0}
sniff_options_list = ['store', 'iface', 'count', 'promisc', 'filter', 'type', 'prn', 'stop_filter', 'opened_socket']
class scapy.ansmachine.AnsweringMachineTCP(self, port=80, cls=<class 'scapy.packet.Raw'>)[源代码]

基类:AnsweringMachine[Packet]

An answering machine that use the classic socket.socket to answer multiple clients

close() None[源代码]
make_reply(req: Packet, address: Any | None = None) Packet[源代码]
parse_options(port: int = 80, cls: ~typing.Type[~scapy.packet.Packet] = <class 'scapy.packet.Raw'>) None[源代码]
sniff() None[源代码]
class scapy.ansmachine.ReferenceAM(name: str, bases: Tuple[type, ...], dct: Dict[str, Any])[源代码]

基类:type