I am trying to send 802.11 frames, but I couldn’t manage to see them in other computers (using wireshark).
The following code is based in some of examples.
Both computers have Debian installed.
#include <unistd.h>#include <cstdlib>#include <iostream>#include <string>#include <tins/tins.h>
using namespace std;using namespace Tins;
int main(int argc, char** argv) { Dot11Beacon beacon; beacon.addr1(Dot11::BROADCAST); beacon.addr2("00:01:02:03:04:05"); beacon.addr3(beacon.addr2()); beacon.ssid("libtins"); beacon.ds_parameter_set(8); beacon.supported_rates({1.0f, 5.5f, 11.0f}); beacon.rsn_information(RSNInformation::wpa2_psk()); PacketSender sender; sender.send(beacon, "wlan0");
return 0;}I added the radioTap encapsulation and it worked.
Thank for your (very) fast answer and great library.
Dot11Beacon beacon;beacon.addr1(Dot11::BROADCAST);beacon.addr2("64:66:b3:1a:db:29");beacon.addr3(beacon.addr2());beacon.ssid("test");
beacon.ds_parameter_set(8);beacon.supported_rates({1.0f, 5.5f, 11.0f});beacon.rsn_information(RSNInformation::wpa2_psk());
RadioTap radio = RadioTap() / beacon;PacketSender sender;sender.send( radio, "wlan0");