-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathMainStarter.h
135 lines (125 loc) · 2.94 KB
/
MainStarter.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef MAINSTARTER_H
#define MAINSTARTER_H
#include <ctime>
#include <string>
#include <qjsonobject.h>
#include <qjsonvalue.h>
#include <qjsonarray.h>
#include <qjsondocument.h>
#include "externData.h"
#include "mainResources.h"
#include "STh.h"
#include "Threader.h"
#include "FileUpdater.h"
#include "Connector.h"
#include "Utils.h"
#include "IPRandomizer.h"
#include "HikvisionLogin.h"
class MainStarter {
private: char dnsTarget[256];
int ipsstart[4], ipsend[4];
static unsigned int **ipsstartfl, **ipsendfl;
unsigned long ip1, ip2;
static int gflIndex;
private:
void startIPScan();
void startDNSScan();
void startImportScan();
int loadPorts(const char *data, char delim);
int loadTargets(const char *data);
public:
static std::vector<int> portVector;
static int flCounter;
static bool savingBackUpFile;
void saveBackupToFile();
void saveBK();
public:
MainStarter()
{
horLineFlag = false;
PieCamerasC1 = 0, PieBA = 0, PieOther = 0, PieSSH = 0;
camerasC1 = 0, baCount = 0, filtered = 0, Overl = 0, Alive = 0, Activity = 0, saved = 0, other = 0;
BrutingThrds = 0;
found = 0;
gTargets = 0;
cons = 0;
found = 0;
indexIP = 0;
flCounter = 0;
gflIndex = 0;
/*
ZeroMemory(ipsstart, sizeof(ipsstart));
ZeroMemory(ipsend, sizeof(ipsend));*/
ipsstart[0] = 0;
ipsend[0] = 0;
}
~MainStarter(){
FileUpdater::FUClear();
Threader::cleanUp();
curl_global_cleanup();
while (savingBackUpFile) Sleep(100);
FileUpdater::negativeVector.clear();
if (loginLst != NULL)
{
for (int i = 0; i < MaxLogin; ++i) delete[] loginLst[i];
delete[] loginLst;
loginLst = NULL;
};
if (passLst != NULL)
{
for (int i = 0; i < MaxPass; ++i) delete[] passLst[i];
delete[] passLst;
passLst = NULL;
};
if (wfPassLst != NULL)
{
for (int i = 0; i < MaxWFPass; ++i) delete[] wfPassLst[i];
delete[] wfPassLst;
wfPassLst = NULL;
};
if (wfLoginLst != NULL)
{
for (int i = 0; i < MaxWFLogin; ++i) delete[] wfLoginLst[i];
delete[] wfLoginLst;
wfLoginLst = NULL;
};
if (ftpPassLst != NULL)
{
for (int i = 0; i < MaxFTPPass; ++i) delete[] ftpPassLst[i];
delete[] ftpPassLst;
ftpPassLst = NULL;
};
if (ftpLoginLst != NULL)
{
for (int i = 0; i < MaxFTPLogin; ++i) delete[] ftpLoginLst[i];
delete[] ftpLoginLst;
ftpLoginLst = NULL;
};
if (sshlpLst != NULL)
{
for (int i = 0; i < MaxSSHPass; ++i) delete[] sshlpLst[i];
delete[] sshlpLst;
sshlpLst = NULL;
};
if (ipsstartfl != NULL)
{
for (int i = 0; i < flCounter; ++i) delete[] ipsstartfl[i];
delete[] ipsstartfl;
ipsstartfl = NULL;
};
if (ipsendfl != NULL)
{
for (int i = 0; i < flCounter; ++i) delete[] ipsendfl[i];
delete[] ipsendfl;
ipsendfl = NULL;
};
unBlockButtons();
}
void unBlockButtons();
void runAuxiliaryThreads();
void saver();
int fileLoader(const char *fileName);
static void createResultFiles();
void start(const char* targets, const char* ports);
};
#endif // MAINSTARTER_H