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