Python Scapy Vlan Tagging Help

This is the place for queries that don't fit in any of the other categories.

Python Scapy Vlan Tagging Help

Postby joedirgy » Mon Jan 13, 2014 5:56 pm

Hello,

I am trying to learn python and scapy so I can mainly send out custom packets. These custom packets I am trying to create are specifically Dot1Q tagged packets or basically packets with vlan tags on them because I am trying to test my VoIP network by trying to vlan hop into this network using python and scapy. I have been trying my best to fallow tutorials but something is not quit right. I am not sure if it is an issue with my scripts and limited knowledge of scapy or if it is a problem with my network environment and wireshark.

Anyhow, currently I am trying to test this code:

Code: Select all
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import sr1,IP,ICMP,Ether,Dot1Q

#ACTUAL TEST CODE#
pkt=sr1(Ether()/Dot1Q(vlan=0x32)/IP(dst="10.0.64.1")/ICMP())


The code is very small now because I am simply just trying to send out a vlan tagged icmp message on my linux mint virtual machine. When I run the script I get:

Code: Select all
python scappytest.py
Begin emission:
...........Finished to send 1 packets.
...................................................................................................................^C
Received 1076 packets, got 0 answers, remaining 1 packets


I know enough about scapy and python to send out a normal ping but when I try to vlan tag I do not see any packets leaving the interface on wireshark nor do I see any indication from standard out. I even tried setting up a virtual interface using vconfig and bridging. Perhaps someone out there has some other ideas or suggestions?

Thanks,

Joe
joedirgy
 
Posts: 3
Joined: Tue Nov 19, 2013 3:59 am

Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot], morissio, wichita12 and 5 guests