Giter Club home page Giter Club logo

scapy's People

Contributors

levigross avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scapy's Issues

struct error for large Dot11 packet: struct.error: ubyte format requires 0 <= number <= 255

I have written a python program to transmit data of approximately 950 bytes in the RSNinfo field of a scapy Dot11 type 2 packet (data). It is also a beacon. I am doing this for experimental purposes, sorry. When i try to send it through sendp, I get the following traceback:

Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/root/Desktop/ADSB-Dot11/ADSB/ADSB_lib.py", line 82, in run
self.startBroadcast(self.interface, "ADSB", json.dumps(adsb_message))
File "/root/Desktop/ADSB-Dot11/ADSB/ADSB_lib.py", line 112, in startBroadcast
sendp(frame, iface=interface, inter=0.10, loop=0, verbose=False)
File "/usr/local/lib/python3.6/dist-packages/scapy/sendrecv.py", line 263, in sendp
__gen_send(conf.L2socket(iface=iface, *args, **kargs), x, inter=inter, loop=loop, count=count, verbose=verbose, realtime=realtime)
File "/usr/local/lib/python3.6/dist-packages/scapy/sendrecv.py", line 238, in __gen_send
s.send(p)
File "/usr/local/lib/python3.6/dist-packages/scapy/supersocket.py", line 31, in send
sx = bytes(x)
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 291, in bytes
return self.build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 359, in build
p = self.do_build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 351, in do_build
pay = self.do_build_payload()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 343, in do_build_payload
return self.payload.do_build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 351, in do_build
pay = self.do_build_payload()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 343, in do_build_payload
return self.payload.do_build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 351, in do_build
pay = self.do_build_payload()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 343, in do_build_payload
return self.payload.do_build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 351, in do_build
pay = self.do_build_payload()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 343, in do_build_payload
return self.payload.do_build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 348, in do_build
pkt = self.self_build()
File "/usr/local/lib/python3.6/dist-packages/scapy/packet.py", line 339, in self_build
p = f.addfield(self, p, val)
File "/usr/local/lib/python3.6/dist-packages/scapy/fields.py", line 79, in addfield
return s+struct.pack(self.fmt, self.i2m(pkt,val))
struct.error: ubyte format requires 0 <= number <= 255

I really need to be able to do this for a project. Any help would be greatly appreciated.

Regards,
Puru

Scapy is now on github

Hi,

On behalf of the Scapy team, I would like to inform you that the development recently moved to github: http://github.com/secdev/scapy

In order to make things easier for the Scapy community, maybe you could consider either closing this repository, or make it a github fork.

Thanks,
Guillaume

ValueError: chr() arg not in range(256)

I have written a small script that reads a cap/pcap file, chnages its source mac and destination mac and send it over the wireless network. The error is seen in "Python27\lib\site-packages\scapy\utils.py" file.

error logs:
<Sniffed: TCP:0 UDP:1 ICMP:0 Other:0>
Traceback (most recent call last):
File "C:\scapy_try_1.py", line 57, in
send(inPcapFile)
File "C:\Python27\lib\site-packages\scapy\sendrecv.py", line 270, in send
realtime=realtime, return_packets=return_packets)
File "C:\Python27\lib\site-packages\scapy\sendrecv.py", line 248, in __gen_send
s.send(p)
File "C:\Python27\lib\site-packages\scapy\arch\pcapdnet.py", line 313, in send
sx = str(cls()/x)
File "C:\Python27\lib\site-packages\scapy\packet.py", line 277, in str
return self.build()
File "C:\Python27\lib\site-packages\scapy\packet.py", line 354, in build
p = self.do_build()
File "C:\Python27\lib\site-packages\scapy\packet.py", line 344, in do_build
pay = self.do_build_payload()
File "C:\Python27\lib\site-packages\scapy\packet.py", line 336, in do_build_payload
return self.payload.do_build()
File "C:\Python27\lib\site-packages\scapy\packet.py", line 341, in do_build
pkt = self.self_build()
File "C:\Python27\lib\site-packages\scapy\packet.py", line 332, in self_build
p = f.addfield(self, p, val)
File "C:\Python27\lib\site-packages\scapy\fields.py", line 72, in addfield
return s+struct.pack(self.fmt, self.i2m(pkt,val))
File "C:\Python27\lib\site-packages\scapy\layers\l2.py", line 105, in i2m
return MACField.i2m(self, pkt, self.i2h(pkt, x))
File "C:\Python27\lib\site-packages\scapy\fields.py", line 205, in i2m
return mac2str(x)
File "C:\Python27\lib\site-packages\scapy\utils.py", line 295, in mac2str
return "".join(map(lambda x: chr(int(x,16)), mac.split(":")))
File "C:\Python27\lib\site-packages\scapy\utils.py", line 295, in
return "".join(map(lambda x: chr(int(x,16)), mac.split(":")))
ValueError: chr() arg not in range(256)

Any help is highly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.