|
scapy
2.2.0
About: scapy is a interactive network packet manipulation program to forge or decode packets of a wide number of protocols (using python as command board)
Fossies Dox: scapy-2.2.0.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
Classes | |
| class | debug |
| Debug class ##. More... | |
Functions | |
| def | sndrcv |
| Send / Receive ##. More... | |
| def | send |
| def | sendp |
| def | sendpfast |
| def | sr |
| def | sr1 |
| def | srp |
| def | srp1 |
| def | srloop |
| def | srploop |
| def | sndrcvflood |
| def | srflood |
| def | srpflood |
| def | sniff |
| def | tshark |
| def scapy.sendrecv.send | ( | x, | |
inter = 0, |
|||
loop = 0, |
|||
count = None, |
|||
verbose = None, |
|||
realtime = None, |
|||
| args, | |||
| kargs | |||
| ) |
Send packets at layer 3 send(packets, [inter=0], [loop=0], [verbose=conf.verb]) -> None
Definition at line 248 of file sendrecv.py.
| def scapy.sendrecv.sendp | ( | x, | |
inter = 0, |
|||
loop = 0, |
|||
iface = None, |
|||
iface_hint = None, |
|||
count = None, |
|||
verbose = None, |
|||
realtime = None, |
|||
| args, | |||
| kargs | |||
| ) |
Send packets at layer 2 sendp(packets, [inter=0], [loop=0], [verbose=conf.verb]) -> None
Definition at line 254 of file sendrecv.py.
Referenced by scapy.layers.dot11.airpwn(), scapy.layers.l2.arpcachepoison(), and scapy.layers.dot11.WiFi_am.send_reply().
| def scapy.sendrecv.sendpfast | ( | x, | |
pps = None, |
|||
mbps = None, |
|||
realtime = None, |
|||
loop = 0, |
|||
file_cache = False, |
|||
iface = None |
|||
| ) |
Send packets at layer 2 using tcpreplay for performance pps: packets per second mpbs: MBits per second realtime: use packet's timestamp, bending time with realtime value loop: number of times to process the packet list file_cache: cache packets in RAM instead of reading from disk at each iteration iface: output interface
Definition at line 262 of file sendrecv.py.
References scapy.utils.get_temp_file(), and scapy.utils.wrpcap().
| def scapy.sendrecv.sndrcv | ( | pks, | |
| pkt, | |||
timeout = None, |
|||
inter = 0, |
|||
verbose = None, |
|||
chainCC = 0, |
|||
retry = 0, |
|||
multi = 0 |
|||
| ) |
Send / Receive ##.
Definition at line 38 of file sendrecv.py.
References scapy.layers.inet6.type, and scapy.crypto.cert.warning().
Referenced by scapy.sendrecv.sr(), scapy.sendrecv.sr1(), and scapy.sendrecv.srp().
| def scapy.sendrecv.sndrcvflood | ( | pks, | |
| pkt, | |||
prn = lambda (s,r |
|||
| ) |
Definition at line 445 of file sendrecv.py.
Referenced by scapy.sendrecv.srflood(), and scapy.sendrecv.srpflood().
| def scapy.sendrecv.sniff | ( | count = 0, |
|
store = 1, |
|||
offline = None, |
|||
prn = None, |
|||
lfilter = None, |
|||
L2socket = None, |
|||
timeout = None, |
|||
opened_socket = None, |
|||
stop_filter = None, |
|||
| arg, | |||
| karg | |||
| ) |
Sniff packets
sniff([count=0,] [prn=None,] [store=1,] [offline=None,] [lfilter=None,] + L2ListenSocket args) -> list of packets
count: number of packets to capture. 0 means infinity
store: wether to store sniffed packets or discard them
prn: function to apply to each packet. If something is returned,
it is displayed. Ex:
ex: prn = lambda x: x.summary()
lfilter: python function applied to each packet to determine
if further action may be done
ex: lfilter = lambda x: x.haslayer(Padding)
offline: pcap file to read packets from, instead of sniffing them
timeout: stop sniffing after a given time (default: None)
L2socket: use the provided L2socket
opened_socket: provide an object ready to use .recv() on
stop_filter: python function applied to each packet to determine
if we have to stop the capture after this packet
ex: stop_filter = lambda x: x.haslayer(TCP)
Definition at line 533 of file sendrecv.py.
Referenced by scapy.sendrecv.srpflood(), and scapy.sendrecv.tshark().
| def scapy.sendrecv.sr | ( | x, | |
filter = None, |
|||
iface = None, |
|||
nofilter = 0, |
|||
| args, | |||
| kargs | |||
| ) |
Send and receive packets at layer 3
nofilter: put 1 to avoid use of bpf filters
retry: if positive, how many times to resend unanswered packets
if negative, how many times to retry when no more packets are answered
timeout: how much time to wait after the last packet has been sent
verbose: set verbosity level
multi: whether to accept multiple answers for the same stimulus
filter: provide a BPF filter
iface: listen answers only on the given interface
Definition at line 304 of file sendrecv.py.
References scapy.sendrecv.sndrcv().
Referenced by scapy.layers.isakmp.ikescan(), scapy.modules.nmap.nmap_sig(), scapy.modules.queso.queso_sig(), scapy.layers.inet.report_ports(), scapy.layers.inet.traceroute(), scapy.layers.inet.traceroute(), scapy.layers.inet6.traceroute6(), and scapy.layers.inet6.traceroute6().
| def scapy.sendrecv.sr1 | ( | x, | |
filter = None, |
|||
iface = None, |
|||
nofilter = 0, |
|||
| args, | |||
| kargs | |||
| ) |
Send packets at layer 3 and return only the first answer
nofilter: put 1 to avoid use of bpf filters
retry: if positive, how many times to resend unanswered packets
if negative, how many times to retry when no more packets are answered
timeout: how much time to wait after the last packet has been sent
verbose: set verbosity level
multi: whether to accept multiple answers for the same stimulus
filter: provide a BPF filter
iface: listen answers only on the given interface
Definition at line 322 of file sendrecv.py.
References scapy.sendrecv.sndrcv().
Referenced by scapy.layers.dns.dyndns_add(), scapy.layers.dns.dyndns_del(), scapy.layers.inet.fragleak2(), and scapy.layers.snmp.snmpwalk().
| def scapy.sendrecv.srflood | ( | x, | |
filter = None, |
|||
iface = None, |
|||
nofilter = None, |
|||
| args, | |||
| kargs | |||
| ) |
Flood and receive packets at layer 3 prn: function applied to packets received. Ret val is printed if not None store: if 1 (default), store answers and return them unique: only consider packets whose print nofilter: put 1 to avoid use of bpf filters filter: provide a BPF filter iface: listen answers only on the given interface
Definition at line 499 of file sendrecv.py.
References scapy.sendrecv.sndrcvflood().
| def scapy.sendrecv.srloop | ( | pkts, | |
| args, | |||
| kargs | |||
| ) |
Send a packet at layer 3 in loop and print the answer each time srloop(pkts, [prn], [inter], [count], ...) --> None
Definition at line 433 of file sendrecv.py.
| def scapy.sendrecv.srp | ( | x, | |
iface = None, |
|||
iface_hint = None, |
|||
filter = None, |
|||
nofilter = 0, |
|||
type = ETH_P_ALL, |
|||
| args, | |||
| kargs | |||
| ) |
Send and receive packets at layer 2
nofilter: put 1 to avoid use of bpf filters
retry: if positive, how many times to resend unanswered packets
if negative, how many times to retry when no more packets are answered
timeout: how much time to wait after the last packet has been sent
verbose: set verbosity level
multi: whether to accept multiple answers for the same stimulus
filter: provide a BPF filter
iface: work only on the given interface
Definition at line 343 of file sendrecv.py.
References scapy.sendrecv.sndrcv().
Referenced by scapy.layers.l2.arping(), scapy.layers.l2.promiscping(), and scapy.sendrecv.srp1().
| def scapy.sendrecv.srp1 | ( | args, | |
| kargs | |||
| ) |
Send and receive packets at layer 2 and return only the first answer
nofilter: put 1 to avoid use of bpf filters
retry: if positive, how many times to resend unanswered packets
if negative, how many times to retry when no more packets are answered
timeout: how much time to wait after the last packet has been sent
verbose: set verbosity level
multi: whether to accept multiple answers for the same stimulus
filter: provide a BPF filter
iface: work only on the given interface
Definition at line 363 of file sendrecv.py.
References scapy.sendrecv.srp().
Referenced by scapy.layers.dhcp.dhcp_request(), scapy.layers.l2.getmacbyip(), scapy.arch.windows.getmacbyip(), scapy.layers.l2.is_promisc(), and scapy.layers.inet6.neighsol().
| def scapy.sendrecv.srpflood | ( | x, | |
filter = None, |
|||
iface = None, |
|||
iface_hint = None, |
|||
nofilter = None, |
|||
| args, | |||
| kargs | |||
| ) |
Flood and receive packets at layer 2 prn: function applied to packets received. Ret val is printed if not None store: if 1 (default), store answers and return them unique: only consider packets whose print nofilter: put 1 to avoid use of bpf filters filter: provide a BPF filter iface: listen answers only on the given interface
Definition at line 513 of file sendrecv.py.
References scapy.sendrecv.sndrcvflood(), and scapy.sendrecv.sniff().
Referenced by scapy.layers.l2.etherleak().
| def scapy.sendrecv.srploop | ( | pkts, | |
| args, | |||
| kargs | |||
| ) |
Send a packet at layer 2 in loop and print the answer each time srloop(pkts, [prn], [inter], [count], ...) --> None
Definition at line 439 of file sendrecv.py.
| def scapy.sendrecv.tshark | ( | args, | |
| kargs | |||
| ) |
Sniff packets and print them calling pkt.show(), a bit like text wireshark
Definition at line 600 of file sendrecv.py.
References scapy.sendrecv.sniff().