Sending a broadcast message using raw sockets

Peter Steele pwsteele at gmail.com
Tue Jan 22 18:57:59 CET 2013


In fact, I have used scapy in the past, but I am working in a restricted environment and don't have this package available. It provides tones more than I really need anyway, and I figured a simple raw socket send/receive can't be *that* hard. I may have to reverse engineer some C code, such as dhclient...

On Tuesday, January 22, 2013 8:07:12 AM UTC-8, Corey LeBleu wrote:
> If you don't *have* to use the actual socket library, you might want to have a look at scapy.  It's a packet manipulation program/library. It might make things a little easier.
> 
> http://www.secdev.org/projects/scapy/
> 
>  
> 
> On Jan 22, 2013 9:17 AM, "Peter Steele" <pwst... at gmail.com> wrote:
> 
> I just tried running you code, and the "sendto" call fails with "Network is unreachable". That's what I expected, based on other tests I've done. That's why I was asking about how to do raw sockets, since tools like dhclient use raw sockets to do what they do. It can clearly be duplicated in Python, I just need to find some code samples on how to construct a raw packet.
> 
> 
> 
> 
> --
> 
> http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list