Q:

How to send a message to a Router pre-connection

I’m working on a university project where we’re basically trying to recreate the Reaver WPS attack. Originally the plan was to reimplement it in Python or Ruby but as we don’t have a good starting point right now, we are going to start with C/C++.
The problem is, we don’t actually know where to start. Our first ideas were to use Wireshark to try and sniff some packets and see what’s actually happening.
I think we know that we’re going to be working with raw sockets and I’m going to be sending a message to a router to simulate the PIN. Is this different than sending a message to another computer, or should I be sending this to my default gateway, and otherwise what port should i be asking on?
Also any suggestions for libraries that we could use to code this up in Ruby or Python would be greatly appreciated. Especially libraries that would be related to connecting and managing wireless networks and working with raw sockets.

A:

Check out reaver here: link
The code is very well documented.
If you take a look at "send.c" in the source, it should have the type of code you are looking for.

