Questions tagged [scapy]

Scapy is a network packet manipulation tool for use with Python.

What is Scapy?

Scapy is a network packet manipulation program for use with Python. It is able to:

  • forge or decode packets of a wide number of protocols
  • send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery. (it can replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tethereal, p0f, etc.)

What makes scapy different from most other networking tools?

  • You can build whatever packets you want, stack ARP on top of 802.11, use double 802.1q encapsulation or send an ICMP packet with padding, and send them over the wire.

  • Scapy does not interpret answers: unlike most tools, it won't say “this port is open” instead of “I received a SYN-ACK”. You are free to interpret the packets as you want

  • It reports everything: you see the padding, the reserved fields... Nothing is dismissed


Useful links:

2198 questions
0
votes
0 answers

Reading PCAP with Scapy without printing

I am reading a large pcap file using packets = sniff(offline=pcapPath, prn=customfunction, store=0, count=27242) I want to avoid printing each packet to the console. How do you do this?
nachofest
  • 23
  • 1
  • 2
  • 6
0
votes
1 answer

Increased Rount Trip Time using Scapy

I have created a network topology such as H1 <-> S1 <-> S2 <-> H2 in Mininet. Where H are Hosts and S are Switches. The network has been created as follows I have set the delay in the network as 1ms. When I run Ping between H1 and H2, I get result…
Nehal
  • 17
  • 4
0
votes
1 answer

Scapy can't install

Traceback (most recent call last): File "/home/predata/soft/Memcrashed-DDoS-Exploit/Memcrashed.py", line 5, in from scapy.all import * File "/usr/local/lib/python3.9/dist-packages/scapy/all.py", line 18, in from scapy.arch import…
Emmet
  • 1
  • 2
0
votes
0 answers

DNS Spoofing - spoofed packet doesn't work

I'm trying to perform DNS spoofing but seems it doesn't impact the victim, The packet is showing on Wireshark the way it needs to be but still, the victim gets to the correct IP and not the one I wants to (facebook.com) def dns_spoof(pkt): …
0
votes
1 answer

OverflowError: Python int too large to convert to C long - TCP Reset Attack code

I got the following code from here: https://gist.github.com/spinpx/263a2ed86f974a55d35cf6c3a2541dc2 I tried to perform the attack using 3 Ubuntu VMs (Ubuntu 16.04.2 LTS ). Here's my code: #!/usr/bin/python from scapy.all import…
Simon
  • 241
  • 2
  • 13
0
votes
1 answer

Craft an IP in IP example with scapy

I am trying to send an IP in IP packet with scapy but I seem to be missing or misunderstanding something. Here is my attempt: from scapy.all import * payload = "HelloWorld" inner = IP(dst="192.168.1.2") inner.add_payload(payload) outer =…
0
votes
1 answer

Why am I receiving the following error: "struct.error: required argument is not an integer"

Attempting to create a script to send beacon frames at 100ms intervals indefinitely. I've had luck with other scripts that include less Dot11Elt sublayers, but for some reason it doesn't like the same 'sendp' command in this script. ht_caps =…
rhax07
  • 11
  • 1
0
votes
1 answer

Sending packets with scapy ONLY on a wired connection, disconnects internet on my PC

When i use send or sendp functions to send packets while using a WIRED connection to my router, the internet in my pc keeps on cutting of for every packet send, but when i use a wifi adapter, it works totally fine, iam searching about this problem…
0
votes
1 answer

How to generate packets with incrementing lengths with scapy

I need to send a sequence of packets from min to max ethernet size to verify hardware. Would be best to use scapy since that's the tool of choice for existing tests. Is there a way to have scapy to send a sequence of packets of incrementing…
seacoder
  • 514
  • 5
  • 11
0
votes
1 answer

scapy sniffing ZigBee traffic, does not detect ZigBee layers

I'm trying to play with ZigBee protocol using scapy, but captured traffic is not properly recognized. I have created following script: import sys from scapy.sendrecv import sniff def pkt_hnd(pkt): …
omicronns
  • 357
  • 1
  • 10
0
votes
1 answer

AttributeError: 'L2bpfSocket' object has no attribute 'ins'

I am trying to build a Networkscanner that scans my localnetwork. Here is how I would do it: Create an ARP Request. Create an Ethernet Frame. Place the ARP Request inside the Ethernet Frame. Send the combined frame and receive responses. Then parse…
0
votes
2 answers

Reading 20 GB file Using Scapy

I have a Pcap file that is 20GB in size. I want to analyze it using Scapy. My laptop gets hang whenever I want to read it using Scapy. Is there anyway to read this file in chunks (few MBs at a time) and then save them in small pcaps files. (Please…
0
votes
2 answers

Sentence selection surrounded to a particular words

Suppose I have a paragraph: Str_wrds ="Power curve, supplied by turbine manufacturers, are extensively used in condition monitoring, energy estimation, and improving operational efficiency. However, there is substantial uncertainty linked to power…
Ravi
  • 151
  • 8
0
votes
1 answer

Parsing multiple DNS responses with Scapy

Trying to parse DNS responses with Scapy (see function below). My issue is all of the answers in the rdata[] field are not showing. When I do a packet capture with Wireshark, I see multiple answers in the rdata[] field, there are usually two or…
0
votes
1 answer

Scapy. Failed to compile filter expression. MacOS

I filter for Association Requests using Scapy's sniff: sniff(iface=INTERFACE, filter="type mgt subtype assoc-req", prn=assoc_req_parse, store=0) When I run this on my Macbook this error occurs: Traceback (most recent call last): File…
ttl256
  • 46
  • 4