costamagna valerio | 2 Nov 2009 15:59
Favicon

srbt problem

hi *,
i have a problem with use srbt1() to send 1 packet using a bluetooth 
socket, someone can show me an example please??

thanks a lot, sorry for my bad english!

\o/

----

sid.

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Jim Comen | 5 Nov 2009 21:09
Favicon

Freezing a python script which uses scapy

Hi,

Has anyone tried to create a frozen binary of a python script which uses scapy?

 

Is there anything special which must be done?

 

I tried:

 

<Building the binary>

python freeze.py test.py                             

make

 

<Running the binary>

./test

WARNING: No route found for IPv6 destination :: (no default route?)

Traceback (most recent call last):

  File "test.py", line 2, in <module>

    from scapy.all import *

  File "/usr/lib/python2.5/site-packages/scapy/all.py", line 37, in <module>

    from layers.all import *

  File "/usr/lib/python2.5/site-packages/scapy/layers/all.py", line 16, in <module>

    _import_star(l)

  File "/usr/lib/python2.5/site-packages/scapy/layers/all.py", line 10, in _import_star

    mod = __import__(m, globals(), locals())

ImportError: No module named l2

 

 

Top of my file:

#!/usr/bin/python

from scapy.all import *

import getopt

import time

 

Jim Comen

Exar Corporation

919 439 5127

 


The information and any attached documents contained in this message
may be confidential and/or legally privileged. The message is
intended solely for the addressee(s). If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful. If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.
Dirk Loss | 5 Nov 2009 22:26
Picon
Favicon

Re: Freezing a python script which uses scapy

Jim Comen wrote:
> Has anyone tried to create a frozen binary of a python script which uses scapy?

I haven't used freeze, but I have successfully used PyInstaller to build 
an executable for Scapy v1. Should work on Linux, too. 
http://trac.secdev.org/scapy/wiki/BuildingScapyExe

With Scapy v2, I encountered the the same issues that you reported.
"ImportError: No module named l2", etc.

> Is there anything special which must be done?

Yes, because Scapy does some dynamic imports (what Pyinstaller calls 
"hidden imports".) http://bit.ly/2AXQHX

I managed to get around those errors by importing all layers/*.py 
modules explicitly in my top level script, so that PyInstaller got 
informed about the dependency. But there were still some other issues, 
that I currently don't remember.

Regards
Dirk

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Saptarshi Guha | 6 Nov 2009 18:48
Picon

Unknown Link Layayer followed by exceptions

Hello,
I would like to use scapy in a python program. I was using pcapy but  
need to figure out whether the data is actually due to
padding or real data (i.e sometimes ACK packets have no data but pcapy  
shows this as 6 bytes of data, though scapy shows
this as a Padding of 6 bytes, actual data being in a Raw packet).

However, when I try to open pcap file
pcr = scapy.utils.PcapReader("/ln/tcpdump/dump.13.56.09.15")
WARNING: PcapReader: unknown LL type [1]/[0x1]. Using Raw packets

pcr.read_packet()

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/ln/meraki/custom/lib/python2.6/site-packages/scapy/ 
utils.py", line 556, in read_packet
     p = conf.raw_layer(s)
TypeError: 'NoneType' object is not callable

I have created a small subset of this pcap file and PcapReader works  
on that.

Regards
Saparshi

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Philippe Biondi | 6 Nov 2009 19:47

Re: Unknown Link Layayer followed by exceptions

On Fri, 6 Nov 2009, Saptarshi Guha wrote:

> Hello,
> I would like to use scapy in a python program. I was using pcapy but need to 
> figure out whether the data is actually due to
> padding or real data (i.e sometimes ACK packets have no data but pcapy shows 
> this as 6 bytes of data, though scapy shows
> this as a Padding of 6 bytes, actual data being in a Raw packet).
>
> However, when I try to open pcap file
> pcr = scapy.utils.PcapReader("/ln/tcpdump/dump.13.56.09.15")
> WARNING: PcapReader: unknown LL type [1]/[0x1]. Using Raw packets
>
> pcr.read_packet()
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/ln/meraki/custom/lib/python2.6/site-packages/scapy/utils.py", line 
> 556, in read_packet
>   p = conf.raw_layer(s)
> TypeError: 'NoneType' object is not callable

While the traceback comes from a kind of bug, when you use scapy as a 
library, you need to import the layers present in your pcap you want scapy 
to decode for your program:

import scapy.layers.l2
import scapy.layers.inet

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Saptarshi Guha | 6 Nov 2009 20:34
Picon

Re: Unknown Link Layayer followed by exceptions

> While the traceback comes from a kind of bug, when you use scapy as a
> library, you need to import the layers present in your pcap you want scapy
> to decode for your program:
>
> import scapy.layers.l2
> import scapy.layers.inet
>
>

Thank you. I'll look into it as soon as I reach home.
Regards
Saptarshi

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Saptarshi Guha | 6 Nov 2009 20:37
Picon

Beginner Q: Size of packet?

Hello,
A rather basic question. I can get the size of the data in packet, but
how do I find out the total packet length (including all the headers)?

I have a packet returned from obj.read_next()
where obj is a PcapReader object.

Thank you for your time
Regards
Saptarshi

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Tim Broberg | 6 Nov 2009 20:55
Favicon

RE: Beginner Q: Size of packet?

len(packet) works for me.

________________________________________
From: Saptarshi Guha [saptarshi.guha <at> gmail.com]
Sent: Friday, November 06, 2009 11:37 AM
To: scapy.ml <at> secdev.org
Subject: [scapy.ml] Beginner Q: Size of packet?

Hello,
A rather basic question. I can get the size of the data in packet, but
how do I find out the total packet length (including all the headers)?

I have a packet returned from obj.read_next()
where obj is a PcapReader object.

Thank you for your time
Regards
Saptarshi

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

The information and any attached documents contained in this message
may be confidential and/or legally privileged.  The message is
intended solely for the addressee(s).  If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful.  If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Saptarshi Guha | 6 Nov 2009 22:29
Picon

Re: Unknown Link Layayer followed by exceptions

It worked.
Thank you
Saptarshi

> While the traceback comes from a kind of bug, when you use scapy as  
> a library, you need to import the layers present in your pcap you  
> want scapy to decode for your program:
>
> import scapy.layers.l2
> import scapy.layers.inet
>
>
> ---------------------------------------------------------------------
> To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
>

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Saptarshi Guha | 6 Nov 2009 22:29
Picon

Re: Beginner Q: Size of packet?

This works for me.
Thank you
Saptarshi

On Nov 6, 2009, at 2:55 PM, Tim Broberg wrote:

> len(packet) works for me.
>
> ________________________________________
> From: Saptarshi Guha [saptarshi.guha <at> gmail.com]
> Sent: Friday, November 06, 2009 11:37 AM
> To: scapy.ml <at> secdev.org
> Subject: [scapy.ml] Beginner Q: Size of packet?
>
> Hello,
> A rather basic question. I can get the size of the data in packet, but
> how do I find out the total packet length (including all the headers)?
>
> I have a packet returned from obj.read_next()
> where obj is a PcapReader object.
>
> Thank you for your time
> Regards
> Saptarshi
>
> ---------------------------------------------------------------------
> To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
>
> The information and any attached documents contained in this message
> may be confidential and/or legally privileged.  The message is
> intended solely for the addressee(s).  If you are not the intended
> recipient, you are hereby notified that any use, dissemination, or
> reproduction is strictly prohibited and may be unlawful.  If you are
> not the intended recipient, please contact the sender immediately by
> return e-mail and destroy all copies of the original message.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
>

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org


Gmane