diff --git a/BasicAuth.cpp b/BasicAuth.cpp
index aad8b20..7614061 100644
--- a/BasicAuth.cpp
+++ b/BasicAuth.cpp
@@ -2,24 +2,24 @@
#include "FileUpdater.h"
bool BA::checkOutput(const string *buffer, const char *ip, const int port) {
- if((Utils::ci_find_substr(*buffer, "200 ok") != -1 ||
- Utils::ci_find_substr(*buffer, "http/1.0 200") != -1 ||
- Utils::ci_find_substr(*buffer, "http/1.1 200") != -1)
- && Utils::ci_find_substr(*buffer, "http/1.1 401 ") == -1
- && Utils::ci_find_substr(*buffer, "http/1.0 401 ") == -1
- && Utils::ci_find_substr(*buffer, "401") == -1
- && Utils::ci_find_substr(*buffer, "Unauthorized") == -1
- && Utils::ci_find_substr(*buffer, "νεοπΰβθλόνϋ") == -1
- && Utils::ci_find_substr(*buffer, "ΠΠ΅ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½Ρ") == -1
+ if((Utils::ustrstr(*buffer, "200 ok") != -1 ||
+ Utils::ustrstr(*buffer, "http/1.0 200") != -1 ||
+ Utils::ustrstr(*buffer, "http/1.1 200") != -1)
+ && Utils::ustrstr(*buffer, "http/1.1 401 ") == -1
+ && Utils::ustrstr(*buffer, "http/1.0 401 ") == -1
+ && Utils::ustrstr(*buffer, "401") == -1
+ && Utils::ustrstr(*buffer, "Unauthorized") == -1
+ && Utils::ustrstr(*buffer, "νεοπΰβθλόνϋ") == -1
+ && Utils::ustrstr(*buffer, "ΠΠ΅ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½Ρ") == -1
) {
return true;
}
- else if (Utils::ci_find_substr(*buffer, "503 service unavailable") != -1
- || Utils::ci_find_substr(*buffer, "http/1.1 503") != -1
- || Utils::ci_find_substr(*buffer, "http/1.0 503") != -1
- || Utils::ci_find_substr(*buffer, "400 BAD_REQUEST") != -1
- || Utils::ci_find_substr(*buffer, "400 bad request") != -1
- || Utils::ci_find_substr(*buffer, "403 Forbidden") != -1
+ else if (Utils::ustrstr(*buffer, "503 service unavailable") != -1
+ || Utils::ustrstr(*buffer, "http/1.1 503") != -1
+ || Utils::ustrstr(*buffer, "http/1.0 503") != -1
+ || Utils::ustrstr(*buffer, "400 BAD_REQUEST") != -1
+ || Utils::ustrstr(*buffer, "400 bad request") != -1
+ || Utils::ustrstr(*buffer, "403 Forbidden") != -1
)
{
stt->doEmition_BARedData("[.] 503/400/403 - Waiting 30sec (" + QString(ip) + ":" + QString::number(port) + ")");
diff --git a/CheckKey_Th.cpp b/CheckKey_Th.cpp
index 34a0c1a..ca6dddc 100644
--- a/CheckKey_Th.cpp
+++ b/CheckKey_Th.cpp
@@ -65,22 +65,23 @@ int KeyCheckerMain()
Connector::nConnect((url + std::string("/api/checkaccount?key=") + std::string(trcPersKey)).c_str(),
std::stoi(trcSrvPortLine), &buffer, NULL, &headerVector);
- if(Utils::ci_find_substr(buffer, std::string("202 Accepted")) != -1) {
+ if(Utils::ustrstr(buffer, std::string("202 Accepted")) != -1) {
stt->doEmitionGreenFoundData("Key is valid.");
if(emitIfOK == 0) stt->doEmitionStartScanIP();
else if(emitIfOK == 1) stt->doEmitionStartScanDNS();
else if(emitIfOK == 2) stt->doEmitionStartScanImport();
return 1;
- } else if(Utils::ci_find_substr(buffer, std::string("400 Bad Request")) != -1) {
- QString errorDef = GetNSErrorDefinition(buffer.c_str(), "notify");
+ } else if(Utils::ustrstr(buffer, std::string("400 Bad Request")) != -1) {
+ QString errorDef = Utils::GetNSErrorDefinition(buffer.c_str(), "notify");
if(errorDef == "Invalid access key") stt->doEmitionYellowFoundData("[NS-Track] Key is unauthorized. A valid key is required.");
- else stt->doEmitionYellowFoundData("[Key check] -FAIL! [400 Bad Request : " + GetNSErrorDefinition(buffer.c_str(), "notify") + "]");
- } else if(Utils::ci_find_substr(buffer, std::string("503 Bad Gateway")) != -1) {
+ else stt->doEmitionYellowFoundData("[Key check] FAIL! [400 Bad Request : " +
+ Utils::GetNSErrorDefinition(buffer.c_str(), "notify") + "]");
+ } else if(Utils::ustrstr(buffer, std::string("503 Bad Gateway")) != -1) {
stt->doEmitionYellowFoundData("[Key check] 503 Backend not responding!");
} else {
char header[64] = {0};
getSubStrEx(buffer.c_str(), "http/1.1 ", "\r\n", header, 64);
- stt->doEmitionRedFoundData("[Key check] -FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ") Header: " + QString::fromLocal8Bit(header) + "");
+ stt->doEmitionRedFoundData("[Key check] FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ") Header: " + QString::fromLocal8Bit(header) + "");
if(gDebugMode) stt->doEmitionDebugFoundData(QString(buffer.c_str()));
};
} else {
diff --git a/Connector.cpp b/Connector.cpp
index 413c66e..143ec50 100644
--- a/Connector.cpp
+++ b/Connector.cpp
@@ -237,10 +237,7 @@ int Connector::_ConnectToPort(char* ip, int port)
{
if(gPingNScan)
{
- if(_pingMyTarget(ip) == 0)
- {
- return -2;
- };
+ if(_pingMyTarget(ip) == 0) return -2;
};
std::string buffer;
@@ -254,7 +251,13 @@ int Connector::_ConnectToPort(char* ip, int port)
++Alive;//ME2
++found;//PieStat
Lexems lx;
- lx._filler(port, buffer.c_str(), ip, size, &lx);
+ lx._filler(port, buffer, ip, size, &lx);
+
+ //if (Filter::negativeFilter(&buffer)) {
+ // if (Filter::resultFilter(&buffer)) {
+ // saveNode();
+ // }
+ //}
}
else if (size == -2) return -2;
return 0;
diff --git a/DrawerTh_ME2Scanner.cpp b/DrawerTh_ME2Scanner.cpp
index 17a6903..d4cb5d0 100644
--- a/DrawerTh_ME2Scanner.cpp
+++ b/DrawerTh_ME2Scanner.cpp
@@ -121,7 +121,7 @@ int MakePolygonLine(int gWidth)
AnomC1 = 0;
WF = 0;
baCount = 0;
- Filt = 0;
+ filtered = 0;
Overl = 0;
Lowl = 0;
Alive = 0;
@@ -151,7 +151,7 @@ void DrawerTh_ME2Scanner::run()
AnomC1 = 0;
WF = 0;
baCount = 0;
- Filt = 0;
+ filtered = 0;
Overl = 0;
Lowl = 0;
Alive = 0;
diff --git a/DrawerTh_QoSScanner.cpp b/DrawerTh_QoSScanner.cpp
index 86ab4fd..3f1ef25 100644
--- a/DrawerTh_QoSScanner.cpp
+++ b/DrawerTh_QoSScanner.cpp
@@ -2,6 +2,8 @@
#include "STh.h"
#include "externData.h"
+int DrawerTh_QoSScanner::MaxDataVal = 1;
+
void DrawerTh_QoSScanner::run()
{
while(QoSScanFlag)
@@ -30,7 +32,7 @@ void DrawerTh_QoSScanner::run()
AnomC1 = 0;
WF = 0;
baCount = 0;
- Filt = 0;
+ filtered = 0;
Overl = 0;
Lowl = 0;
Alive = 0;
@@ -41,7 +43,7 @@ void DrawerTh_QoSScanner::run()
AnomC1 = 0;
WF = 0;
baCount = 0;
- Filt = 0;
+ filtered = 0;
Overl = 0;
Lowl = 0;
Alive = 0;
diff --git a/DrawerTh_QoSScanner.h b/DrawerTh_QoSScanner.h
index 7f710e3..ba6015d 100644
--- a/DrawerTh_QoSScanner.h
+++ b/DrawerTh_QoSScanner.h
@@ -8,6 +8,8 @@ class DrawerTh_QoSScanner : public QThread
{
Q_OBJECT
+public:
+ static int MaxDataVal;
public:
static void doEmitionAddLine();
diff --git a/DrawerTh_VoiceScanner.cpp b/DrawerTh_VoiceScanner.cpp
index 12884bd..406a091 100644
--- a/DrawerTh_VoiceScanner.cpp
+++ b/DrawerTh_VoiceScanner.cpp
@@ -108,7 +108,7 @@ void DrawerTh_VoiceScanner::run()
Alive = 0;
AnomC1 = 0;
WF = 0;
- Filt = 0;
+ filtered = 0;
Lowl = 0;
baCount = 0;
Overl = 0;
@@ -124,7 +124,7 @@ void DrawerTh_VoiceScanner::run()
Alive = 0;
AnomC1 = 0;
WF = 0;
- Filt = 0;
+ filtered = 0;
Lowl = 0;
baCount = 0;
Overl = 0;
diff --git a/FTPAuth.cpp b/FTPAuth.cpp
index 4185731..86cdc4f 100644
--- a/FTPAuth.cpp
+++ b/FTPAuth.cpp
@@ -2,7 +2,7 @@
#include "FileUpdater.h"
bool FTPA::checkOutput(const string *buffer) {
- if(Utils::ci_find_substr(*buffer, "230") != -1) {
+ if(Utils::ustrstr(*buffer, "230") != -1) {
return true;
}
diff --git a/FileUpdater.cpp b/FileUpdater.cpp
index c22c257..42d41be 100644
--- a/FileUpdater.cpp
+++ b/FileUpdater.cpp
@@ -10,135 +10,22 @@ long FileUpdater::oldPassLstSize = 0;
long FileUpdater::oldSSHLstSize = 0;
long FileUpdater::oldWFLoginLstSize = 0;
long FileUpdater::oldWFPassLstSize = 0;
+int FileUpdater::gNegativeSize = 0;
std::mutex FileUpdater::filesUpdatingMutex;
std::condition_variable FileUpdater::cv;
bool FileUpdater::ready = false;
std::unique_lock FileUpdater::lk;
-
-void ReadUTF8(FILE* nFile, char *cp) {
- char buffFG[256] = {0};
- int i = 0;
- GlobalNegativeSize = 0;
-
- if(nFile != NULL)
- {
- while(fgets((char*)buffFG, sizeof(buffFG), nFile) != NULL)
- {
- if(buffFG[0] != '#' && buffFG[0] != ' ' && buffFG[0] != '\n' && buffFG[0] != '\r' && strcmp(buffFG, "") != 0 &&
- ((buffFG[0] == '/' && buffFG[1] == '/') == false) && ((buffFG[0] == '\t' && buffFG[1] == '\t' && buffFG[2] == '\t' && (buffFG[3] == 13 || buffFG[3] == 10 || buffFG[3] == '#')) == false)
- && (buffFG[0] == '\t' && buffFG[1] == '\t' && buffFG[2] == '\t' && (buffFG[3] == '/' && buffFG[4] == '/')) == false)
- {
- ++GlobalNegativeSize;
- }
- ZeroMemory(buffFG, sizeof(buffFG));
- };
-
- rewind(nFile);
- if(strcmp(cp, "UTF") == 0) fseek(nFile, 3, 0);
-
- GlobalNegatives = new char*[GlobalNegativeSize + 2];
-
- while(fgets(buffFG, sizeof(buffFG), nFile) != NULL)
- {
- if(buffFG[0] == '#' || buffFG[0] == ' ' || buffFG[0] == '\n' || buffFG[0] == '\r' || strcmp(buffFG, "") == 0 ||
- (buffFG[0] == '/' && buffFG[1] == '/'))
- {
- ZeroMemory(buffFG, sizeof(buffFG));
- continue;
- };
-
- if(buffFG[0] == '\t' && buffFG[1] == '\t' && buffFG[2] == '\t')
- {
- char buffFGT[256] = {0};
- strcpy(buffFGT, buffFG);
- char *ptr1 = strstr(buffFGT, "\t\t\t");
- ZeroMemory(buffFG, sizeof(buffFG));
- strcpy(buffFG, ptr1 + 3);
- };
-
- int bSz = strlen(buffFG);
- if((bSz == 2 && buffFG[0] == 13 && buffFG[1] == 10) || (bSz == 1 && (buffFG[0] == 13 || buffFG[0] == 10)))
- {
- ZeroMemory(buffFG, sizeof(buffFG));
- continue;
- };
- if(buffFG[bSz] == 13 || buffFG[bSz] == 10)
- {
- buffFG[bSz] = '\0';
- };
- if(buffFG[bSz - 1] == 13 || buffFG[bSz - 1] == 10)
- {
- buffFG[bSz - 1] = '\0';
- };
- if(buffFG[bSz - 2] == 13 || buffFG[bSz - 2] == 10)
- {
- buffFG[bSz - 2] = '\0';
- };
-
- if(strstr((char*)buffFG, "\n") != 0)
- {
- std::string res = std::string(buffFG);
- int sz = res.size();
- GlobalNegatives[i] = new char[sz + 1];
- ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i]));
- memcpy(GlobalNegatives[i], toLowerStr(res.c_str()).c_str(), sz - 1);
- memset(GlobalNegatives[i] + sz - 1, '\0', 1);
- ++i;
- }
- else
- {
- std::string res = std::string(buffFG);
- int sz = res.size();
- GlobalNegatives[i] = new char[sz + 1];
- ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i]));
- memcpy(GlobalNegatives[i], toLowerStr(res.c_str()).c_str(), sz);
- memset(GlobalNegatives[i] + sz, '\0', 1);
- ++i;
- };
- ZeroMemory(buffFG, sizeof(buffFG));
- };
-
- if(FileUpdater::oldNegLstSize == 0) stt->doEmitionGreenFoundData("Negative list loaded (" + QString::number(GlobalNegativeSize) + " entries)");
- else stt->doEmitionFoundData("Negative list updated (" + QString::number(GlobalNegativeSize) + " entries)");
-
- ZeroMemory(buffFG, sizeof(buffFG));
- fclose(nFile);
- }
- else
- {
- stt->doEmitionRedFoundData("No negative list found");
- stt->doEmitionKillSttThread();
- };
-}
+std::vector FileUpdater::negativeVector;
void negativeLoader() {
- FILE *nFile = fopen("negatives.txt", "rb, ccs=UTF-8");
+ std::ifstream file("negatives.txt");
+ std::string line;
- if( nFile != NULL)
- {
- unsigned char b[3] = {0};
- fread(b,1,2, nFile);
- if( b[0] == 0xEF && b[1] == 0xBB)
- {
- fread(b,1,1,nFile); // 0xBF
- ReadUTF8(nFile, "UTF");
- }
- else
- {
- rewind(nFile);
- ReadUTF8(nFile, "1251");
- };
- }
+ while (std::getline(file, line)) FileUpdater::negativeVector.push_back(line);
}
void updateNegatives() {
- if(GlobalNegatives != NULL)
- {
- for(int i = 0; i < GlobalNegativeSize; ++i) delete []GlobalNegatives[i];
- delete []GlobalNegatives;
- GlobalNegatives = NULL;
- };
-
+ FileUpdater::negativeVector.clear();
negativeLoader();
}
void updateLogin() {
diff --git a/FileUpdater.h b/FileUpdater.h
index fbc386d..e23f63f 100644
--- a/FileUpdater.h
+++ b/FileUpdater.h
@@ -4,8 +4,7 @@
#include
#include
#include
-#include "externData.h"
-#include "externFunctions.h"
+#include
class FileUpdater {
public:
@@ -20,6 +19,8 @@ public:
static std::condition_variable cv;
static std::mutex filesUpdatingMutex;
static std::unique_lock lk;
+ static int gNegativeSize;
+ static std::vector negativeVector;
public:
static void updateLists();
diff --git a/Filter.cpp b/Filter.cpp
new file mode 100644
index 0000000..ac7ff32
--- /dev/null
+++ b/Filter.cpp
@@ -0,0 +1,5 @@
+#include "Filter.h"
+
+bool Filter::resultFilter() {
+ return false;
+}
\ No newline at end of file
diff --git a/Filter.h b/Filter.h
new file mode 100644
index 0000000..51c17ce
--- /dev/null
+++ b/Filter.h
@@ -0,0 +1,9 @@
+#ifndef MAINSTARTER_H
+#define MAINSTARTER_H
+
+class Filter {
+public:
+ bool resultFilter();
+};
+
+#endif // MAINSTARTER_H
\ No newline at end of file
diff --git a/IPCAuth.cpp b/IPCAuth.cpp
index 32ea971..7f89d65 100644
--- a/IPCAuth.cpp
+++ b/IPCAuth.cpp
@@ -147,7 +147,7 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
else if (res != -1) {
for (int i = 0; i < negVector.size(); ++i)
{
- if (Utils::ci_find_substr(buffer, negVector[i]) != -1)
+ if (Utils::ustrstr(buffer, negVector[i]) != -1)
{
result = false;
break;
diff --git a/MainStarter.cpp b/MainStarter.cpp
index 415da91..620e68a 100644
--- a/MainStarter.cpp
+++ b/MainStarter.cpp
@@ -2,9 +2,36 @@
#include "MainStarter.h"
#include "Connector.h"
#include
+#include "Utils.h"
+#include
+#include
+#include
+#include
+
+int gTimeOut = 3;
+int gPingTimeout = 1;
+int gMode;
+int PieAnomC1 = 0, PieBA = 0, PieSusp = 0, PieLowl = 0, PieWF = 0, PieSSH = 0;
+int AnomC1 = 0, filtered = 0, Overl = 0, Lowl = 0, Alive = 0, saved = 0, Susp = 0, WF = 0, ssh = 0;
+int found = 0, indexIP = 0;
+int MaxPass = 0, MaxLogin = 0, MaxTags = 0, MaxWFLogin = 0, MaxWFPass = 0, MaxSSHPass = 0;
+int baCount = 0;
+int gMaxBrutingThreads = 50;
+unsigned int Activity = 0;
+char **loginLst, **passLst;
+char **wfLoginLst, **wfPassLst;
+char **sshlpLst;
+char gTLD[128] = { 0 };
+char gPorts[65536] = { 0 };
+char currentIP[MAX_ADDR_LEN] = { 0 };
+char finalIP[32] = { 0 };
+
+bool gPingNScan = false;
+std::atomic cons = 0, BrutingThrds = 0, gThreads;
std::vector MainStarter::portVector;
int MainStarter::flCounter = 0;
+bool MainStarter::savingBackUpFile = false;
QJsonArray *jsonArr = new QJsonArray();
@@ -331,7 +358,7 @@ int MainStarter::loadTargets(const char *data) {
ipsendfl[0], ipsendfl[1], ipsendfl[2], ipsendfl[3]);
}
- if (ip1 > ip2) {
+ if (gMode != 1 && ip1 > ip2) {
stt->doEmitionRedFoundData("Malformed input: check your range");
return -1;
}
@@ -461,7 +488,7 @@ void MainStarter::saveBackupToFile()
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
- sprintf(saveStr, "[THREAD_DELAY]: %d\n", gThreadDelay);
+ sprintf(saveStr, "[THREAD_DELAY]: %d\n", Threader::gThreadDelay);
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
@@ -487,17 +514,20 @@ void MainStarter::saveBackupToFile()
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
- FILE *savingFile = fopen("restore", "w");
+ std::string finalSaveStr(saveBuffer);
+ std::ofstream file("restore");
+ file << finalSaveStr;
+ ZeroMemory(saveBuffer, strlen(saveBuffer));
+
+ /*FILE *savingFile = fopen("restore", "w");
if (savingFile != NULL)
{
fputs(saveBuffer, savingFile);
fclose(savingFile);
}
- else stt->doEmitionRedFoundData("[_saver] Cannot open file.");
+ else stt->doEmitionRedFoundData("[_saver] Cannot open file.");*/
- ZeroMemory(saveStr, strlen(saveStr));
- ZeroMemory(saveBuffer, strlen(saveBuffer));
}
bool saverRunning = false;
@@ -507,9 +537,9 @@ void MainStarter::saver()
Sleep(1000);
while (globalScanFlag)
{
- __savingBackUpFile = true;
+ savingBackUpFile = true;
saveBackupToFile();
- __savingBackUpFile = false;
+ savingBackUpFile = false;
Sleep(10000);
};
saverRunning = false;
@@ -714,7 +744,7 @@ void _tracker() {
jsonMeta.insert("speed", QJsonValue(QString(metaIPS)));
jsonMeta.insert("eta", QJsonValue(QString(metaETA)));
jsonMeta.insert("threads", QJsonValue(QString::number(cons) + "/" + QString::number(gThreads)));
- jsonMeta.insert("bads", QJsonValue(QString::number(offlines)));
+ jsonMeta.insert("bads", QJsonValue("-1"));
jsonMeta.insert("version", QJsonValue(QString(gVER)));
jsonArr->push_front(QJsonValue(jsonMeta));
@@ -770,7 +800,8 @@ void _tracker() {
CSSOCKET(sock);
- stt->doEmitionRedFoundData("[NS-Track] -connect() returned " + QString::number(WSAGetLastError()) + ".");
+ stt->doEmitionRedFoundData("[NS-Track] connect() returned " +
+ QString::number(WSAGetLastError()) + ".");
continue;
};
@@ -786,7 +817,8 @@ void _tracker() {
{
CSSOCKET(sock);
- stt->doEmitionRedFoundData("[NS-Track] -send() returned " + QString::number(WSAGetLastError()) + ".");
+ stt->doEmitionRedFoundData("[NS-Track] send() returned " +
+ QString::number(WSAGetLastError()) + ".");
continue;
};
@@ -814,7 +846,7 @@ void _tracker() {
if (strlen(rBuffT) > 200000)
{
- stt->doEmitionRedFoundData("[NS-Track] (Inner) -Large error received from server (>200000b) " +
+ stt->doEmitionRedFoundData("[NS-Track] (Inner) Large error received from server (>200000b) " +
QString::number(WSAGetLastError()) + ".");
break;
};
@@ -830,7 +862,7 @@ void _tracker() {
{
CSSOCKET(sock);
- stt->doEmitionRedFoundData("[NS-Track] -recv() returned " + QString::number(WSAGetLastError()) + ".");
+ stt->doEmitionRedFoundData("[NS-Track] recv() returned " + QString::number(WSAGetLastError()) + ".");
continue;
};
@@ -838,7 +870,7 @@ void _tracker() {
if (strstr(rBuffT, "201 Created") != NULL)
{
- if (gDebugMode) stt->doEmitionYellowFoundData("[NS-Track] -OK. Data saved!");
+ if (gDebugMode) stt->doEmitionYellowFoundData("[NS-Track] OK. Data saved!");
stt->doEmitionDataSaved(true);
Sleep(1000);
stt->doEmitionDataSaved(false);
@@ -846,15 +878,14 @@ void _tracker() {
}
else if (strstr(rBuffT, "400 Bad Request") != NULL)
{
-
- QString errorDef = GetNSErrorDefinition(rBuffT, "notify");
+ QString errorDef = Utils::GetNSErrorDefinition(rBuffT, "notify");
if (errorDef == "Invalid access key") stt->doEmitionYellowFoundData("[NS-Track] [Key is unauthorized] A valid key is required.");
- else stt->doEmitionYellowFoundData("[NS-Track] -FAIL! [400 Bad Request : " + errorDef + "]");
+ else stt->doEmitionYellowFoundData("[NS-Track] FAIL! [400 Bad Request : " + errorDef + "]");
}
else
{
- stt->doEmitionYellowFoundData("[NS-Track] -FAIL! An error occured [" + QString(msgR) + "]");
+ stt->doEmitionYellowFoundData("[NS-Track] FAIL! An error occured [" + QString(msgR) + "]");
};
ZeroMemory(msgR, sizeof(msgR));
@@ -874,7 +905,7 @@ void _tracker() {
}
else
{
- stt->doEmitionRedFoundData("[NS-Track] -Balancer replied with invalid string.");
+ stt->doEmitionRedFoundData("[NS-Track] Balancer replied with invalid string.");
};
CSSOCKET(sock);
diff --git a/MainStarter.h b/MainStarter.h
index 2191646..655a8d5 100644
--- a/MainStarter.h
+++ b/MainStarter.h
@@ -24,18 +24,15 @@ private:
public:
static std::vector portVector;
static int flCounter;
+ static bool savingBackUpFile;
public:
- MainStarter(short mode,
- const char* targets,
- const char* ports,
- const char* tld = nullptr
- )
+ MainStarter(const char* targets, const char* ports)
{
horLineFlag = false;
PieAnomC1 = 0, PieWF = 0, PieBA = 0, PieSusp = 0, PieLowl = 0, PieSSH = 0;
- AnomC1 = 0, baCount = 0, Filt = 0, Overl = 0, Lowl = 0, Alive = 0, Activity = 0, saved = 0, Susp = 0,
- WF = 0, offlines = 0;
+ AnomC1 = 0, baCount = 0, filtered = 0, Overl = 0, Lowl = 0, Alive = 0, Activity = 0, saved = 0, Susp = 0,
+ WF = 0;
BrutingThrds = 0;
found = 0;
gTargets = 0;
@@ -68,8 +65,9 @@ public:
Threader::cleanUp();
curl_global_cleanup();
- while (__savingBackUpFile) Sleep(100);
+ while (savingBackUpFile) Sleep(100);
+ FileUpdater::negativeVector.clear();
if (loginLst != NULL)
{
for (int i = 0; i < MaxLogin; ++i) delete[]loginLst[i];
@@ -82,12 +80,6 @@ public:
delete[]passLst;
passLst = NULL;
};
- if (GlobalNegatives != NULL)
- {
- for (int i = 0; i < GlobalNegativeSize; ++i) delete[]GlobalNegatives[i];
- delete[]GlobalNegatives;
- GlobalNegatives = NULL;
- };
if (wfPassLst != NULL)
{
for (int i = 0; i < MaxWFPass; ++i) delete[]wfPassLst[i];
diff --git a/SSHAuth.cpp b/SSHAuth.cpp
index feda9de..1f89450 100644
--- a/SSHAuth.cpp
+++ b/SSHAuth.cpp
@@ -63,7 +63,6 @@ int _sshConnect(const char *user, const char *pass, const char *host, int port)
ssh_disconnect(ssh_session);
ssh_free(ssh_session);
curl_easy_cleanup(curl);
- ++offlines;
return -2;
}
else
diff --git a/STh.cpp b/STh.cpp
index 914ddbf..9267691 100644
--- a/STh.cpp
+++ b/STh.cpp
@@ -85,8 +85,7 @@ void STh::setPorts(QString ports) {
}
void STh::run()
{
- MainStarter ms(gMode,
- this->target.toLocal8Bit().data(),
+ MainStarter ms(this->target.toLocal8Bit().data(),
this->ports.toLocal8Bit().data()
);
ms.start();
diff --git a/Threader.cpp b/Threader.cpp
index eb69281..dedd6fc 100644
--- a/Threader.cpp
+++ b/Threader.cpp
@@ -1,5 +1,6 @@
#include "Threader.h"
+int Threader::gThreadDelay = 10;
int Threader::threadId = 0;
std::mutex Threader::m;
bool Threader::ready = false;
@@ -27,6 +28,7 @@ void Threader::cleanUp() {
std::unique_lock lk(m);
lk.unlock();
lk.release();
+ Sleep(1500);
threadId = 0;
std::queue empty = {};
std::swap(ipQueue, empty);
diff --git a/Threader.h b/Threader.h
index 3c4ed1c..a493a2d 100644
--- a/Threader.h
+++ b/Threader.h
@@ -16,6 +16,7 @@ public:
static bool ready;
static std::condition_variable cv;
static std::queue ipQueue;
+ static int gThreadDelay;
public:
static void fireThread(std::string ip, void *func(void));
diff --git a/Utils.cpp b/Utils.cpp
index c26f533..31a7e72 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -14,4 +14,4 @@ char * Utils::getProxy() {
getSystemProxy();
#endif
return "";
-}
+}
\ No newline at end of file
diff --git a/Utils.h b/Utils.h
index a0e7297..bfb09a5 100644
--- a/Utils.h
+++ b/Utils.h
@@ -3,6 +3,7 @@
#include
#include
+#include
using namespace std;
@@ -23,7 +24,7 @@ private:
class Utils {
public:
// find substring (case insensitive)
- template static int ci_find_substr(const T& str1,
+ template static int ustrstr(const T& str1,
const T& str2,
const locale& loc = locale()) {
@@ -33,7 +34,7 @@ public:
else return -1;
}
- template static int ci_find_substr(const T& str1,
+ template static int ustrstr(const T& str1,
const char* str2c,
const locale& loc = locale()) {
@@ -44,6 +45,24 @@ public:
else return -1;
}
+ static QString GetNSErrorDefinition(const char *str, const char *elem){
+ const char *temp = strstr(str, elem);
+
+ if (temp != NULL)
+ {
+ char definition[128] = { 0 };
+ const char *firstComma = strstr(temp + strlen(elem) + 1, "\"");
+ const char *lastComma = strstr(firstComma + 1, "\"");
+
+ int sz = lastComma - firstComma - 1;
+
+ strncpy(definition, firstComma + 1, (sz < 128 ? sz : 128));
+
+ return QString(definition);
+ }
+ else return QString("No definition found!");
+ }
+
char * getProxy();
int getProxyPort();
};
diff --git a/WebformWorker.cpp b/WebformWorker.cpp
index cff2bf0..ce9d57f 100644
--- a/WebformWorker.cpp
+++ b/WebformWorker.cpp
@@ -12,20 +12,20 @@ lopaStr WFClass::parseResponse(const char *ip,
if(buffer->size() != 0)
{
- if(Utils::ci_find_substr(*buffer, std::string(formVal)) == -1
- && Utils::ci_find_substr(*buffer, std::string("denied")) == -1
- && Utils::ci_find_substr(*buffer, std::string("Location:")) == -1
- && Utils::ci_find_substr(*buffer, std::string("Authentication required")) == -1
- && Utils::ci_find_substr(*buffer, std::string("invalid")) == -1
- && Utils::ci_find_substr(*buffer, std::string("err")) == -1
- && Utils::ci_find_substr(*buffer, std::string(".href")) == -1
- && Utils::ci_find_substr(*buffer, std::string(".replace")) == -1
- && Utils::ci_find_substr(*buffer, std::string(".location")) == -1
- && Utils::ci_find_substr(*buffer, std::string("501 not implemented")) == -1
- && Utils::ci_find_substr(*buffer, std::string("http-equiv")) == -1
- && Utils::ci_find_substr(*buffer, std::string("busy")) == -1
- && Utils::ci_find_substr(*buffer, std::string("later")) == -1
- && Utils::ci_find_substr(*buffer, std::string("forbidden")) == -1
+ if(Utils::ustrstr(*buffer, std::string(formVal)) == -1
+ && Utils::ustrstr(*buffer, std::string("denied")) == -1
+ && Utils::ustrstr(*buffer, std::string("Location:")) == -1
+ && Utils::ustrstr(*buffer, std::string("Authentication required")) == -1
+ && Utils::ustrstr(*buffer, std::string("invalid")) == -1
+ && Utils::ustrstr(*buffer, std::string("err")) == -1
+ && Utils::ustrstr(*buffer, std::string(".href")) == -1
+ && Utils::ustrstr(*buffer, std::string(".replace")) == -1
+ && Utils::ustrstr(*buffer, std::string(".location")) == -1
+ && Utils::ustrstr(*buffer, std::string("501 not implemented")) == -1
+ && Utils::ustrstr(*buffer, std::string("http-equiv")) == -1
+ && Utils::ustrstr(*buffer, std::string("busy")) == -1
+ && Utils::ustrstr(*buffer, std::string("later")) == -1
+ && Utils::ustrstr(*buffer, std::string("forbidden")) == -1
) {
stt->doEmition_BAGreenData("[+] " + QString(ip) + ":" + QString::number(port) + " - WF pass: " +
@@ -36,9 +36,9 @@ lopaStr WFClass::parseResponse(const char *ip,
} else {
- if(Utils::ci_find_substr(*buffer, std::string("501 not implemented")) != -1) stt->doEmitionRedFoundData("" + QString(ip) + ":" + QString::number(port) + " - [WF]: 501 Not Implemented.");
+ if(Utils::ustrstr(*buffer, std::string("501 not implemented")) != -1) stt->doEmitionRedFoundData("" + QString(ip) + ":" + QString::number(port) + " - [WF]: 501 Not Implemented.");
- if(Utils::ci_find_substr(*buffer, std::string("404 not found")) != -1) stt->doEmitionRedFoundData("" + QString(ip) + ":" + QString::number(port) + " - [WF]: 404 Not Found.");
+ if(Utils::ustrstr(*buffer, std::string("404 not found")) != -1) stt->doEmitionRedFoundData("" + QString(ip) + ":" + QString::number(port) + " - [WF]: 404 Not Found.");
return result;
}
diff --git a/externData.h b/externData.h
index cf7cdb7..39f6b70 100644
--- a/externData.h
+++ b/externData.h
@@ -1,5 +1,6 @@
#ifndef EXTERNDATA_H
#define EXTERNDATA_H
+#include
#include
#define RECV_MAX_SIZE 350000
@@ -22,24 +23,24 @@ extern QJsonArray *jsonArr;
extern unsigned long long gTargetsNumber;
extern long long unsigned int gTargets;
-extern volatile int cons, BrutingThrds, gThreads;
-extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst, **GlobalNegatives;
-extern bool trackerOK, __savingBackUpFile, globalScanFlag, MapWidgetOpened,
- widgetIsHidden, OnlineMsgSentFlag, HTMLDebugMode, gNegDebugMode,
+extern std::atomic cons, BrutingThrds, gThreads;
+extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst;
+extern bool trackerOK, globalScanFlag, MapWidgetOpened,
+ widgetIsHidden, gNegDebugMode,
gDebugMode, horLineFlag, gPingNScan, gShuffle,
-BALogSwitched;
+ BALogSwitched;
extern int found, indexIP, gMode,
MaxPass, MaxLogin, MaxWFLogin, MaxWFPass, MaxSSHPass,
- GlobalNegativeSize, gMaxBrutingThreads,
+ gMaxBrutingThreads,
gTimeOut, PieAnomC1, PieSusp, PieBA, PieLowl, PieWF, PieSSH,
- gThreadDelay, AnomC1, Filt, Overl, Lowl, Alive, saved,
+ AnomC1, filtered, Overl, Lowl, Alive, saved,
Susp,
WF,
baCount,
- offlines, ssh, globalPinger, gPingTimeout, nickFlag, offlineFlag;
+ ssh, globalPinger, gPingTimeout;
extern unsigned int Activity;
extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[64],
- trcPort[32], trcSrvPortLine[32], saveEndIP[128],
+ trcPort[32], trcSrvPortLine[32],
gTLD[128], gPorts[65536],
gProxyIP[64], gProxyPort[8],
currentIP[MAX_ADDR_LEN],
@@ -47,9 +48,4 @@ extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[64],
extern char gVER[32];
-struct pl{
- int loginCounter;
- int passCounter;
-};
-
#endif // EXTERNDATA
diff --git a/externFunctions.h b/externFunctions.h
index 7707e17..15bc901 100644
--- a/externFunctions.h
+++ b/externFunctions.h
@@ -2,12 +2,6 @@
#define EF_H
extern std::string toLowerStr(const char *str);
-extern int startScan(char* argv);
-extern QString GetNSErrorDefinition(const char *str, const char *defin);
extern char* strstri(const char *_Str, const char *_SubStr);
-extern void getSubStr(char *src, char *startStr, char *endStr, char *dest, int szDest);
-extern void getSubStrEx(char *src, char *startStr, char *endStr, char *dest, int szDest);
-extern char *_findFirst(const char *str, char *delim);
-
#endif // EF_H
diff --git a/finder.cpp b/finder.cpp
index c9c213b..9b93031 100644
--- a/finder.cpp
+++ b/finder.cpp
@@ -10,6 +10,40 @@
#include
#include "FileUpdater.h"
#include "IPCAuth.h"
+#include
+
+unsigned char tl(unsigned char d)
+{
+ if (d >= 192 && d <= 223)
+ {
+ return (unsigned char)(d + 32);
+ }
+ else
+ {
+ return tolower(d);
+ };
+}
+
+std::string toLowerStr(const char *str)
+{
+ if (str != NULL) {
+ int tsz = strlen(str);
+ char *strr = new char[tsz + 1];
+ ZeroMemory(strr, tsz);
+
+ for (int i = 0; i < tsz; i++)
+ {
+ strr[i] = tl(str[i]);
+ };
+
+ memset(strr + tsz, '\0', 1);
+
+ std::string tstr = std::string(strr);
+ delete[]strr;
+ return tstr;
+ }
+ else return "";
+}
char* strstri(const char *_Str, const char *_SubStr)
{
@@ -187,60 +221,69 @@ char *GetCodePage(const char *str)
};
}
-int globalSearchNeg(const char *buffcpy, const char *ip, int port)
+int globalSearchNeg(const std::string buff, const char *ip, int port, const char *cp)
{
- QTextCodec *nCodec = QTextCodec::codecForName("Windows-1251");
- for(int i = 0; i < GlobalNegativeSize; ++i)
+ QTextCodec *codec;
+ QString codedStr;
+
+ if (strstri(cp, "shift_jis") != NULL)
{
- FileUpdater::cv.wait(FileUpdater::lk, []{return FileUpdater::ready;});
- if(!globalScanFlag) return -1;
+ codec = QTextCodec::codecForName("Shift-JIS");
+ codedStr = codec->toUnicode(buff.c_str());
+ }
+ else if (strstri(cp, "utf") != NULL)
+ {
+ codec = QTextCodec::codecForName("UTF-8");
+ codedStr = codec->toUnicode(buff.c_str());
+ }
+ else if (strstri(cp, "cp") != NULL || strstri(cp, "windows") != NULL)
+ {
+ codec = QTextCodec::codecForName("Windows-1251");
+ codedStr = codec->toUnicode(buff.c_str());
+ }
+ else if (strstri(cp, "gb") != NULL)
+ {
+ codec = QTextCodec::codecForName("GB2312");
+ codedStr = codec->toUnicode(buff.c_str());
+ }
+ else codedStr = QString(buff.c_str());
- if(strstr(buffcpy, GlobalNegatives[i]) != NULL)
+ for (auto negEntry : FileUpdater::negativeVector) {
+ FileUpdater::cv.wait(FileUpdater::lk, []{return FileUpdater::ready; });
+ if (!globalScanFlag) return -1;
+
+ if (Utils::ustrstr(std::string(codedStr.toLocal8Bit().data()), negEntry) != -1){
+ if (gNegDebugMode)
{
- if(gNegDebugMode)
- {
- stt->doEmitionDebugFoundData("[" + QString(ip) + ":" + QString::number(port) +
- "" + "]\tNegative hit: \"" + nCodec->toUnicode(GlobalNegatives[i]).toHtmlEscaped() + "\"");
- if(strlen(GlobalNegatives[i]) < 2)
- {
- stt->doEmitionDebugFoundData(" Len:" + QString::number(strlen(GlobalNegatives[i])));
- };
- if(strcmp(GlobalNegatives[i], "") == 0)
- {
- stt->doEmitionDebugFoundData("Empty hit!");
- };
- if(strcmp(GlobalNegatives[i], " ") == 0)
- {
- stt->doEmitionDebugFoundData("Space hit!");
- };
- };
+ QTextCodec *nCodec = QTextCodec::codecForName("Windows-1251");
+ stt->doEmitionDebugFoundData("[" + QString(ip) + ":" + QString::number(port) +
+ "" + "]\tNegative hit: \"" + nCodec->toUnicode(negEntry.c_str()).toHtmlEscaped()
+ + "\"");
+ }
- ++Filt;
- return -1;
- };
- };
+ ++filtered;
+ return -1;
+ }
+ }
}
-int globalSearchPrnt(const char *buffcpy)
+int globalSearchPrnt(const std::string buffcpy)
{
- if(strstr(buffcpy, "en/_top.htm") != NULL || strstr(buffcpy, "cannon http server") != NULL
- || strstr(buffcpy, "konica minolta") != NULL || strstr(buffcpy, "/eng/home_frm.htm") != NULL
- || strstr(buffcpy, "networkScanner webserver") != NULL || strstr(buffcpy, "/eng/htm/top.htm") != NULL
- || strstr(buffcpy, "pages/t_ixdmy.htm") != NULL
- || strstr(buffcpy, "/web/guest/") != NULL || strstr(buffcpy, "printerInfo") != NULL
- || strstr(buffcpy, "hp photosmart") != NULL
- || strstr(buffcpy, "menu and") != NULL
- || strstr(buffcpy, "hewlett packard") != NULL
- || strstr(buffcpy, "laserjet") != NULL || strstr(buffcpy, "supplies summary") != NULL
- || strstr(buffcpy, "seiko epson") != NULL || strstr(buffcpy, "ink_y.png") != NULL
- || strstr(buffcpy, "epsonnet") != NULL || strstr(buffcpy, "printer name") != NULL
+ if(Utils::ustrstr(buffcpy, "en/_top.htm") != -1 || Utils::ustrstr(buffcpy, "cannon http server") != -1
+ || Utils::ustrstr(buffcpy, "konica minolta") != -1 || Utils::ustrstr(buffcpy, "/eng/home_frm.htm") != -1
+ || Utils::ustrstr(buffcpy, "networkScanner webserver") != -1 || Utils::ustrstr(buffcpy, "/eng/htm/top.htm") != -1
+ || Utils::ustrstr(buffcpy, "pages/t_ixdmy.htm") != -1
+ || Utils::ustrstr(buffcpy, "/web/guest/") != -1 || Utils::ustrstr(buffcpy, "printerInfo") != -1
+ || Utils::ustrstr(buffcpy, "hp photosmart") != -1
+ || Utils::ustrstr(buffcpy, "menu and") != -1
+ || Utils::ustrstr(buffcpy, "hewlett packard") != -1
+ || Utils::ustrstr(buffcpy, "laserjet") != -1 || Utils::ustrstr(buffcpy, "supplies summary") != -1
+ || Utils::ustrstr(buffcpy, "seiko epson") != -1 || Utils::ustrstr(buffcpy, "ink_y.png") != -1
+ || Utils::ustrstr(buffcpy, "epsonnet") != -1 || Utils::ustrstr(buffcpy, "printer name") != -1
)
{
- if(gNegDebugMode)
- {
- stt->doEmitionDebugFoundData("Printer detected.");
- };
+ if(gNegDebugMode) stt->doEmitionDebugFoundData("Printer detected.");
return -1;
};
@@ -248,95 +291,95 @@ int globalSearchPrnt(const char *buffcpy)
return 0;
}
-int sharedDetector(const char * ip, int port, const char *buffcpy) {
+int sharedDetector(const char * ip, int port, const std::string buffcpy, const char *cp) {
- if(strstr(buffcpy, "401 authorization") != NULL || strstr(buffcpy, "401 unauthorized") != NULL
- || (strstr(buffcpy, "www-authenticate") != NULL && strstr(buffcpy, "401 ") != NULL )
- || strstr(buffcpy, "401 unauthorized access denied") != NULL
- || strstr(buffcpy, "401 unauthorised") != NULL || (strstr(buffcpy, "www-authenticate") != NULL
- && strstr(buffcpy, " 401\r\n") != NULL)
+ if(Utils::ustrstr(buffcpy, "401 authorization") != -1 || Utils::ustrstr(buffcpy, "401 unauthorized") != -1
+ || (Utils::ustrstr(buffcpy, "www-authenticate") != -1 && Utils::ustrstr(buffcpy, "401 ") != -1 )
+ || Utils::ustrstr(buffcpy, "401 unauthorized access denied") != -1
+ || Utils::ustrstr(buffcpy, "401 unauthorised") != -1 || (Utils::ustrstr(buffcpy, "www-authenticate") != -1
+ && Utils::ustrstr(buffcpy, " 401\r\n") != -1)
) {
- if(strstr(buffcpy, "digest realm") != NULL && strstr(buffcpy, "basic realm") == NULL) {
+ if(Utils::ustrstr(buffcpy, "digest realm") != -1 && Utils::ustrstr(buffcpy, "basic realm") == -1) {
return 101;
} else return 1;
};
- if(strstr(buffcpy, "netwave ip camera")) return 11;
- if(strstr(buffcpy, "live view / - axis")) return 12;
- if(strstr(buffcpy, "vilar ipcamera")) return 13;
- if(strstr(buffcpy, "window.location = \"rdr.cgi\"")) return 14;
- if(strstr(buffcpy, "httpfileserver")) return 15;
- if(strstr(buffcpy, "real-time ip camera monitoring system") != NULL
- || strstr(buffcpy, "server push mode") != NULL
+ if (Utils::ustrstr(buffcpy, "netwave ip camera") != -1) return 11;
+ if (Utils::ustrstr(buffcpy, "live view / - axis") != -1) return 12;
+ if (Utils::ustrstr(buffcpy, "vilar ipcamera") != -1) return 13;
+ if (Utils::ustrstr(buffcpy, "window.location = \"rdr.cgi\"") != -1) return 14;
+ if (Utils::ustrstr(buffcpy, "httpfileserver") != -1) return 15;
+ if(Utils::ustrstr(buffcpy, "real-time ip camera monitoring system") != -1
+ || Utils::ustrstr(buffcpy, "server push mode") != -1
) return 17; //Real-time IP Camera Monitoring System
- if(strstr(buffcpy, "linksys.com") != NULL && strstr(buffcpy, "tm05") != NULL) return 18; //linksys.com cameras
- if(strstr(buffcpy, "reecam ip camera") != NULL) return 19; //reecam cameras
- if(strstr(buffcpy, "/view/viewer_index.shtml") != NULL) return 20; //axis cameras
- if(strstr(buffcpy, "bridge eyeon") != NULL) return 21; //Bridge Eyeon
- if(strstr(buffcpy, "ip camera control webpage") != NULL && strstr(buffcpy, "/main/cs_motion.asp") != NULL) return 22; //ip camera control
- if(strstr(buffcpy, "network camera") != NULL && strstr(buffcpy, "/live/index2.html") != NULL) return 23; //network camera BB-SC384
- if(strstr(buffcpy, "network camera") != NULL && strstr(buffcpy, "/viewer/live/en/live.html") != NULL) return 24; //Network Camera VB-M40
- if(strstr(buffcpy, "panasonic ") != NULL && strstr(buffcpy, ":60002/snapshotjpeg") != NULL) return 25; //Panasonic wtfidonteven-camera
- if(strstr(buffcpy, "sony network camera") != NULL && strstr(buffcpy, "/command/inquiry.cgi?") != NULL) return 26; //Sony Network Camera
- if(strstr(buffcpy, "network camera") != NULL && strstr(buffcpy, "src=\"webs.cgi?") != NULL) return 27; //UA Network Camera
- if(strstr(buffcpy, "network camera") != NULL && strstr(buffcpy, "/viewer/live/index.html") != NULL) return 28; //Network Camera VB-M40
- if(strstr(buffcpy, "lg smart ip device") != NULL) return 29; //LG Smart IP Device Camera
- if(strstr(buffcpy, "/view/viewer_index.shtml") != NULL) return 20; //axis cameras
- if(strstr(buffcpy, "nas") != NULL && strstr(buffcpy, "/cgi-bin/data/viostor-220/viostor/viostor.cgi") != NULL) return 30; //NAX
- if(strstr(buffcpy, "ip camera") != NULL && strstr(buffcpy, "check_user.cgi") != NULL) return 31; //axis cameras
- if(strstr(buffcpy, "ws(\"user\");") != NULL && strstr(buffcpy, "src=\"/tool.js") != NULL
- && strstr(buffcpy, "") != NULL) return 32; //web ip cam
- if(strstr(buffcpy, "geovision") != NULL
- && (strstr(buffcpy, "ip camera") != NULL
- || strstr(buffcpy, "ssi.cgi/login.htm") != NULL)) return 33; //GEO web ip cam
+ if(Utils::ustrstr(buffcpy, "linksys.com") != -1 && Utils::ustrstr(buffcpy, "tm05") != -1) return 18; //linksys.com cameras
+ if(Utils::ustrstr(buffcpy, "reecam ip camera") != -1) return 19; //reecam cameras
+ if(Utils::ustrstr(buffcpy, "/view/viewer_index.shtml") != -1) return 20; //axis cameras
+ if(Utils::ustrstr(buffcpy, "bridge eyeon") != -1) return 21; //Bridge Eyeon
+ if(Utils::ustrstr(buffcpy, "ip camera control webpage") != -1 && Utils::ustrstr(buffcpy, "/main/cs_motion.asp") != -1) return 22; //ip camera control
+ if(Utils::ustrstr(buffcpy, "network camera") != -1 && Utils::ustrstr(buffcpy, "/live/index2.html") != -1) return 23; //network camera BB-SC384
+ if(Utils::ustrstr(buffcpy, "network camera") != -1 && Utils::ustrstr(buffcpy, "/viewer/live/en/live.html") != -1) return 24; //Network Camera VB-M40
+ if(Utils::ustrstr(buffcpy, "panasonic ") != -1 && Utils::ustrstr(buffcpy, ":60002/snapshotjpeg") != -1) return 25; //Panasonic wtfidonteven-camera
+ if(Utils::ustrstr(buffcpy, "sony network camera") != -1 && Utils::ustrstr(buffcpy, "/command/inquiry.cgi?") != -1) return 26; //Sony Network Camera
+ if(Utils::ustrstr(buffcpy, "network camera") != -1 && Utils::ustrstr(buffcpy, "src=\"webs.cgi?") != -1) return 27; //UA Network Camera
+ if(Utils::ustrstr(buffcpy, "network camera") != -1 && Utils::ustrstr(buffcpy, "/viewer/live/index.html") != -1) return 28; //Network Camera VB-M40
+ if(Utils::ustrstr(buffcpy, "lg smart ip device") != -1) return 29; //LG Smart IP Device Camera
+ if(Utils::ustrstr(buffcpy, "/view/viewer_index.shtml") != -1) return 20; //axis cameras
+ if(Utils::ustrstr(buffcpy, "nas") != -1 && Utils::ustrstr(buffcpy, "/cgi-bin/data/viostor-220/viostor/viostor.cgi") != -1) return 30; //NAX
+ if(Utils::ustrstr(buffcpy, "ip camera") != -1 && Utils::ustrstr(buffcpy, "check_user.cgi") != -1) return 31; //axis cameras
+ if(Utils::ustrstr(buffcpy, "ws(\"user\");") != -1 && Utils::ustrstr(buffcpy, "src=\"/tool.js") != -1
+ && Utils::ustrstr(buffcpy, "") != -1) return 32; //web ip cam
+ if(Utils::ustrstr(buffcpy, "geovision") != -1
+ && (Utils::ustrstr(buffcpy, "ip camera") != -1
+ || Utils::ustrstr(buffcpy, "ssi.cgi/login.htm") != -1)) return 33; //GEO web ip cam
- if(strstr(buffcpy, "hikvision-webs") != NULL
- || (strstr(buffcpy, "hikvision digital") != NULL && strstr(buffcpy, "dvrdvs-webs") != NULL)
- || (strstr(buffcpy, "lapassword") != NULL && strstr(buffcpy, "lausername") != NULL && strstr(buffcpy, "dologin()") != NULL)) return 34; //hikvision cam
- if((strstr(buffcpy, "easy cam") != NULL && strstr(buffcpy, "easy life") != NULL)
- || (strstr(buffcpy, "ipcamera") != NULL && strstr(buffcpy, "/tool.js") != NULL)) return 35; //EasyCam
- if(strstr(buffcpy, "/config/cam_portal.cgi") != NULL || strstr(buffcpy, "/config/easy_index.cgi") != NULL) return 36; //Panasonic Cam
- if(strstr(buffcpy, "panasonic") != NULL && strstr(buffcpy, "/view/getuid.cgi") != NULL) return 37; //Panasonic Cam WJ-HD180
- if(strstr(buffcpy, "ipcam client") != NULL && strstr(buffcpy, "plugins.xpi") != NULL && strstr(buffcpy, "js/upfile.js") != NULL) return 38; //Foscam
- if(strstr(buffcpy, "ip surveillance") != NULL && strstr(buffcpy, "customer login") != NULL) return 39; //EagleEye
- if(strstr(buffcpy, "network camera") != NULL && strstr(buffcpy, "/admin/index.shtml?") != NULL) return 40; //Network Camera VB-C300
- if(strstr(buffcpy, "sq-webcam") != NULL && strstr(buffcpy, "liveview.html") != NULL) return 41; //AVIOSYS-camera
- if(strstr(buffcpy, "nw_camera") != NULL && strstr(buffcpy, "/cgi-bin/getuid") != NULL) return 42; //NW_camera
- if(strstr(buffcpy, "micros") != NULL && strstr(buffcpy, "/gui/gui_outer_frame.shtml") != NULL) return 43; //NW_camera
- if(strstr(buffcpy, "lapassword") != NULL
- && strstr(buffcpy, "lausername") != NULL
- && strstr(buffcpy, "g_ologin.dologin()") != NULL
+ if(Utils::ustrstr(buffcpy, "hikvision-webs") != -1
+ || (Utils::ustrstr(buffcpy, "hikvision digital") != -1 && Utils::ustrstr(buffcpy, "dvrdvs-webs") != -1)
+ || (Utils::ustrstr(buffcpy, "lapassword") != -1 && Utils::ustrstr(buffcpy, "lausername") != -1 && Utils::ustrstr(buffcpy, "dologin()") != -1)) return 34; //hikvision cam
+ if((Utils::ustrstr(buffcpy, "easy cam") != -1 && Utils::ustrstr(buffcpy, "easy life") != -1)
+ || (Utils::ustrstr(buffcpy, "ipcamera") != -1 && Utils::ustrstr(buffcpy, "/tool.js") != -1)) return 35; //EasyCam
+ if(Utils::ustrstr(buffcpy, "/config/cam_portal.cgi") != -1 || Utils::ustrstr(buffcpy, "/config/easy_index.cgi") != -1) return 36; //Panasonic Cam
+ if(Utils::ustrstr(buffcpy, "panasonic") != -1 && Utils::ustrstr(buffcpy, "/view/getuid.cgi") != -1) return 37; //Panasonic Cam WJ-HD180
+ if(Utils::ustrstr(buffcpy, "ipcam client") != -1 && Utils::ustrstr(buffcpy, "plugins.xpi") != -1 && Utils::ustrstr(buffcpy, "js/upfile.js") != -1) return 38; //Foscam
+ if(Utils::ustrstr(buffcpy, "ip surveillance") != -1 && Utils::ustrstr(buffcpy, "customer login") != -1) return 39; //EagleEye
+ if(Utils::ustrstr(buffcpy, "network camera") != -1 && Utils::ustrstr(buffcpy, "/admin/index.shtml?") != -1) return 40; //Network Camera VB-C300
+ if(Utils::ustrstr(buffcpy, "sq-webcam") != -1 && Utils::ustrstr(buffcpy, "liveview.html") != -1) return 41; //AVIOSYS-camera
+ if(Utils::ustrstr(buffcpy, "nw_camera") != -1 && Utils::ustrstr(buffcpy, "/cgi-bin/getuid") != -1) return 42; //NW_camera
+ if(Utils::ustrstr(buffcpy, "micros") != -1 && Utils::ustrstr(buffcpy, "/gui/gui_outer_frame.shtml") != -1) return 43; //NW_camera
+ if(Utils::ustrstr(buffcpy, "lapassword") != -1
+ && Utils::ustrstr(buffcpy, "lausername") != -1
+ && Utils::ustrstr(buffcpy, "g_ologin.dologin()") != -1
) return 44; //hikvision cam 2
- if(strstr(buffcpy, "panasonic") != NULL && strstr(buffcpy, "/config/index.cgi") != NULL) return 45; //Panasonic Cam BB-HG???
- if(strstr(buffcpy, "/ui/") != NULL && strstr(buffcpy, "sencha-touch") != NULL) return 46; //BUFFALO disk
- if(strstr(buffcpy, "digital video server") != NULL && strstr(buffcpy, "gui.css") != NULL) return 47; //Digital Video Server
- if(strstr(buffcpy, "/ipcamerasetup.zip") != NULL && strstr(buffcpy, "download player") != NULL
- && strstr(buffcpy, "ipcam") != NULL) return 48; //ipCam
- if(strstr(buffcpy, "dvr") != NULL && strstr(buffcpy, "ieorforefox") != NULL
- && strstr(buffcpy, "sofari") != NULL) return 49; //IEORFOREFOX
- if (strstr(buffcpy, "seyeon") != NULL && (strstr(buffcpy, "/app/multi/single.asp") != NULL
- || strstr(buffcpy, "/app/live/sim/single.asp") != NULL)) return 50; //Network Video System
+ if(Utils::ustrstr(buffcpy, "panasonic") != -1 && Utils::ustrstr(buffcpy, "/config/index.cgi") != -1) return 45; //Panasonic Cam BB-HG???
+ if(Utils::ustrstr(buffcpy, "/ui/") != -1 && Utils::ustrstr(buffcpy, "sencha-touch") != -1) return 46; //BUFFALO disk
+ if(Utils::ustrstr(buffcpy, "digital video server") != -1 && Utils::ustrstr(buffcpy, "gui.css") != -1) return 47; //Digital Video Server
+ if(Utils::ustrstr(buffcpy, "/ipcamerasetup.zip") != -1 && Utils::ustrstr(buffcpy, "download player") != -1
+ && Utils::ustrstr(buffcpy, "ipcam") != -1) return 48; //ipCam
+ if(Utils::ustrstr(buffcpy, "dvr") != -1 && Utils::ustrstr(buffcpy, "ieorforefox") != -1
+ && Utils::ustrstr(buffcpy, "sofari") != -1) return 49; //IEORFOREFOX
+ if (Utils::ustrstr(buffcpy, "seyeon") != -1 && (Utils::ustrstr(buffcpy, "/app/multi/single.asp") != -1
+ || Utils::ustrstr(buffcpy, "/app/live/sim/single.asp") != -1)) return 50; //Network Video System
- if(((strstr(buffcpy, "220") != NULL) && (port == 21)) ||
- (strstr(buffcpy, "220 diskStation ftp server ready") != NULL) ||
- (strstr(buffcpy, "220 ftp server ready") != NULL)
- || strstr(buffcpy, "500 'get': command not understood") != NULL
+ if(((Utils::ustrstr(buffcpy, "220") != -1) && (port == 21)) ||
+ (Utils::ustrstr(buffcpy, "220 diskStation ftp server ready") != -1) ||
+ (Utils::ustrstr(buffcpy, "220 ftp server ready") != -1)
+ || Utils::ustrstr(buffcpy, "500 'get': command not understood") != -1
) return 16; // 16 - FTP
- if((strstr(buffcpy, "camera web server") != NULL || strstr(buffcpy, "webcamxp 5") != NULL
- || strstr(buffcpy, "ip box camera") != NULL || strstr(buffcpy, "snaff") != NULL
- || strstr(buffcpy, "hfs /") != NULL || strstr(buffcpy, "httpfileserver") != NULL
- || strstr(buffcpy, "network camera") != NULL || strstr(buffcpy, "index of") != NULL
- || strstr(buffcpy, "$lock extended") != NULL || strstr(buffcpy, "ip camera") != NULL
- || strstr(buffcpy, "/viewer/video.jpg") != NULL || strstr(buffcpy, "smart ip device") != NULL
- || strstr(buffcpy, "sanpshot_icon") != NULL || strstr(buffcpy, "snapshot_icon") != NULL
- || strstr(buffcpy, "ipcam") != NULL)
- && strstr(buffcpy, "customer") == NULL
- && strstr(buffcpy, "purchase") == NULL
- && strstr(buffcpy, "contac") == NULL
- && strstr(buffcpy, "company") == NULL
+ if((Utils::ustrstr(buffcpy, "camera web server") != -1 || Utils::ustrstr(buffcpy, "webcamxp 5") != -1
+ || Utils::ustrstr(buffcpy, "ip box camera") != -1 || Utils::ustrstr(buffcpy, "snaff") != -1
+ || Utils::ustrstr(buffcpy, "hfs /") != -1 || Utils::ustrstr(buffcpy, "httpfileserver") != -1
+ || Utils::ustrstr(buffcpy, "network camera") != -1 || Utils::ustrstr(buffcpy, "index of") != -1
+ || Utils::ustrstr(buffcpy, "$lock extended") != -1 || Utils::ustrstr(buffcpy, "ip camera") != -1
+ || Utils::ustrstr(buffcpy, "/viewer/video.jpg") != -1 || Utils::ustrstr(buffcpy, "smart ip device") != -1
+ || Utils::ustrstr(buffcpy, "sanpshot_icon") != -1 || Utils::ustrstr(buffcpy, "snapshot_icon") != -1
+ || Utils::ustrstr(buffcpy, "ipcam") != -1)
+ && Utils::ustrstr(buffcpy, "customer") == -1
+ && Utils::ustrstr(buffcpy, "purchase") == -1
+ && Utils::ustrstr(buffcpy, "contac") == -1
+ && Utils::ustrstr(buffcpy, "company") == -1
) return 0;
- if(globalSearchNeg(buffcpy, ip, port) == -1) return -1;
+ if(globalSearchNeg(buffcpy, ip, port, cp) == -1) return -1;
if(globalSearchPrnt(buffcpy) == -1) return -1;
//if(strstr(buffcpy, "