Pipes are not a well known Scapy feature. They can be used to chain actions such as sniffing, modifying and printing packets.
This trophy provides simple examples that builds on a silly one that does nothing.
- edit the
pipe_trophy.py
template - add a
ConsoleSink()
namedcs
- redirect
clfs
tocs
(with the>
operator) - launch the script
- remove the
clfs
to cs redirection - add a
TransformDrain()
namedtd
that usestransform_f()
- add a
InjectSink()
namedijs
- redirect
clfs
totd
, andtd
toijs
- test it:
- sniff the network
- launch the script
- add a
WrpcapSink()
namedws
- redirect
td
tows
- sniff the network and check for a newly created PCAP file
- launch the script
- in Scapy sources, the files
pipetool.py
andscapypipes.py
give you all you need to know about pipes related objects - a Sink is the last element of a pipe, a Drain 'manipulates' data and forwards it