473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

scapy: applying an ipv6 route

Ciary
247 Recognized Expert New Member
Hi,

I have a problem with scapy (obviously)
for those who do not know, scapy is a network tool that allows you to manually craft a packet and send it, or even replay and modify a packet capture file.
i want to do the first. i simply want to send an ipv6 icmp echo request and print the reply.

here is the code to do that:
Expand|Select|Wrap|Line Numbers
  1. import logging
  2. import sys
  3. from scapy.all import *
  4. conf.iface='eth1'
  5. conf.route6.add(dst="50::1",gw="50::2")
  6. print conf.route6
  7. i=IPv6()
  8. i.display()
  9. i.dst="50::1"
  10. i.src="50::2"
  11. i.display()
  12. q=ICMPv6EchoRequest()
  13. q.display()
  14. p=(i/q)
  15. reply=sr1(p)
  16. reply.show()
  17.  
i'll tell you what went wrong, and what i did.
so first i got a warning:
- WARNING: No route found for IPv6 destination 50::1 (no default route?)
this was before I added the route in scapy. but it told me the packet was send anyway and it was waiting for an answer. then I did a packet-sniff to see why i got no answer. I checked all my available interfaces and found out that the packet was not send.
so after a while i found out that the routing table that scapy uses thinks that 50::2 is a loopback address instead of being applied on an interface. however, the routing table of linux clearly says it's configured on eth1. also, a "ping6 50::1" works fine. i tried adding a static route to 50::1 but this didn't seem to work. i also tried
Expand|Select|Wrap|Line Numbers
  1. conf.route6.add(dst="50::1",gw="50::2",dev="eth1")
but without much success. it gave an error:
- TypeError: construct_sourc e_candidate_set () takes exactly 4 arguments (3 given)

does anyone know what i'm doing wrong? or does anyone know how i can get this working? it would be a huge help.
Aug 22 '12 #1
4 7790
sicarie
4,677 Recognized Expert Moderator Specialist
I haven't had the opportunity to work extensively with IPv6 so I probably won't e able to help much there, but one thing that always gets me is the SELinux and iptables "deny by default" policies. Are ip6tables or SELinux set to allow this?
Aug 27 '12 #2
Ciary
247 Recognized Expert New Member
if it were a problem a normal 'ping6' wouldn't have worked either. and that works fine.
Aug 27 '12 #3
sicarie
4,677 Recognized Expert Moderator Specialist
Ah, right, sorry - read right over that part. I'll do some research and see if I can find anything
Aug 27 '12 #4
Ciary
247 Recognized Expert New Member
there is a workaround. you can manually add a mac source and destination. if you do this you force the packet to be send out on the right interface. that does the trick for me because i know the mac addresses and the host and destination are directly connected.

however, i'm still curious what happened and why it won't work without this. as i sid before, i think it's a problem with ipv6 routes. for some reason it recognizes my eth1 ipv6 address as a loopback address instead of one applied to an interface. i wonder why ...
Aug 29 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1787
by: Agent | last post by:
I would like to invite you and your associates to attend the US IPv6 (Internet Protocol version 6) Summit, December 8-11, 2003 in Crystal City, VA, near the Pentagon. This major opportunity to participate in transitioning to the new Internet is in response to both DoD and Industry requests for a concentrated, affordable conference in the Washington, D.C. area. This exciting and informative conference on the Next Generation Internet will...
7
5925
by: Torsten Schmidt | last post by:
Hi, I'm trying to connect to a mysql-Server using PHP's mysql-function mysql_connect. The host on which the mysql-server is running is not the same as the host apache and php are running on. The two computers are connected in an IPv6-network. No matter if I give the hostname (defined in /etc/hosts), the IPv6-address ("fec0::4") or the IPv6-address in square brackets ("") the function mysql_connect always prints "Unknown MYSQL-Server "....
0
1317
by: codecraig | last post by:
I am interested in using libdnet with Python, how can I go about "installing" it on windows? http://libdnet.sourceforge.net/ Ultimately, I would like to get Scapy (http://www.secdev.org/projects/scapy/) running on windows...currently it is a *nix app written in Python, so I think I should be able to get it to work on Windows, just need some help I guess.
2
3016
by: gregory_may | last post by:
First the research links: IPv6 spec (look for 'jumbo payload'): http://www.cs-ipv6.lancs.ac.uk/ipv6/documents/rfcs/archive/rfc1883.txt IPv6 Sample C# Client/Server http://www.codeproject.com/csharp/ipv6.asp I am developing an application where I need to broadcast information to clients. I have hit a 64K limit in UDP broadcasting. I am not exited
3
6237
by: jiri.juranek | last post by:
Hello, is there any common function for validation if string contains valid ip address(both ipv4 and ipv6)? Or does sb wrote some regular expression for this? thanks J
0
2227
by: Andrew | last post by:
Hello Everyone I'm just writing to inform the newsgroup or anyone who is interested. I have some what of a working copy of scapy, ported to Windows, based on the notes provided on the scapy mailing list for reference http://www.secdev.org/projects/scapy/ (scapy windows) for python version 24
0
1363
by: bparkis | last post by:
I have an installation of scapy on OS X (via macports) and I am trying to determine if it was successful or not. Nothing I do on the network seems to work completely, but on the other hand the installation didn't seem to have run into any trouble so I want to be sure. What test can I do to determine beyond a doubt whether this was a successful installation? I tried pscan.py, which was taken from ...
8
8945
by: Giampaolo Rodola' | last post by:
I'm not sure if this is a question about python programming, system administration or sockets in general... I have the FTP server in my signature to which I'd want to add IPv6 support. My hosting company provides me a common IPv4 address. I'd like to set up my workstation (Windows XP or Linux Debian, doesn't really matter) to temporarily use IPv6 for trying to add such feature to my library (I work on both Windows XP and Linux). Could...
0
1367
by: jonbutler88 | last post by:
I have macpython 2.5 installed, but I cant seem to get scapy installed. I have downloaded scapy.py, and put it in site-packages, for both my /Library/Python/2.5/site-packages and the one located in / System. Scapy fails to import. Is there another site-packages? Or a better way to install it? I am running OS X 10.5, on an intel mac. Cheers
2
5307
by: thomas1984 | last post by:
Hi I have a question about a library available for Python: Scapy (www.secdev.org/projects/scapy/). This library offers a variety of things but I am interested in how it interacts with wireless networks. I have read countless tutorials and documentation on it but I can't figure out the following: -- How to sniff for wireless networks (listen to beacon frames for passive scanning) -- How to sniff for wireless networks (transmitting probe...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.