-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNetwork.h
48 lines (41 loc) · 1.45 KB
/
Network.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef NETWORK_H
#define NETWORK_H
#include <thread>
#include <atomic>
#include <tins/tins.h>
class Network
{
typedef Tins::Dot11::address_type address_type;
typedef std::set<address_type> ssids_type;
private:
ssids_type ssids;
std::map<std::string, std::set<address_type>> accessPoints;
Tins::NetworkInterface defaultIface = Tins::NetworkInterface::default_interface();
std::string spoofingIfaceName;
Tins::HWAddress<6> spoofedBSSID;
std::map<Tins::IPv4Address, Tins::HWAddress<6>> targets;
Tins::Dot11Deauthentication deauthPacket;
Tins::RadioTap radio;
std::thread deauthThread;
bool apScanCallback(Tins::PDU& pdu);
bool ipScanCallback(Tins::PDU& pdu);
std::atomic<bool> apScanning;
std::atomic<bool> deauthing;
std::atomic<bool> ipScanning;
void sendDeauth();
public:
Network();
virtual ~Network();
std::vector<std::wstring> getInterfaces();
void setSpoofingInterface(std::string interface);
void setBssid(const Tins::HWAddress<6> hwAddress);
void connectAP();
std::string getBssid();
int getConnectedDevices(std::string iprange);
std::map<std::string, std::set<address_type>> getAccessPoints();
void scanDevices(Tins::PacketSender& sender, std::string iprange);
void startDeauth();
void stopDeauth();
protected:
};
#endif // NETWORK_H