diff --git a/ActivityDrawerTh_HorNet.cpp b/ActivityDrawerTh_HorNet.cpp
index cd7b11e..db19e28 100644
--- a/ActivityDrawerTh_HorNet.cpp
+++ b/ActivityDrawerTh_HorNet.cpp
@@ -4,11 +4,12 @@
void ActivityDrawerTh_HorNet::doEmitDrawActivityLine(QString data)
{
emit adtHN->sDrawActivityLine(data);
-};
+}
+
void ActivityDrawerTh_HorNet::doEmitDrawGrid()
{
emit adtHN->sDrawGrid();
-};
+}
void makeActLine(int val)
{
@@ -18,7 +19,8 @@ void makeActLine(int val)
actLst.pop_front();
actLst.push_back(val);
};
-};
+}
+
void ActivityDrawerTh_HorNet::run()
{
adtHN->doEmitDrawGrid();
@@ -34,4 +36,4 @@ void ActivityDrawerTh_HorNet::run()
Activity = 0;
msleep(130);
};
-};
\ No newline at end of file
+}
diff --git a/CheckKey_Th.cpp b/CheckKey_Th.cpp
index 9ac16bd..6cfd09b 100644
--- a/CheckKey_Th.cpp
+++ b/CheckKey_Th.cpp
@@ -1,4 +1,3 @@
-#pragma once
#include "CheckKey_Th.h"
#include "CheckProxy_Th.h"
#include "STh.h"
@@ -36,6 +35,7 @@ void getSubStr(char *src, char *startStr, char *endStr, char *dest, int szDest)
};
};
}
+
int emitIfOK = -1;
int KeyCheckerMain()
{
@@ -57,11 +57,13 @@ int KeyCheckerMain()
std::string buffer;
Connector::nConnect((std::string(trcSrv) + std::string(trcScr)).c_str(), std::stoi(trcSrvPortLine), &buffer, NULL, &headerVector);
- int hostStringIndex = Utils::ci_find_substr(buffer, std::string("\r\n\r\n"));
+ int hostStringIndex = buffer.find("\r\n\r\n");
if(hostStringIndex != -1) {
- const char *ptr1 = buffer.c_str() + hostStringIndex + 4;
- buffer.clear();
- Connector::nConnect((std::string(ptr1) + std::string("/api/checkaccount?key=") + std::string(trcPersKey)).c_str(),
+
+ int s = buffer.find("http://", hostStringIndex);
+ int e = buffer.find('/', s + 8);
+ std::string url = buffer.substr(s, e - s);
+ 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) {
@@ -72,22 +74,20 @@ int KeyCheckerMain()
return 1;
} else if(Utils::ci_find_substr(buffer, std::string("400 Bad Request")) != -1) {
QString errorDef = 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 checker] -FAIL! [400 Bad Request : " + GetNSErrorDefinition(buffer.c_str(), "notify") + "]");
- return -1;
+ 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) {
- stt->doEmitionYellowFoundData("[Key checker] 503 Backend not responding!");
- return -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 checker] -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()));
- return -1;
};
} else {
- stt->doEmitionRedFoundData("[Key checker] Cannot acquire host string.");
+ stt->doEmitionRedFoundData("[Key check] Cannot acquire host string.");
}
+ return -1;
}
void CheckKey_Th::run()
diff --git a/CheckProxy_Th.cpp b/CheckProxy_Th.cpp
index 403075a..02f10b2 100644
--- a/CheckProxy_Th.cpp
+++ b/CheckProxy_Th.cpp
@@ -80,14 +80,12 @@ void CheckProxyLogic()
)
{
-
chPTh->doEmitChangeRawIRCDataOut(QString::fromLocal8Bit("GET / HTTP/1.1\r\nHost: 2ip.ru\r\n\r\n"));
send(pSock, "GET / HTTP/1.1\r\nHost: 2ip.ru\r\n\r\n", strlen("GET / HTTP/1.1\r\nHost: 2ip.ru\r\n\r\n"), 0);
ZeroMemory(precvBuff, sizeof(precvBuff));
while(recv(pSock, precvBuff, sizeof(precvBuff), 0) > 0)
{
-
chPTh->doEmitChangeRawIRCDataInc(QString::fromLocal8Bit(precvBuff));
@@ -103,8 +101,6 @@ void CheckProxyLogic()
&& strstr(precvBuff, "gateway timeout") == NULL
)
{
-
-
chPTh->doEmitChangeGreenIRCData("[OK] Success! Now using " + QString(ircProxy) + ":" + QString(ircProxyPort) + ".");
proxyEnabledFlag = 1;
diff --git a/Connector.cpp b/Connector.cpp
index b75438e..dcaf0b8 100644
--- a/Connector.cpp
+++ b/Connector.cpp
@@ -226,55 +226,6 @@ struct data {
char trace_ascii; /* 1 or 0 */
};
-static
-void dump(const char *text,
- FILE *stream, unsigned char *ptr, size_t size,
- char nohex)
-{
- size_t i;
- size_t c;
-
- unsigned int width=0x10;
-
- if(nohex)
- /* without the hex output, we can fit more on screen */
- width = 0x40;
-
- fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
- text, (long)size, (long)size);
-
- for(i=0; i=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
- /* check again for 0D0A, to avoid an extra \n if it's at width */
- if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
- i+=(c+3-width);
- break;
- }
- }
- fputc('\n', stream); /* newline */
- }
- fflush(stream);
-}
-
static
int my_trace(CURL *handle, curl_infotype type,
char *data, size_t size,
@@ -285,14 +236,14 @@ int my_trace(CURL *handle, curl_infotype type,
(void)handle; /* prevent compiler warning */
switch (type) {
- case CURLINFO_TEXT:
+ case CURLINFO_HEADER_OUT:
+ if(MapWidgetOpened) stt->doEmitionAddOutData(QString("size"), QString(data));
+ cout<<"Data: "<doEmitionAddOutData(QString("size"), QString(data));
- dump(text, stderr, (unsigned char *)data, size, config->trace_ascii);
return 0;
}
diff --git a/DrawerTh_ME2Scanner.h b/DrawerTh_ME2Scanner.h
index 397d2f8..a2c3c1f 100644
--- a/DrawerTh_ME2Scanner.h
+++ b/DrawerTh_ME2Scanner.h
@@ -10,7 +10,7 @@ class DrawerTh_ME2Scanner : public QThread
Q_OBJECT
public:
- static QList itmList;
+ static QList itmList;
static QVector polyVect;
static void doEmitionAddPolyLine();
diff --git a/DrawerTh_QoSScanner.cpp b/DrawerTh_QoSScanner.cpp
index a67efc4..dfc695c 100644
--- a/DrawerTh_QoSScanner.cpp
+++ b/DrawerTh_QoSScanner.cpp
@@ -1,16 +1,11 @@
-#pragma once
#include "DrawerTh_QoSScanner.h"
#include "STh.h"
#include "externData.h"
-int tMax;
-
void DrawerTh_QoSScanner::run()
{
while(QoSScanFlag)
- {
- tMax = 0;
-
+ {
if(stt->isRunning() == true && widgetIsHidden == false && tray->isVisible() == false && QOSWait == false)
{
lstOfLabels.clear();
@@ -19,15 +14,13 @@ void DrawerTh_QoSScanner::run()
lstOfLabels.append(WF);
lstOfLabels.append(Susp);
lstOfLabels.append(Lowl);
- lstOfLabels.append((int)BA);
+ lstOfLabels.append(BA);
lstOfLabels.append(Overl);
lstOfLabels.append(ssh);
QList lstOfLabelsCopy = lstOfLabels;
- qSort(lstOfLabelsCopy.begin(), lstOfLabelsCopy.end(), qGreater());
- int curVal = lstOfLabelsCopy[0];
- if(curVal > MaxDataVal) MaxDataVal = curVal;
- if(curVal > tMax) tMax = curVal;
+ qSort(lstOfLabelsCopy.begin(), lstOfLabelsCopy.end(), qGreater());
+ if(lstOfLabelsCopy[0] > MaxDataVal) MaxDataVal = lstOfLabelsCopy[0];
dtQoS->doEmitionAddLine();
}
@@ -56,9 +49,9 @@ void DrawerTh_QoSScanner::run()
ssh = 0;
msleep(2000);
};
-};
+}
void DrawerTh_QoSScanner::doEmitionAddLine()
{
emit dtQoS->sAddLine();
-};
\ No newline at end of file
+}
diff --git a/IRCPinger_Th.cpp b/IRCPinger_Th.cpp
index aaec3e0..29fde02 100644
--- a/IRCPinger_Th.cpp
+++ b/IRCPinger_Th.cpp
@@ -1,4 +1,3 @@
-#pragma once
#include "IRCPinger_Th.h"
#include "externData.h"
@@ -28,4 +27,4 @@ void IRCPinger_Th::run()
++globalPinger;
msleep(1000);
};
-};
\ No newline at end of file
+};
diff --git a/Utils.h b/Utils.h
index 647bde6..a0e7297 100644
--- a/Utils.h
+++ b/Utils.h
@@ -11,9 +11,9 @@ struct my_equal {
my_equal( const locale loc ) : loc_(loc) {}
bool operator()(charT ch1, charT ch2) {
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
- return toupper(ch1) == toupper(ch2);
+ return tolower(ch1) == tolower(ch2);
#else
- return toupper(ch1, loc_) == toupper(ch2, loc_);
+ return tolower(ch1, loc_) == tolower(ch2, loc_);
#endif
}
private:
@@ -33,6 +33,17 @@ public:
else return -1;
}
+ template static int ci_find_substr(const T& str1,
+ const char* str2c,
+ const locale& loc = locale()) {
+
+ std::string str2 = std::string(str2c);
+ auto it = std::search(str1.begin(), str1.end(), str2.begin(), str2.end(),
+ my_equal(loc));
+ if(it != str1.end()) return it - str1.begin();
+ else return -1;
+ }
+
char * getProxy();
int getProxyPort();
};
diff --git a/connector_old.cpp b/connector_old.cpp
index 5b403b6..787591a 100644
--- a/connector_old.cpp
+++ b/connector_old.cpp
@@ -224,7 +224,7 @@ void _baSSLWorker(char *ip, char *request, char *rvBuff)
int x = 1;
int xx = 0;
- ZeroMemory(rvBuff, sizeof(rvBuff));
+ ZeroMemory(rvBuff, sizeof(*rvBuff));
while(xx < 512)
{
x = SSL_read(ssl, tempBuff, sizeof(tempBuff));
diff --git a/externData.h b/externData.h
index 23945fd..a696a3f 100644
--- a/externData.h
+++ b/externData.h
@@ -17,9 +17,9 @@
extern QJsonArray *jsonArr;
-extern unsigned long long gTargetsOverall, Activity;
+extern unsigned long long gTargetsOverall;
extern char top_level_domain[128];
-extern volatile int BA, cons, BrutingThrds, gThreads;
+extern volatile int cons, BrutingThrds, gThreads;
extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst, **GlobalNegatives;
extern bool trackerOK, __savingBackUpFile, globalScanFlag, MapWidgetOpened,
widgetIsHidden, OnlineMsgSentFlag, utfIRCFlag, HTMLDebugMode, gNegDebugMode,
@@ -32,8 +32,10 @@ extern int found, indexIP, gMode,
gThreadDelay, AnomC1, Filt, Overl, Lowl, Alive, saved,
Susp,
WF,
+ BA,
offlines, ssh, globalPinger, gPingTimeout, nickFlag, offlineFlag;
-extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[32],
+extern unsigned int Activity;
+extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[64],
ircServer[32], ircPort[32], ircProxy[64], ircProxyPort[8], ircNick[32],
trcPort[32], trcSrvPortLine[32], saveStartIP[128], saveEndIP[128],
gRange[128], gFirstDom[128], gPorts[65536], endIP2[128],
diff --git a/finder.cpp b/finder.cpp
index 9e1f868..e5e0fbf 100644
--- a/finder.cpp
+++ b/finder.cpp
@@ -1,5 +1,4 @@
-#pragma once
-#include "STh.h"
+#include "STh.h"
#include "mainResources.h"
#include "externFunctions.h"
#include "externData.h"
@@ -183,13 +182,13 @@ char *GetCodePage(const char *str)
};
}
-int Lexems::globalSearchNeg(const char *buffcpy, char *ip, int port)
+int globalSearchNeg(const char *buffcpy, char *ip, int port)
{
char negWord[256] = {0};
- for(int i = 0; i < GlobalNegativeSize; i++)
+ for(int i = 0; i < GlobalNegativeSize; ++i)
{
- if(globalScanFlag)
- {
+ if(!globalScanFlag) break;
+
strcpy(negWord, GlobalNegatives[i]);
if(strstr(buffcpy, negWord) != NULL)
{
@@ -209,16 +208,18 @@ int Lexems::globalSearchNeg(const char *buffcpy, char *ip, int port)
stt->doEmitionDebugFoundData("Space hit!");
};
};
+
++Filt;
return -1;
};
- };
+
+
ZeroMemory(negWord, 256);
};
- return 0;
+ return -1;
}
-int globalSearchPrnt(char *buffcpy)
+int globalSearchPrnt(const char *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
@@ -237,198 +238,125 @@ int globalSearchPrnt(char *buffcpy)
{
stt->doEmitionDebugFoundData("Printer detected.");
};
+
return -1;
};
+
+ return 0;
+}
+
+int sharedDetector(char * ip, int port, const char *buffcpy) {
+
+ 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(strstr(buffcpy, "digest realm") != NULL && strstr(buffcpy, "basic realm") == NULL) {
+ 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
+ ) 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(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
+ ) 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(((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
+ ) 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, "$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
+ ) return 0;
+
+ if(globalSearchNeg(buffcpy, ip, port) == -1) return -1;
+ if(globalSearchPrnt(buffcpy) == -1) return -1;
+ if(strstr(buffcpy, " 1600
-int _mainFinderSecond(char *buffcpy, int port, char *ip)
+int _mainFinderSecond(const char *buffcpy, int port, char *ip)
{
- 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)
- )
- && strstr(buffcpy, "digest realm") != NULL && strstr(buffcpy, "basic realm") == NULL
- ) return 101;
- 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)
- ) 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
- ) 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
+ int flag = sharedDetector(ip, port, buffcpy);
+ if(flag != -2) return flag;
- 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
- ) 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(((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
- ) 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, "$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
- ) return 0;
-
- if(lxf.globalSearchNeg(buffcpy, ip, port) == -1) return -1;
- if(globalSearchPrnt(buffcpy) == -1) return -1;
- if(strstr(buffcpy, "