Scapy - A Powerful Interactive Program
Scapy - A Powerful Interactive Program
manipulation program
Rohith Raj S Rohith R Minal Moharir
Computer Science and Engineering Computer Science and Engineering Computer Science and Engineering
Department Department Department
R.V College of Engineering R.V College of Engineering R.V College of Engineering
Bangalore, India Bangalore, India Bangalore, India
[email protected] [email protected] [email protected]
Shobha G
Computer Science and Engineering
Department
R.V College of Engineering
Bangalore, India
[email protected]
Abstract— This research paper looks into a state of the art A brief working of Scapy as interactive packet manipulation
tool for interactive packet manipulation named Scapy which is tool is as follows and the same is given in Fig. 1
written in Python language; detail out some vital commands, 1. Create packets by taking into account the data type,
strengths and weakness, protocols supported, usage explained source MAC address and destination MAC address.
with snapshots, tracking packets being sent and received using 2. Send the created packets to the destination by
wireshark and scope of future integration with newer protocols. specifying the parameters.
The research paper, tries to give a brief introduction and 3. Or sniff for packets by specifying the parameters.
readable usage and applications using the Scapy tool.
I. INTRODUCTION
Scapy is a Python program written to manipulate network
packets. It was developed by Philippe Biondi. Network
packets can be sent, sniffed, dissected and forged [1]. Scapy
can be used to construct or decrypt packets of a variety of
protocols, to send them, capture them, match requests and
replies, and a lot more. Many long-established tasks can be
handled by it such as tracerouting, scanning, unit testing,
probing, attacking and discovery of networks.
After opening a scapy session, the user can build and play
with packets as shown in Fig. 3
Fig. 8: handshake.py
First Couples (packet sent, answer) On executing the handshake.py file shown in Fig.8 from the
terminal the working of the three-way handshake can be
Second Unanswered packets captured in wireshark as shown in Fig. 10. Three way
handshake happens in client-server connections established
over a TCP/IP Network.
Adding a new protocol in Scapy is a simple task. The fields
do all the magic.
The layer class inherits the layer manipulation logic from the
Packet class. A list of fields will compound a simple layer.
This will be either concatenated while the layer is assembled
or, while disassembling a string it’s dissected layer by layer.
fields_desc attribute stores the list of fields. By instantiating
Fig. 10: Wireshark trace for three way handshake field class, fields are obtained.
REFERENCES