CLion commit

This commit is contained in:
cora32 2016-01-06 23:40:43 +03:00
parent aeeb2d6e4b
commit 4bd66721dc
16 changed files with 828 additions and 6789 deletions

131
CMakeLists.txt Normal file
View File

@ -0,0 +1,131 @@
cmake_minimum_required(VERSION 3.3)
project(nesca)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package( Qt5Core REQUIRED )
find_package( Qt5Widgets REQUIRED )
find_package( Qt5Gui REQUIRED )
set(CURL_PATH Z:/curl-7.40.0-devel-mingw64/bin)
#set(SSL_PATH Z:/OpenSSL-Win32/lib)
set(SSH_PATH Z:/libssh_0.6.0/bin)
find_library(libcurl NAMES curl.dll PATHS ${CURL_PATH})
#find_library(libssl NAMES ssl.dll ssleay32.dll libeay32.dll PATHS ${SSL_PATH})
find_library(libssh NAMES ssh.dll PATHS ${SSH_PATH})
include_directories(${PROJECT_SOURCE_DIR})
include_directories("C:/Users/cora32/ClionProjects/nesca")
include_directories("Z:/hikvision_sdk/lib")
include_directories("Z:/libssh_0.6.0/include")
include_directories("Z:/OpenSSL-Win32/include")
include_directories("Z:/curl-7.40.0-devel-mingw64/include")
include_directories("Z:/curl-7.40.0-devel-mingw64/lib64")
include_directories("C:/Users/cora32/.CLion12/system/cmake/generated/22c5278e/22c5278e/Debug")
#add_executable(nesca WIN32 main.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
#get_target_property(QtCore_location Qt5::Core LOCATION)
#qt5_use_modules( nesca Core Widgets Gui )
set(SOURCE_FILES ActivityDrawerTh_HorNet.cpp
ActivityDrawerTh_HorNet.h
base64.cpp
base64.h
BasicAuth.cpp
BasicAuth.h
BruteUtils.cpp
BruteUtils.h
IPRandomizer.h
CheckKey_Th.cpp
IPRandomizer.cpp
CheckKey_Th.h
CMakeLists.txt
Connector.cpp
Connector.h
debugData.txt
DrawerTh_GridQoSScanner.cpp
DrawerTh_GridQoSScanner.h
DrawerTh_HorNet.cpp
DrawerTh_HorNet.h
DrawerTh_ME2Scanner.cpp
DrawerTh_ME2Scanner.h
DrawerTh_QoSScanner.cpp
DrawerTh_QoSScanner.h
DrawerTh_VoiceScanner.cpp
DrawerTh_VoiceScanner.h
Eurostile.ttf
externData.h
externFunctions.h
FileDownloader.cpp
FileDownloader.h
FileUpdater.cpp
FileUpdater.h
finder.cpp
FTPAuth.cpp
FTPAuth.h
HikvisionLogin.cpp
HikvisionLogin.h
IPCAuth.cpp
IPCAuth.h
login.txt
main.cpp
mainResources.h
MainStarter.cpp
MainStarter.h
Makefile
msgcheckerthread.cpp
msgcheckerthread.h
negatives.txt
nesca
nesca.ico
nesca.pro
nesca.pro.user
nesca_3.cpp
nesca_3.h
nesca_3.qrc
nesca_3.rc
nesca_3.ui
pass.txt
piestat.cpp
piestat.h
progressbardrawer.cpp
progressbardrawer.h
README.md
resource.h
small_font.ttf
SSHAuth.cpp
SSHAuth.h
sshpass.txt
STh.cpp
STh.h
Threader.cpp
Threader.h
ui_nesca_3.h~
Utils.cpp
Utils.h
vercheckerthread.cpp
vercheckerthread.h
version
WebformWorker.cpp
WebformWorker.h
wflogin.txt
wfpass.txt)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
if(WIN32)
target_link_libraries(${PROJECT_NAME} wsock32 ws2_32)
else()
target_link_libraries(${PROJECT_NAME} pthread)
endif()
target_link_libraries(${PROJECT_NAME} ${libcurl})
target_link_libraries(${PROJECT_NAME} ${libssh})
#target_link_libraries(${PROJECT_NAME} -LZ:/curl-7.40.0-devel-mingw64/lib64 curl)
target_link_libraries(${PROJECT_NAME} -LZ:/OpenSSL-Win32/lib libeay32 ssleay32)
#target_link_libraries(${PROJECT_NAME} -LZ:/libssh_0.6.0/lib ssh)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)

View File

@ -87,7 +87,7 @@ int KeyCheckerMain()
stt->doEmitionYellowFoundData("[Key check] 503 Backend not responding!"); stt->doEmitionYellowFoundData("[Key check] 503 Backend not responding!");
} else { } else {
char header[64] = {0}; char header[64] = {0};
getSubStrEx(buffer.c_str(), "http/1.1 ", "\r\n", header, 64); getSubStrEx(buffer.c_str(), (char *) "http/1.1 ", (char *) "\r\n", header, 64);
stt->doEmitionRedFoundData("[Key check] FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ") Header: <u>" + QString::fromLocal8Bit(header) + "</u>"); stt->doEmitionRedFoundData("[Key check] FAIL! An error occured. (" + QString::number(WSAGetLastError()) + ") Header: <u>" + QString::fromLocal8Bit(header) + "</u>");
if(gDebugMode) stt->doEmitionDebugFoundData(QString(buffer.c_str())); if(gDebugMode) stt->doEmitionDebugFoundData(QString(buffer.c_str()));
}; };

View File

@ -2,90 +2,90 @@
#include "SSHAuth.h" #include "SSHAuth.h"
#include "Filter.h" #include "Filter.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) //#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
int _pingMyTarget(const char *ip) //int _pingMyTarget(const char *ip)
{ //{
HANDLE hIcmpFile; // HANDLE hIcmpFile;
unsigned long ipaddr = INADDR_NONE; // unsigned long ipaddr = INADDR_NONE;
DWORD dwRetVal = 0; // DWORD dwRetVal = 0;
char SendData[32] = "Data Buffer"; // char SendData[32] = "Data Buffer";
LPVOID ReplyBuffer = NULL; // LPVOID ReplyBuffer = NULL;
DWORD ReplySize = 0; // DWORD ReplySize = 0;
//
ipaddr = inet_addr(ip); // ipaddr = inet_addr(ip);
//
if (ipaddr == INADDR_NONE) // if (ipaddr == INADDR_NONE)
{ // {
stt->doEmitionRedFoundData("[Pinger] INADDR_NONE! [" + QString(ip) + "]"); // stt->doEmitionRedFoundData("[Pinger] INADDR_NONE! [" + QString(ip) + "]");
return 0; // return 0;
} // }
//
hIcmpFile = IcmpCreateFile(); // hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE) // if (hIcmpFile == INVALID_HANDLE_VALUE)
{ // {
stt->doEmitionRedFoundData("[Pinger] Unable to open handle. [" + QString::number(GetLastError()) + "]"); // stt->doEmitionRedFoundData("[Pinger] Unable to open handle. [" + QString::number(GetLastError()) + "]");
return 0; // return 0;
} // }
//
ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData); // ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
ReplyBuffer = (VOID*) malloc(ReplySize); // ReplyBuffer = (VOID*) malloc(ReplySize);
if (ReplyBuffer == NULL) // if (ReplyBuffer == NULL)
{ // {
stt->doEmitionRedFoundData("[Pinger] Unable to allocate memory."); // stt->doEmitionRedFoundData("[Pinger] Unable to allocate memory.");
return 0; // return 0;
} // }
//
dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData), // dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData),
NULL, ReplyBuffer, ReplySize, gPingTimeout*1000); // NULL, ReplyBuffer, ReplySize, gPingTimeout*1000);
if (dwRetVal != 0) { // if (dwRetVal != 0) {
PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer; // PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
struct in_addr ReplyAddr; // struct in_addr ReplyAddr;
ReplyAddr.S_un.S_addr = pEchoReply->Address; // ReplyAddr.S_un.S_addr = pEchoReply->Address;
printf("\tSent icmp message to %s\n", "127.0.0.1"); // printf("\tSent icmp message to %s\n", "127.0.0.1");
if (dwRetVal > 1) // if (dwRetVal > 1)
{ // {
if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received " + QString::number(dwRetVal) + " icmp message responses."); // if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received " + QString::number(dwRetVal) + " icmp message responses.");
} // }
else // else
{ // {
if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received " + QString::number(dwRetVal) + " icmp message responses."); // if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received " + QString::number(dwRetVal) + " icmp message responses.");
} // }
//
if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received from: " + QString(inet_ntoa( ReplyAddr )) + "; Status = " + QString::number(pEchoReply->Status) + "; Roundtrip time = " + QString::number(pEchoReply->RoundTripTime) + "ms."); // if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received from: " + QString(inet_ntoa( ReplyAddr )) + "; Status = " + QString::number(pEchoReply->Status) + "; Roundtrip time = " + QString::number(pEchoReply->RoundTripTime) + "ms.");
return 1; // return 1;
} // }
else // else
{ // {
printf("\tCall to IcmpSendEcho failed.\n"); // printf("\tCall to IcmpSendEcho failed.\n");
printf("\tIcmpSendEcho returned error: %ld\n", GetLastError() ); // printf("\tIcmpSendEcho returned error: %ld\n", GetLastError() );
if(gDebugMode) stt->doEmitionRedFoundData("[Pinger] Call to IcmpSendEcho failed. IcmpSendEcho returned error: " + QString::number(GetLastError())); // if(gDebugMode) stt->doEmitionRedFoundData("[Pinger] Call to IcmpSendEcho failed. IcmpSendEcho returned error: " + QString::number(GetLastError()));
return 0; // return 0;
}; // };
} //}
#else //#else
int _pingMyTarget(const char *ip) //int _pingMyTarget(const char *ip)
{ //{
FILE *pipe = popen(("ping -w " + std::to_string(gPingTimeout) + " " + ip).c_str(), "r"); // FILE *pipe = popen(("ping -w " + std::to_string(gPingTimeout) + " " + ip).c_str(), "r");
if(!pipe) { // if(!pipe) {
stt->doEmitionRedFoundData("Ping pipe failed: cannot open pipe."); // stt->doEmitionRedFoundData("Ping pipe failed: cannot open pipe.");
perror("pipe"); // perror("pipe");
return 0; // return 0;
} // }
//
char buffer[128] = {0}; // char buffer[128] = {0};
std::string result; // std::string result;
//
while(!feof(pipe)) { // while(!feof(pipe)) {
if(fgets(buffer, 128, pipe) != NULL){ // if(fgets(buffer, 128, pipe) != NULL){
result += buffer; // result += buffer;
} // }
} // }
pclose(pipe); // pclose(pipe);
//
if(strstr((char*)result.c_str(), "100% packet loss") != NULL) return 0; // if(strstr((char*)result.c_str(), "100% packet loss") != NULL) return 0;
return 1; // return 1;
} //}
#endif //#endif
struct data { struct data {
char trace_ascii; /* 1 or 0 */ char trace_ascii; /* 1 or 0 */
@ -419,10 +419,10 @@ bool portCheck(const char * sDVRIP, int wDVRPort) {
} }
int Connector::connectToPort(char* ip, int port) int Connector::connectToPort(char* ip, int port)
{ {
if(gPingNScan) // if(gPingNScan)
{ // {
if(_pingMyTarget(ip) == 0) return -2; // if(_pingMyTarget(ip) == 0) return -2;
}; // };
std::string buffer; std::string buffer;
int size = 0; int size = 0;

View File

@ -42,7 +42,7 @@ const char loginRVIHeaderEnd[8] = {
int recvWT( int recvWT(
int Socket, SOCKET socket,
char *Buffer, char *Buffer,
int Len, int Len,
long Timeout, long Timeout,
@ -52,13 +52,13 @@ int recvWT(
int n; int n;
struct timeval Time; struct timeval Time;
FD_ZERO(&ReadSet); FD_ZERO(&ReadSet);
FD_SET(Socket, &ReadSet); FD_SET(socket, &ReadSet);
Time.tv_sec = Timeout; Time.tv_sec = Timeout;
Time.tv_usec = 0; Time.tv_usec = 0;
*bTimedOut = FALSE; *bTimedOut = FALSE;
n = select(Socket + 1, &ReadSet, NULL, NULL, &Time); n = select(socket + 1, &ReadSet, NULL, NULL, &Time);
if (n > 0) { /* got some data */ if (n > 0) { /* got some data */
return recv(Socket, Buffer, Len, 0); return recv(socket, Buffer, Len, 0);
} }
if (n == 0) { /* timeout */ if (n == 0) { /* timeout */
*bTimedOut = TRUE; *bTimedOut = TRUE;

53
IPRandomizer.cpp Normal file
View File

@ -0,0 +1,53 @@
#include "IPRandomizer.h"
IPRandomizer::IPRandomizer(std::vector<IPRangeHolder> ipRangeVec, int shuffleGap)
{
this->ipRangeVec = ipRangeVec;
this->shuffleGap = shuffleGap;
for (int i = 0; i < ipRangeVec.size(); ++i) {
this->shuffleOffset.push_back(0);
}
}
IPRandomizer::~IPRandomizer()
{
this->ipRangeVec.clear();
this->shuffleOffset.clear();
}
void IPRandomizer::shuffleRange() {
for (int i = 0; i < this->ipRangeVec.size(); ++i) {
IPRangeHolder ipRangeHolder = this->ipRangeVec[i];
if (ipRangeHolder.ip1 + this->shuffleOffset[i] >= ipRangeHolder.ip2) {
continue;
}
unsigned int rangeSize = ipRangeHolder.ip2 - (ipRangeHolder.ip1 + this->shuffleOffset[i] - 1);
int offset = (rangeSize < this->shuffleGap ? rangeSize : this->shuffleGap);
for (unsigned int j = this->shuffleOffset[i]; j < this->shuffleOffset[i] + offset; ++j) {
this->shuffledRange.push_back(ipRangeHolder.ip1 + j);
}
this->shuffleOffset[i] += offset;
}
std::random_shuffle(this->shuffledRange.begin(), this->shuffledRange.end());
}
unsigned int IPRandomizer::getNext() {
if (this->shuffledRange.empty()) {
shuffleRange();
//If still empty then ip-range chunk is depleted.
if (this->shuffledRange.empty()) {
return 0;
};
};
unsigned int ip = this->shuffledRange[0];
this->shuffledRange.erase(this->shuffledRange.begin());
return ip;
}

31
IPRandomizer.h Normal file
View File

@ -0,0 +1,31 @@
#pragma once
#ifndef RAND_H
#define RAND_H
#include <vector>
#include <algorithm>
struct IPRangeHolder {
unsigned int ip1;
unsigned int ip2;
};
class IPRandomizer
{
private:
std::vector<IPRangeHolder> ipRangeVec;
std::vector<unsigned int> shuffledRange;
std::vector<unsigned int> shuffleOffset;
int shuffleGap = 20000;
private:
void shuffleRange();
public:
IPRandomizer(std::vector<IPRangeHolder> ipRangeVec, int shuffleGap = 20000);
IPRandomizer(std::vector<IPRangeHolder> ipRangeVec);
~IPRandomizer();
unsigned int getNext();
};
#endif

View File

@ -28,8 +28,8 @@ char gPorts[65536] = { 0 };
char currentIP[MAX_ADDR_LEN] = { 0 }; char currentIP[MAX_ADDR_LEN] = { 0 };
char finalIP[32] = { 0 }; char finalIP[32] = { 0 };
bool gPingNScan = false; bool gPingNScan = false;
std::atomic<int> cons = 0, BrutingThrds = 0, gThreads; std::atomic<int> cons(0), BrutingThrds(0), gThreads(0);
std::vector<int> MainStarter::portVector; std::vector<int> MainStarter::portVector(0);
int MainStarter::flCounter = 0; int MainStarter::flCounter = 0;
int MainStarter::gflIndex = 0; int MainStarter::gflIndex = 0;
unsigned int **MainStarter::ipsstartfl = NULL; unsigned int **MainStarter::ipsstartfl = NULL;
@ -363,7 +363,7 @@ void MainStarter::saveBackupToFile()
if (strlen(endStr) > 0) if (strlen(endStr) > 0)
{ {
sprintf(saveStr, "[SESSION]:%d %s %s %d %s\n", sprintf(saveStr, "[SESSION]:%d %s %s %d %s\n",
gMode, endStr, gTLD, gThreads, gPorts); gMode, endStr, gTLD, int(gThreads), gPorts);
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
//ZeroMemory(saveStr, sizeof(saveStr)); //ZeroMemory(saveStr, sizeof(saveStr));
saveStr[0] = 0; saveStr[0] = 0;
@ -415,7 +415,7 @@ void MainStarter::saveBackupToFile()
else stt->doEmitionRedFoundData("[_saver] Cannot open file."); else stt->doEmitionRedFoundData("[_saver] Cannot open file.");
}; };
sprintf(saveStr, "[SESSION]:%d RESTORE_IMPORT_SESSION %d %s\n", gMode, gThreads, gPorts); sprintf(saveStr, "[SESSION]:%d RESTORE_IMPORT_SESSION %d %s\n", gMode, int(gThreads), gPorts);
strcat(saveBuffer, saveStr); strcat(saveBuffer, saveStr);
//ZeroMemory(saveStr, sizeof(saveStr)); //ZeroMemory(saveStr, sizeof(saveStr));
saveStr[0] = 0; saveStr[0] = 0;

6770
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ void Threader::cleanUp() {
lk.release(); lk.release();
Sleep(200); Sleep(200);
threadId = 0; threadId = 0;
std::queue<std::string> empty = {}; std::queue<std::string> empty;
std::swap(ipQueue, empty); std::swap(ipQueue, empty);
ready = false; ready = false;
} }

View File

@ -4,25 +4,25 @@
std::string Utils::startDate; std::string Utils::startDate;
std::string Utils::startTime; std::string Utils::startTime;
void Utils::emitScaryError() { //void Utils::emitScaryError() {
__asm{ // __asm{
push edx // push edx
push ecx // push ecx
push ebx // push ebx
//
mov eax, 'VMXh' // mov eax, 'VMXh'
mov ebx, 0 // mov ebx, 0
mov ecx, 10 // mov ecx, 10
mov edx, 'VX' // mov edx, 'VX'
//
in eax, dx // in eax, dx
cmp ebx, 'VMXh' // cmp ebx, 'VMXh'
//
pop ebx // pop ebx
pop ecx // pop ecx
pop edx // pop edx
}; // };
} //}
void Utils::saveStartDate() { void Utils::saveStartDate() {

View File

@ -608,7 +608,7 @@ bool ftsOther = true;
bool ftsSSH = true; bool ftsSSH = true;
bool ftsFTP = true; bool ftsFTP = true;
bool ftsBA = true; bool ftsBA = true;
std::atomic<bool> fOpened = false; std::atomic<bool> fOpened(false);
void fputsf(char *text, int flag, char *msg) void fputsf(char *text, int flag, char *msg)
{ {
FILE *file = NULL; FILE *file = NULL;
@ -766,8 +766,8 @@ void fputsf(char *text, int flag, char *msg)
}; };
} }
#define REDIRECT_PIC "<img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAESSURBVHjaYvj//z8DEPxnBBEgFkAAMUJFGBgOHToEYv0HCCAGkAiMA6KZGBjgKhjs7OwYAAKIAWYKCMP0w5WDaBaQUmTABNaHBAACCMUMkDa49VAzWRgZGf/DjDlha8dQxohwBUgO7CyYsTBJZAD3Gkg1uiRQjhEggLAqAEnA2CzIkjC3wPhgE6CuhzvS4jCEDXIXzCS417r+M/xHDymUwAX5Aj3kUEzAhuFRia4T5gawN3GFAYgGCNA3FZgAAIKwiq7vrR4LI3MuTZBAnYpbTQrUszHsiOl8RFxFKeLYc0cGS9E4UeQX844pnrL1Wq0JA6+esQHbBk15y9fclaMVn6aQT9WY8RrRaF8Z1wp4Z5mrLRz17qdV1HtPAAAAAElFTkSuQmCC'/>" #define REDIRECT_PIC "<img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAIAAAB/FOjAAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA7SURBVHjaYmIgEbAA8f///4lUzcjIyILMAxE4lMINZUEWAxE4DIazmcjxA6YxRGkg0ussxJsNAQABBgDDuAwgjmnSVwAAAABJRU5ErkJggg=='/>"
#define PEKO_PIC "<a href='[PEKO]'><img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADkSURBVHjaYvj//z8DEECIQ4cO/QcIIEaoCANcBCCAwCKHDx+GCzMxIAE7OzsGgABiQDLlP4jNwsjICNILVgFiM4AMgqkAYUao6XAzAAIIxQyQamQdIDkmZDNhAMQHYZAcE8wodEUwAPca2EVoACjHCBBAWBWAJGBsFmRJFP/BTED2FnowgRQwoYQbEhvFF8jGo7OZGHAAmIlM6MZj9SauMADRAAGGkgawKcRlMkpII2vEFSXYQgMejsRqxmYIRjDCJNFpZDbBYMYWqrhSHEoYkOoFnKkRm2HorsIajYSiEzn6YAAAuoS1lVGw2nsAAAAASUVORK5CYII='/></a>" #define PEKO_PIC "<a href='[PEKO]'><img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAIAAAB/FOjAAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABASURBVHjaYmAgETAC8Yd1fESqFgj6BNLw//9/Yo1nZGSBsPg/SgHJTwLPiXISSTYQpe4/BIHNZSHJBnIAQIABAEhuFAfSpDW+AAAAAElFTkSuQmCC'/></a>"
void putInFile(int flag, const char *ip, int port, int size, const char *finalstr, char *cp) void putInFile(int flag, const char *ip, int port, int size, const char *finalstr, char *cp)
{ {
@ -2363,8 +2363,8 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
static std::atomic<bool> hikkaStop = false; static std::atomic<bool> hikkaStop(false);
static std::atomic<bool> rviStop = false; static std::atomic<bool> rviStop(false);
std::string getTitle(const char *str, const int flag) { std::string getTitle(const char *str, const int flag) {
const char *ptr1 = NULL, *secondStr = NULL; const char *ptr1 = NULL, *secondStr = NULL;
char finalstr[512] = { 0 }; char finalstr[512] = { 0 };
@ -2695,7 +2695,8 @@ bool jsRedirectHandler(std::string *buff, char* ip, int port, Lexems *counter) {
return false; return false;
} }
std::string &buffcpy = getScriptField(buff); const std::string &buffcpy_ref = getScriptField(buff);
std::string buffcpy = buffcpy_ref;
int sz = buffcpy.size(); int sz = buffcpy.size();
if (sz > 500) return false; if (sz > 500) return false;
@ -2769,11 +2770,12 @@ std::string getHeader(const std::string *buffcpy, const int flag) {
} }
else { else {
std::string tempBuff = buffcpy->c_str(); std::string tempBuff = buffcpy->c_str();
std::string &result = getTitle(tempBuff.c_str(), flag); const std::string &result_ref = getTitle(tempBuff.c_str(), flag);
std::string result = result_ref;
if (result.size() == 0) { if (result.size() == 0) {
if (Utils::ustrstr(buffcpy, "redir") != std::string::npos) { if (Utils::ustrstr(buffcpy, "redir") != std::string::npos) {
result += "[R]"; result.append("[R]");
}; };
//result += "[Ξ]"; //result += "[Ξ]";
result += buffcpy->substr(0, 128); result += buffcpy->substr(0, 128);
@ -3012,17 +3014,19 @@ void parseFlag(int flag, char* ip, int port, int size, const std::string &header
con.nConnect(std::string(std::string(ip) + "/config/cam_portal.cgi").c_str(), port, &buff); con.nConnect(std::string(std::string(ip) + "/config/cam_portal.cgi").c_str(), port, &buff);
int nPort = port; int nPort = port;
for (int i = 0; i < 16; ++i) { for (int i = 0; i < 16; ++i) {
std::string &cam_link_data = Utils::getStrValue(buff, "cam_link[" + std::to_string(i) + "]", ";"); const std::string &cam_link_data = Utils::getStrValue(buff, "cam_link[" + std::to_string(i) + "]", ";");
if (cam_link_data.size() != 0) { if (cam_link_data.size() != 0) {
std::string &newURL = Utils::getStrValue(cam_link_data, "src=\"", "\""); const std::string &newURL = Utils::getStrValue(cam_link_data, "src=\"", "\"");
if (newURL.size() != 0) { if (newURL.size() != 0) {
std::string &newIP = Utils::getStrValue(newURL, "http://", "/"); const std::string &newIP = Utils::getStrValue(newURL, "http://", "/");
if (newIP.size() != 0) { if (newIP.size() != 0) {
std::string &newPath = newURL.substr(newURL.find(newIP) + newIP.length()); const std::string &newPath = newURL.substr(newURL.find(newIP) + newIP.length());
std::vector<std::string> portVec = Utils::splitToStrVector(newIP, ':'); std::vector<std::string> portVec = Utils::splitToStrVector(newIP, ':');
stt->doEmitionYellowFoundData("[PaCr] Url found:" + QString(newURL.c_str())); stt->doEmitionYellowFoundData("[PaCr] Url found:" + QString(newURL.c_str()));
portVec.size() == 2 ? nPort = std::stoi(portVec[1]) : NULL; if(portVec.size() == 2) {
nPort = std::stoi(portVec[1]);
}
_specBrute(newIP.c_str(), nPort, QString("[Panasonic] IP Camera (" + _specBrute(newIP.c_str(), nPort, QString("[Panasonic] IP Camera (" +
QString(newIP.c_str()) + ":" + QString::number(nPort) + ")").toLocal8Bit().data(), flag, QString(newIP.c_str()) + ":" + QString::number(nPort) + ")").toLocal8Bit().data(), flag,

View File

@ -28,7 +28,13 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <QtGui/qvalidator.h>
#include <QtWidgets/qtextbrowser.h>
#include "Utils.h" #include "Utils.h"
#include <QPushButton.h>
#include <QLabel.h>
#include <QtWidgets/qlineedit.h>
#include <QtWidgets/qheaderview.h>
NET_DVR_Init hik_init_ptr = NULL; NET_DVR_Init hik_init_ptr = NULL;
@ -150,72 +156,72 @@ int PekoWidget::m_yPos = 0;
int PekoWidget::m_windowCounter = 0; int PekoWidget::m_windowCounter = 0;
int PekoWidget::offset = 0; int PekoWidget::offset = 0;
//
int psh_lul(PIP_ADAPTER_INFO zzaza) //int psh_lul(PIP_ADAPTER_INFO zzaza)
{ //{
int chc = 0; // int chc = 0;
for (int i = 0; i < zzaza->AddressLength; i++) chc += (zzaza->Address[i] << ((i & 1) * 8)); // for (int i = 0; i < zzaza->AddressLength; i++) chc += (zzaza->Address[i] << ((i & 1) * 8));
return chc; // return chc;
} //}
void hshjNune(int& mac1, int& mac2) //void hshjNune(int& mac1, int& mac2)
{ //{
IP_ADAPTER_INFO idrigenopho[32]; // IP_ADAPTER_INFO idrigenopho[32];
DWORD dwBufLen = sizeof(idrigenopho); // DWORD dwBufLen = sizeof(idrigenopho);
DWORD dwStatus = GetAdaptersInfo(idrigenopho, &dwBufLen); // DWORD dwStatus = GetAdaptersInfo(idrigenopho, &dwBufLen);
if (dwStatus != ERROR_SUCCESS) return; // if (dwStatus != ERROR_SUCCESS) return;
PIP_ADAPTER_INFO pidrigenopho = idrigenopho; // PIP_ADAPTER_INFO pidrigenopho = idrigenopho;
mac1 = psh_lul(pidrigenopho); // mac1 = psh_lul(pidrigenopho);
if (pidrigenopho->Next) mac2 = psh_lul(pidrigenopho->Next); // if (pidrigenopho->Next) mac2 = psh_lul(pidrigenopho->Next);
} //}
int hsh_hsh() //int hsh_hsh()
{ //{
DWORD psm = 0; // DWORD psm = 0;
GetVolumeInformation(L"C:\\", NULL, 0, &psm, NULL, NULL, NULL, 0); // GetVolumeInformation("C:\\", NULL, 0, &psm, NULL, NULL, NULL, 0);
int ypyp = (int)((psm + (psm >> 16)) & 0xFFFF); // int ypyp = (int)((psm + (psm >> 16)) & 0xFFFF);
return ypyp; // return ypyp;
} //}
const char* fds_gds() //const char* fds_gds()
{ //{
static char computerName[1024]; // static char computerName[1024];
DWORD size = 1024; // DWORD size = 1024;
GetComputerName((LPWSTR)computerName, &size); // GetComputerName(computerName, &size);
static char cn[1024]; // static char cn[1024];
for (int i = 0, j = 0; i < 512; i += 2, ++j) memset(cn + j, computerName[i], 1); // for (int i = 0, j = 0; i < 512; i += 2, ++j) memset(cn + j, computerName[i], 1);
return cn; // return cn;
} //}
std::string grgNun() { //std::string grgNun() {
DWORD Type; // DWORD Type;
char value[64] = { 0 }; // char value[64] = { 0 };
HKEY hkey; // HKEY hkey;
if (RegOpenKey(HKEY_LOCAL_MACHINE, // if (RegOpenKey(HKEY_LOCAL_MACHINE,
TEXT("Software\\ISKOPASI\\nesca3\\jipjip"), &hkey) == ERROR_SUCCESS) // TEXT("Software\\ISKOPASI\\nesca3\\jipjip"), &hkey) == ERROR_SUCCESS)
{ // {
DWORD value_length = 256; // DWORD value_length = 256;
RegQueryValueEx(hkey, L"nepnep", 0, &Type, (BYTE*)&value, &value_length); // RegQueryValueEx(hkey, "nepnep", 0, &Type, (BYTE*)&value, &value_length);
RegCloseKey(hkey); // RegCloseKey(hkey);
} // }
//
std::string rNepnep = std::string(value); // std::string rNepnep = std::string(value);
return rNepnep; // return rNepnep;
} //}
std::string ypypNunu() //std::string ypypNunu()
{ //{
int fafa1, faf2; // int fafa1, faf2;
hshjNune(fafa1, faf2); // hshjNune(fafa1, faf2);
int d2 = hsh_hsh(); // int d2 = hsh_hsh();
char fds[1024] = { 0 }; // char fds[1024] = { 0 };
strcpy(fds, fds_gds()); // strcpy(fds, fds_gds());
const std::string resNunu = std::to_string(fafa1) + "-" // const std::string resNunu = std::to_string(fafa1) + "-"
+ std::to_string(d2) + "-" + std::string(fds) + "-" // + std::to_string(d2) + "-" + std::string(fds) + "-"
+ std::string(trcPersKey); // + std::string(trcPersKey);
//
std::ostringstream strNunu; // std::ostringstream strNunu;
strNunu << std::setw(2) << std::setfill('0') << std::hex << std::uppercase; // strNunu << std::setw(2) << std::setfill('0') << std::hex << std::uppercase;
std::copy(resNunu.begin(), resNunu.end(), std::ostream_iterator<unsigned int>(strNunu, "")); // std::copy(resNunu.begin(), resNunu.end(), std::ostream_iterator<unsigned int>(strNunu, ""));
return strNunu.str(); // return strNunu.str();
} //}
//
//
void _LoadPersInfoToLocalVars(int savedTabIndex) { void _LoadPersInfoToLocalVars(int savedTabIndex) {
//ZeroMemory(trcPersKey, sizeof(trcPersKey)); //ZeroMemory(trcPersKey, sizeof(trcPersKey));
trcPersKey[0] = 0; trcPersKey[0] = 0;
@ -2173,7 +2179,7 @@ QList<QStandardItem *> setRow(QString ip, QString loginPass, QString percentage)
items.append(item3); items.append(item3);
return items; return items;
} }
std::atomic<bool> isBAModelLocked = false; std::atomic<bool> isBAModelLocked(false);
int nesca_3::addBARow(QString ip, QString loginPass, QString percentage) { int nesca_3::addBARow(QString ip, QString loginPass, QString percentage) {
if (!globalScanFlag) return -1; if (!globalScanFlag) return -1;
if (BALogSwitched) { if (BALogSwitched) {
@ -3125,7 +3131,7 @@ QString GetColorCode(int mode, QString str)
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
void enableHikvisionSupport(){ void enableHikvisionSupport(){
HINSTANCE hGetProcIDDLL = LoadLibrary(L".\\HCNetSDK.dll"); HINSTANCE hGetProcIDDLL = LoadLibrary(".\\HCNetSDK.dll");
if (!hGetProcIDDLL) { if (!hGetProcIDDLL) {
HikVis::isInitialized = false; HikVis::isInitialized = false;
@ -3195,86 +3201,86 @@ void nesca_3::finishLoading() {
#endif #endif
} }
bool nesca_3::CheckPersKeyMain() //bool nesca_3::CheckPersKeyMain()
{ //{
saveOptions(); // saveOptions();
QString y = QString(QCryptographicHash::hash((ypypNunu().c_str()), QCryptographicHash::Md5).toHex()); // QString y = QString(QCryptographicHash::hash((ypypNunu().c_str()), QCryptographicHash::Md5).toHex());
QString nu(grgNun().c_str()); // QString nu(grgNun().c_str());
if (y.compare(nu) == 0) { // if (y.compare(nu) == 0) {
MainStarter m; // MainStarter m;
m.saveBackupToFile(); // m.saveBackupToFile();
if (!chKTh->isRunning()) // if (!chKTh->isRunning())
{ // {
stt->doEmitionYellowFoundData("[Key check] Starting checker thread..."); // stt->doEmitionYellowFoundData("[Key check] Starting checker thread...");
chKTh->start(); // chKTh->start();
while (CheckKey_Th::isActiveKey == -1) Sleep(10);
if (CheckKey_Th::isActiveKey == 1) return true;
else {
stt->doEmitionYellowFoundData("== Invalid key. ==");
HKEY hkey;
DWORD dwDisposition;
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
TEXT("Software\\ISKOPASI\\nesca3\\jipjip"),
0, NULL, 0,
KEY_WRITE, NULL, &hkey, &dwDisposition) == ERROR_SUCCESS)
{
RegSetValueEx(hkey, L"nepnep", 0, REG_BINARY, (BYTE*)"0", 2);
RegSetValueEx(hkey, L"jipjip", 0, REG_BINARY, (BYTE*)"0", 2);
RegCloseKey(hkey);
}
Sleep(2000);
qApp->quit();
}
}
else stt->doEmitionRedFoundData("Still ckecking your key, please wait...");;
}
else {
stt->doEmitionYellowFoundData("== Invalid key. ==");
Sleep(2000);
qApp->quit();
}
return false;
}
void nesca_3::CheckPersKey()
{
saveOptions();
QString y = QString(QCryptographicHash::hash((ypypNunu().c_str()), QCryptographicHash::Md5).toHex());
QString nu(grgNun().c_str());
if (y.compare(nu) == 0) {
MainStarter m;
m.saveBackupToFile();
if (!chKTh->isRunning())
{
stt->doEmitionYellowFoundData("[Key check] Starting checker thread...");
chKTh->start();
// while (CheckKey_Th::isActiveKey == -1) Sleep(10); // while (CheckKey_Th::isActiveKey == -1) Sleep(10);
/*if (CheckKey_Th::isActiveKey == 1) finishLoading(); // if (CheckKey_Th::isActiveKey == 1) return true;
else { // else {
stt->doEmitionYellowFoundData("== Invalid key. =="); // stt->doEmitionYellowFoundData("== Invalid key. ==");
HKEY hkey; // HKEY hkey;
DWORD dwDisposition; // DWORD dwDisposition;
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, // if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
TEXT("Software\\ISKOPASI\\nesca3\\jipjip"), // TEXT("Software\\ISKOPASI\\nesca3\\jipjip"),
0, NULL, 0, // 0, NULL, 0,
KEY_WRITE, NULL, &hkey, &dwDisposition) == ERROR_SUCCESS) // KEY_WRITE, NULL, &hkey, &dwDisposition) == ERROR_SUCCESS)
{ // {
RegSetValueEx(hkey, L"nepnep", 0, REG_BINARY, (BYTE*)"0", 2); // RegSetValueEx(hkey, "nepnep", 0, REG_BINARY, (BYTE*)"0", 2);
RegSetValueEx(hkey, L"jipjip", 0, REG_BINARY, (BYTE*)"0", 2); // RegSetValueEx(hkey, "jipjip", 0, REG_BINARY, (BYTE*)"0", 2);
RegCloseKey(hkey); // RegCloseKey(hkey);
} // }
Sleep(2000); // Sleep(2000);
qApp->quit(); // qApp->quit();
}*/ // }
} // }
else stt->doEmitionRedFoundData("Still ckecking your key, please wait...");; // else stt->doEmitionRedFoundData("Still ckecking your key, please wait...");;
} // }
else { // else {
stt->doEmitionYellowFoundData("== Invalid key. =="); // stt->doEmitionYellowFoundData("== Invalid key. ==");
Sleep(2000); // Sleep(2000);
qApp->quit(); // qApp->quit();
} // }
} // return false;
//}
//
//void nesca_3::CheckPersKey()
//{
// saveOptions();
// QString y = QString(QCryptographicHash::hash((ypypNunu().c_str()), QCryptographicHash::Md5).toHex());
// QString nu(grgNun().c_str());
// if (y.compare(nu) == 0) {
// MainStarter m;
// m.saveBackupToFile();
// if (!chKTh->isRunning())
// {
// stt->doEmitionYellowFoundData("[Key check] Starting checker thread...");
// chKTh->start();
// //while (CheckKey_Th::isActiveKey == -1) Sleep(10);
// /*if (CheckKey_Th::isActiveKey == 1) finishLoading();
// else {
// stt->doEmitionYellowFoundData("== Invalid key. ==");
// HKEY hkey;
// DWORD dwDisposition;
// if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
// TEXT("Software\\ISKOPASI\\nesca3\\jipjip"),
// 0, NULL, 0,
// KEY_WRITE, NULL, &hkey, &dwDisposition) == ERROR_SUCCESS)
// {
// RegSetValueEx(hkey, L"nepnep", 0, REG_BINARY, (BYTE*)"0", 2);
// RegSetValueEx(hkey, L"jipjip", 0, REG_BINARY, (BYTE*)"0", 2);
// RegCloseKey(hkey);
// }
// Sleep(2000);
// qApp->quit();
// }*/
// }
// else stt->doEmitionRedFoundData("Still ckecking your key, please wait...");;
// }
// else {
// stt->doEmitionYellowFoundData("== Invalid key. ==");
// Sleep(2000);
// qApp->quit();
// }
//}
//#define IRC_CHAN "iskopasi_lab03" //#define IRC_CHAN "iskopasi_lab03"
//#define eicar1 "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" //#define eicar1 "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"

View File

@ -11,7 +11,6 @@
#include <QGraphicsView> #include <QGraphicsView>
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QGraphicsItem> #include <QGraphicsItem>
#include "ui_nesca_3.h"
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QtGui/qevent.h> #include <QtGui/qevent.h>
#include <qthread.h> #include <qthread.h>
@ -21,6 +20,7 @@
#include <QStringListModel.h> #include <QStringListModel.h>
#include <QStandardItemModel.h> #include <QStandardItemModel.h>
#include <QList.h> #include <QList.h>
#include <ui_nesca_3.h>
extern Ui::nesca_3Class *ui; extern Ui::nesca_3Class *ui;
extern bool widgetIsHidden, QOSWait, extern bool widgetIsHidden, QOSWait,
@ -43,9 +43,9 @@ public:
~nesca_3(); ~nesca_3();
void ConnectEvrthng(); void ConnectEvrthng();
void ChangeLabelIpRange_Value(QString str); // void ChangeLabelIpRange_Value(QString str);
void ChangeLabelIPS_Value(QString str); // void ChangeLabelIPS_Value(QString str);
void newListItem(QString str); // void newListItem(QString str);
static int addBARow(QString ip, QString loginPass, QString percentage); static int addBARow(QString ip, QString loginPass, QString percentage);
public: public:
@ -81,8 +81,8 @@ protected:
void slotClearLogs(); void slotClearLogs();
void slotDrawVoiceGrid(int factor); void slotDrawVoiceGrid(int factor);
void slotDrawTextPlacers(); void slotDrawTextPlacers();
void CheckPersKey(); // void CheckPersKey();
bool CheckPersKeyMain(); // bool CheckPersKeyMain();
void slotRestoreDefPorts(); void slotRestoreDefPorts();
void switchToJobMode(); void switchToJobMode();
void switchDataFields(); void switchDataFields();

Binary file not shown.

Binary file not shown.