mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-12-25 09:01:47 +00:00
Randomizer fixes
This commit is contained in:
parent
72826577b3
commit
726bb1ab7e
@ -31,6 +31,9 @@ bool gPingNScan = false;
|
||||
std::atomic<int> cons = 0, BrutingThrds = 0, gThreads;
|
||||
std::vector<int> MainStarter::portVector;
|
||||
int MainStarter::flCounter = 0;
|
||||
int MainStarter::gflIndex = 0;
|
||||
unsigned int **MainStarter::ipsstartfl = NULL;
|
||||
unsigned int **MainStarter::ipsendfl = NULL;
|
||||
bool MainStarter::savingBackUpFile = false;
|
||||
QJsonArray *jsonArr = new QJsonArray();
|
||||
bool horLineFlag = false;
|
||||
@ -368,7 +371,7 @@ void MainStarter::saveBackupToFile()
|
||||
{
|
||||
if (!saveBackup) return;
|
||||
FILE *savingFile = fopen("tempIPLst.bk", "w");
|
||||
if (savingFile != NULL)
|
||||
if (NULL != savingFile)
|
||||
{
|
||||
if (gflIndex < MainStarter::flCounter) {
|
||||
sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n",
|
||||
@ -483,15 +486,19 @@ void MainStarter::saveBackupToFile()
|
||||
}
|
||||
|
||||
bool saverRunning = false;
|
||||
void MainStarter::saveBK() {
|
||||
while (savingBackUpFile) Sleep(400);
|
||||
savingBackUpFile = true;
|
||||
saveBackupToFile();
|
||||
savingBackUpFile = false;
|
||||
}
|
||||
void MainStarter::saver()
|
||||
{
|
||||
saverRunning = true;
|
||||
Sleep(1000);
|
||||
while (saveBackup && globalScanFlag)
|
||||
{
|
||||
savingBackUpFile = true;
|
||||
saveBackupToFile();
|
||||
savingBackUpFile = false;
|
||||
saveBK();
|
||||
Sleep(10000);
|
||||
};
|
||||
saverRunning = false;
|
||||
@ -1365,6 +1372,10 @@ int thread_cleanup(void)
|
||||
void MainStarter::start(const char* targets, const char* ports) {
|
||||
std::srand(std::time(NULL));
|
||||
|
||||
MainStarter::flCounter = 0;
|
||||
MainStarter::gflIndex = 0;
|
||||
MainStarter::ipsstartfl = NULL;
|
||||
MainStarter::ipsendfl = NULL;
|
||||
HikVis::hikCounter = 0;
|
||||
HikVis::rviCounter = 0;
|
||||
saveBackup = true;
|
||||
@ -1390,7 +1401,7 @@ void MainStarter::start(const char* targets, const char* ports) {
|
||||
stt->doEmitionYellowFoundData("Stopping threads...");
|
||||
|
||||
while (cons > 0 || jsonArr->size() > 0) Sleep(2000);
|
||||
saveBackupToFile();
|
||||
MainStarter::saveBK();
|
||||
saveBackup = false;
|
||||
|
||||
thread_cleanup();
|
||||
|
@ -10,9 +10,9 @@
|
||||
class MainStarter {
|
||||
private: char dnsTarget[256];
|
||||
int ipsstart[4], ipsend[4];
|
||||
unsigned int **ipsstartfl = NULL, **ipsendfl = NULL;
|
||||
static unsigned int **ipsstartfl, **ipsendfl;
|
||||
unsigned long ip1, ip2;
|
||||
int gflIndex = 0;
|
||||
static int gflIndex;
|
||||
|
||||
private:
|
||||
void startIPScan();
|
||||
@ -25,6 +25,8 @@ public:
|
||||
static std::vector<int> portVector;
|
||||
static int flCounter;
|
||||
static bool savingBackUpFile;
|
||||
void saveBackupToFile();
|
||||
void saveBK();
|
||||
|
||||
public:
|
||||
MainStarter()
|
||||
@ -54,56 +56,56 @@ public:
|
||||
FileUpdater::negativeVector.clear();
|
||||
if (loginLst != NULL)
|
||||
{
|
||||
for (int i = 0; i < MaxLogin; ++i) delete[]loginLst[i];
|
||||
delete[]loginLst;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
for (int i = 0; i < flCounter; ++i) delete[] ipsendfl[i];
|
||||
delete[] ipsendfl;
|
||||
ipsendfl = NULL;
|
||||
};
|
||||
|
||||
@ -113,7 +115,6 @@ public:
|
||||
void unBlockButtons();
|
||||
void runAuxiliaryThreads();
|
||||
void saver();
|
||||
void saveBackupToFile();
|
||||
int fileLoader(const char *fileName);
|
||||
static void createResultFiles();
|
||||
void start(const char* targets, const char* ports);
|
||||
|
@ -354,7 +354,9 @@ int sharedDetector(const char * ip, int port, const std::string *buffcpy, const
|
||||
) return 33; //GEO web ip cam
|
||||
|
||||
if(Utils::ustrstr(buffcpy, "hikvision-webs") != -1
|
||||
|| (Utils::ustrstr(buffcpy, "hikvision digital") != -1
|
||||
|| (
|
||||
(Utils::ustrstr(buffcpy, "hikvision digital") != -1
|
||||
|| Utils::ustrstr(buffcpy, "doc/page/login.asp") != -1)
|
||||
&& Utils::ustrstr(buffcpy, "dvrdvs-webs") != -1)
|
||||
|| (Utils::ustrstr(buffcpy, "lapassword") != -1
|
||||
&& Utils::ustrstr(buffcpy, "lausername") != -1
|
||||
|
@ -2158,6 +2158,7 @@ QList<QStandardItem *> setRow(QString ip, QString loginPass, QString percentage)
|
||||
}
|
||||
std::atomic<bool> isBAModelLocked = false;
|
||||
int nesca_3::addBARow(QString ip, QString loginPass, QString percentage) {
|
||||
if (!globalScanFlag) return -1;
|
||||
while (isBAModelLocked) Sleep(10);
|
||||
isBAModelLocked = true;
|
||||
BAModel->appendRow(setRow(ip, loginPass, percentage));
|
||||
|
Loading…
Reference in New Issue
Block a user