scapy

Python - Library Problems

I'm relatively new to Python and am having problems programming with Scapy, the Python network manipulation tool. However, I can't tell if it's as much a Scapy problem as it is a being-a-Python-newbie problem. On the scapy site, they give a sample program which I'm not able to run on my own machine: #! /usr/bin/env python import sys fr...

python-scapy: how to translate port numbers to service names?

A TCP layer in Scapy contains source port: >>> a[TCP].sport 80 Is there a simple way to convert port number to service name? I've seen Scapy has TCP_SERVICES and UDP_SERVICES to translate port number, but print TCP_SERVICES[80] # fails print TCP_SERVICES['80'] # fails print TCP_SERVICES.__getitem__(80) # fails print TCP_SERVICES['ww...

python/scapy mac flooding script

hi, I'm trying to make a small mac flood tool in python to fill my switches cam tables but i cant make the magic happen? can you see what im doing wrong? from scapy.all import * while 1: dest_mac = RandMAC() src_mac = RandMAC() sendp(Ether(src=src_mac, dst=dest_mac)/ARP(op=2, psrc="0.0.0.0", hwsrc=src_mac, hwdst=dest_mac)/Padding...

C/Python Socket Performance?

Hi, my question simply relates to the difference in performance between a socket in C and in Python. Since my Python build is CPython, I assume it's similar, but I'm curious if someone actually has "real" benchmarks, or at least an opinion that's evidence based. My logics is as such: C socket much faster? then write a C extension. n...

Python + Komodo Edit

Hello all, I am trying to get scapy to auto complete in komodo edit with no success, has anyone successfully done this? Thanks, Python New Comer ...

How can I filter a pcap file by specific protocol using python?

Hello I have some pcap files and I want to filter by protocol, i.e., if I want to filter by HTTP protocol, anything but HTTP packets will remain in the pcap file. There is a tool called openDPI, and it's perfect for what I need, but there is no wrapper for python language. Does anyone knows any python modules that can do what I need...

Scapy install issues. Nothing seems to actually be installed?

I have an apple computer running Leopard with python 2.6. I downloaded the latest version of scapy and ran "python setup.py install". All went according to plan. Now, when I try to run it in interactive mode by just typing "scapy", it throws a bunch of errors. What gives! Just in case, here is the FULL error message.. INFO: Can't i...

How can I edit a js file sent by the server before it gets to my browser?

During a normal browsing session I want to edit a specific javascript file before the browser receives since once it gets there it's impossible to edit. Is there are any tool for this? For what I need it I can't just save it and edit it on my disk. I'm ready to learn how to program it myself but if anyone can point out more or less what...

i need powerful interactive packet manipulation program like scapy

i need powerful interactive packet manipulation program like Scapy for Ruby please help ...

Scapy SYN send on our own IP address

Hello, I tried to send SYN packets on my local network and monitoring them with Wireshark and everything works just fine, except when i try to send a packet to my own ip address it "seems" to work because it says Sent 1 packet, but it is not really sent, i can't see the packet in Wireshark nor any answers to the packet. My setup is a co...

Importing python modules in jython

I'm having some issues importing scapy under jython. I've been doing java forever, but python for only a day or two. The simple case to reproduce the problem is: $jython >>> import sys >>> sys.path ['', '/usr/share/jython/Lib', '/usr/lib/site-python', '__classpath__'] >>> from scapy.all import * Traceback (innermost last): File "<cons...

Python: output of scapy cannot be stored in a text file?

When runnning scapy from command prompt (windows XP), the output cannot be stored. When the following command is executed in command prompt: scapy >C:\dir.txt The following error shows up: C:\automation\atg\GeneralFiles_AC\ScapyExe>scapy >C:\dir.txt INFO: Can't import python gnuplot wrapper . Won't be able to plot. INFO: Can't import P...