scapy.ansmachine
Answering machines.
- class scapy.ansmachine.AnsweringMachine(self)[source]
Bases:
Generic
[_T
]- bg(*args: Any, **kwargs: Any) AsyncSniffer [source]
- filter: str | None = None
- function_name = ''
- reply(pkt: Packet, send_function: Callable[[...], None] | None = None, address: Any | None = None) None [source]
- static send_function(x: Sequence[Packet] | Packet | SetGen[Packet] | _PacketList[Packet], iface: NetworkInterface | str | None = None, iface_hint: str | None = None, socket: SuperSocket | None = None, **kargs: Any) PacketList | None [source]
Send packets at layer 2
- Parameters:
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
- Returns:
None
- send_options: Dict[str, Any] = {'verbose': 0}
- send_options_list = ['iface', 'inter', 'loop', 'verbose', 'socket']
- 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'>)[source]
Bases:
AnsweringMachine
[Packet
]An answering machine that use the classic socket.socket to answer multiple TCP clients
- TYPE = 1
- class scapy.ansmachine.AnsweringMachineUDP(self, port=80, cls=<class 'scapy.packet.Raw'>)[source]
Bases:
AnsweringMachineTCP
An answering machine that use the classic socket.socket to answer multiple UDP clients
- TYPE = 2