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!");
} else {
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>");
if(gDebugMode) stt->doEmitionDebugFoundData(QString(buffer.c_str()));
};

View File

@ -2,90 +2,90 @@
#include "SSHAuth.h"
#include "Filter.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
int _pingMyTarget(const char *ip)
{
HANDLE hIcmpFile;
unsigned long ipaddr = INADDR_NONE;
DWORD dwRetVal = 0;
char SendData[32] = "Data Buffer";
LPVOID ReplyBuffer = NULL;
DWORD ReplySize = 0;
ipaddr = inet_addr(ip);
if (ipaddr == INADDR_NONE)
{
stt->doEmitionRedFoundData("[Pinger] INADDR_NONE! [" + QString(ip) + "]");
return 0;
}
hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE)
{
stt->doEmitionRedFoundData("[Pinger] Unable to open handle. [" + QString::number(GetLastError()) + "]");
return 0;
}
ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
ReplyBuffer = (VOID*) malloc(ReplySize);
if (ReplyBuffer == NULL)
{
stt->doEmitionRedFoundData("[Pinger] Unable to allocate memory.");
return 0;
}
dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData),
NULL, ReplyBuffer, ReplySize, gPingTimeout*1000);
if (dwRetVal != 0) {
PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
struct in_addr ReplyAddr;
ReplyAddr.S_un.S_addr = pEchoReply->Address;
printf("\tSent icmp message to %s\n", "127.0.0.1");
if (dwRetVal > 1)
{
if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received " + QString::number(dwRetVal) + " icmp message responses.");
}
else
{
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.");
return 1;
}
else
{
printf("\tCall to IcmpSendEcho failed.\n");
printf("\tIcmpSendEcho returned error: %ld\n", GetLastError() );
if(gDebugMode) stt->doEmitionRedFoundData("[Pinger] Call to IcmpSendEcho failed. IcmpSendEcho returned error: " + QString::number(GetLastError()));
return 0;
};
}
#else
int _pingMyTarget(const 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
//#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
//int _pingMyTarget(const char *ip)
//{
// HANDLE hIcmpFile;
// unsigned long ipaddr = INADDR_NONE;
// DWORD dwRetVal = 0;
// char SendData[32] = "Data Buffer";
// LPVOID ReplyBuffer = NULL;
// DWORD ReplySize = 0;
//
// ipaddr = inet_addr(ip);
//
// if (ipaddr == INADDR_NONE)
// {
// stt->doEmitionRedFoundData("[Pinger] INADDR_NONE! [" + QString(ip) + "]");
// return 0;
// }
//
// hIcmpFile = IcmpCreateFile();
// if (hIcmpFile == INVALID_HANDLE_VALUE)
// {
// stt->doEmitionRedFoundData("[Pinger] Unable to open handle. [" + QString::number(GetLastError()) + "]");
// return 0;
// }
//
// ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
// ReplyBuffer = (VOID*) malloc(ReplySize);
// if (ReplyBuffer == NULL)
// {
// stt->doEmitionRedFoundData("[Pinger] Unable to allocate memory.");
// return 0;
// }
//
// dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData),
// NULL, ReplyBuffer, ReplySize, gPingTimeout*1000);
// if (dwRetVal != 0) {
// PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
// struct in_addr ReplyAddr;
// ReplyAddr.S_un.S_addr = pEchoReply->Address;
// printf("\tSent icmp message to %s\n", "127.0.0.1");
// if (dwRetVal > 1)
// {
// if(gDebugMode) stt->doEmitionYellowFoundData("[Pinger] Received " + QString::number(dwRetVal) + " icmp message responses.");
// }
// else
// {
// 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.");
// return 1;
// }
// else
// {
// printf("\tCall to IcmpSendEcho failed.\n");
// printf("\tIcmpSendEcho returned error: %ld\n", GetLastError() );
// if(gDebugMode) stt->doEmitionRedFoundData("[Pinger] Call to IcmpSendEcho failed. IcmpSendEcho returned error: " + QString::number(GetLastError()));
// return 0;
// };
//}
//#else
//int _pingMyTarget(const 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
struct data {
char trace_ascii; /* 1 or 0 */
@ -419,10 +419,10 @@ bool portCheck(const char * sDVRIP, int wDVRPort) {
}
int Connector::connectToPort(char* ip, int port)
{
if(gPingNScan)
{
if(_pingMyTarget(ip) == 0) return -2;
};
// if(gPingNScan)
// {
// if(_pingMyTarget(ip) == 0) return -2;
// };
std::string buffer;
int size = 0;

View File

@ -42,7 +42,7 @@ const char loginRVIHeaderEnd[8] = {
int recvWT(
int Socket,
SOCKET socket,
char *Buffer,
int Len,
long Timeout,
@ -52,13 +52,13 @@ int recvWT(
int n;
struct timeval Time;
FD_ZERO(&ReadSet);
FD_SET(Socket, &ReadSet);
FD_SET(socket, &ReadSet);
Time.tv_sec = Timeout;
Time.tv_usec = 0;
*bTimedOut = FALSE;
n = select(Socket + 1, &ReadSet, NULL, NULL, &Time);
n = select(socket + 1, &ReadSet, NULL, NULL, &Time);
if (n > 0) { /* got some data */
return recv(Socket, Buffer, Len, 0);
return recv(socket, Buffer, Len, 0);
}
if (n == 0) { /* timeout */
*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 finalIP[32] = { 0 };
bool gPingNScan = false;
std::atomic<int> cons = 0, BrutingThrds = 0, gThreads;
std::vector<int> MainStarter::portVector;
std::atomic<int> cons(0), BrutingThrds(0), gThreads(0);
std::vector<int> MainStarter::portVector(0);
int MainStarter::flCounter = 0;
int MainStarter::gflIndex = 0;
unsigned int **MainStarter::ipsstartfl = NULL;
@ -363,7 +363,7 @@ void MainStarter::saveBackupToFile()
if (strlen(endStr) > 0)
{
sprintf(saveStr, "[SESSION]:%d %s %s %d %s\n",
gMode, endStr, gTLD, gThreads, gPorts);
gMode, endStr, gTLD, int(gThreads), gPorts);
strcat(saveBuffer, saveStr);
//ZeroMemory(saveStr, sizeof(saveStr));
saveStr[0] = 0;
@ -415,7 +415,7 @@ void MainStarter::saveBackupToFile()
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);
//ZeroMemory(saveStr, sizeof(saveStr));
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();
Sleep(200);
threadId = 0;
std::queue<std::string> empty = {};
std::queue<std::string> empty;
std::swap(ipQueue, empty);
ready = false;
}

View File

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

View File

@ -588,12 +588,12 @@ int __checkFileExistence(int flag)
{
char fileName[64] = {0};
if (flag == -22) sprintf(fileName, "./result_files-%s/"TYPE5".html", Utils::getStartDate().c_str());
else if (flag == 0 || flag == 15 || flag == -10) sprintf(fileName, "./result_files-%s/"TYPE1".html", Utils::getStartDate().c_str());
else if (flag == 3) sprintf(fileName, "./result_files-%s/"TYPE2".html", Utils::getStartDate().c_str());
else if (flag == 16) sprintf(fileName, "./result_files-%s/"TYPE4".html", Utils::getStartDate().c_str());
if (flag == -22) sprintf(fileName, "./result_files-%s/" TYPE5 ".html", Utils::getStartDate().c_str());
else if (flag == 0 || flag == 15 || flag == -10) sprintf(fileName, "./result_files-%s/" TYPE1 ".html", Utils::getStartDate().c_str());
else if (flag == 3) sprintf(fileName, "./result_files-%s/" TYPE2 ".html", Utils::getStartDate().c_str());
else if (flag == 16) sprintf(fileName, "./result_files-%s/" TYPE4 ".html", Utils::getStartDate().c_str());
else if(flag >= 17 || flag == 11 || flag == 12
|| flag == 13 || flag == 14 || flag == 1) sprintf(fileName, "./result_files-%s/"TYPE3".html", Utils::getStartDate().c_str());
|| flag == 13 || flag == 14 || flag == 1) sprintf(fileName, "./result_files-%s/" TYPE3 ".html", Utils::getStartDate().c_str());
FILE *f = fopen(fileName, "r");
if(f == NULL) return true;
@ -608,7 +608,7 @@ bool ftsOther = true;
bool ftsSSH = true;
bool ftsFTP = true;
bool ftsBA = true;
std::atomic<bool> fOpened = false;
std::atomic<bool> fOpened(false);
void fputsf(char *text, int flag, char *msg)
{
FILE *file = NULL;
@ -618,25 +618,25 @@ void fputsf(char *text, int flag, char *msg)
if(flag == 0 || flag == 15 || flag == -10)
{
if (ftsCameras) ftsCameras = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/"TYPE1".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/" TYPE1 ".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag == 1)
{
if(ftsOther) ftsOther = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/"TYPE2".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/" TYPE2 ".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag == -22)
{
if(ftsSSH) ftsSSH = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/"TYPE5".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/" TYPE5 ".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag == 3)
{
if(ftsFTP) ftsFTP = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/"TYPE4".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/" TYPE4 ".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag >= 17 || flag == 11 || flag == 12
@ -644,7 +644,7 @@ void fputsf(char *text, int flag, char *msg)
)
{
if(ftsBA) ftsBA = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/"TYPE3".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/" TYPE3 ".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else stt->doEmitionRedFoundData("Unknown flag [FLAG: " + QString::number(flag) + "]");
@ -702,7 +702,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsCameras = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE1"</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE1 "</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
@ -712,7 +712,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsOther = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE2"</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE2 "</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
@ -722,7 +722,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsOther = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE5"</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE5 "</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
@ -732,7 +732,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsFTP = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE4"</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE4 "</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
@ -742,7 +742,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsBA = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE3"</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE3 "</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
@ -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 PEKO_PIC "<a href='[PEKO]'><img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADkSURBVHjaYvj//z8DEECIQ4cO/QcIIEaoCANcBCCAwCKHDx+GCzMxIAE7OzsGgABiQDLlP4jNwsjICNILVgFiM4AMgqkAYUao6XAzAAIIxQyQamQdIDkmZDNhAMQHYZAcE8wodEUwAPca2EVoACjHCBBAWBWAJGBsFmRJFP/BTED2FnowgRQwoYQbEhvFF8jGo7OZGHAAmIlM6MZj9SauMADRAAGGkgawKcRlMkpII2vEFSXYQgMejsRqxmYIRjDCJNFpZDbBYMYWqrhSHEoYkOoFnKkRm2HorsIajYSiEzn6YAAAuoS1lVGw2nsAAAAASUVORK5CYII='/></a>"
#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,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)
{
@ -819,12 +819,12 @@ void putInFile(int flag, const char *ip, int port, int size, const char *finalst
//Generic camera
if(flag == 0 || flag == 15 || flag == -10)
{
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, "", "", "", cp, TYPE1);
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, "", "", "", cp, TYPE1 );
}
//Other
else if(flag == 1)
{
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, "", "", "", cp, TYPE2);
fillGlobalLogData(ip, port, std::to_string(size).c_str(), finalstr, "", "", "", cp, TYPE2 );
}
//Special camera (Hikk, RVI, Safari, etc)
if(flag != 6 && flag != 5 && flag != 4)
@ -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> rviStop = false;
static std::atomic<bool> hikkaStop(false);
static std::atomic<bool> rviStop(false);
std::string getTitle(const char *str, const int flag) {
const char *ptr1 = NULL, *secondStr = NULL;
char finalstr[512] = { 0 };
@ -2695,7 +2695,8 @@ bool jsRedirectHandler(std::string *buff, char* ip, int port, Lexems *counter) {
return false;
}
std::string &buffcpy = getScriptField(buff);
const std::string &buffcpy_ref = getScriptField(buff);
std::string buffcpy = buffcpy_ref;
int sz = buffcpy.size();
if (sz > 500) return false;
@ -2769,11 +2770,12 @@ std::string getHeader(const std::string *buffcpy, const int flag) {
}
else {
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 (Utils::ustrstr(buffcpy, "redir") != std::string::npos) {
result += "[R]";
result.append("[R]");
};
//result += "[Ξ]";
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);
int nPort = port;
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) {
std::string &newURL = Utils::getStrValue(cam_link_data, "src=\"", "\"");
const std::string &newURL = Utils::getStrValue(cam_link_data, "src=\"", "\"");
if (newURL.size() != 0) {
std::string &newIP = Utils::getStrValue(newURL, "http://", "/");
const std::string &newIP = Utils::getStrValue(newURL, "http://", "/");
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, ':');
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 (" +
QString(newIP.c_str()) + ":" + QString::number(nPort) + ")").toLocal8Bit().data(), flag,

View File

@ -113,11 +113,11 @@ typedef int BOOL;
a{color: gray;text-decoration: underline;} \
a:focus{ outline-style: dashed;outline-width:1px; outline-color: red;}</style>"
#define HTTP_FILE_HEADER "<div id=\"tit\"><a href=\""TYPE1".html\">."TYPE1"</a> \
<a href=\""TYPE2".html\">."TYPE2"</a> \
<a href=\""TYPE3".html\">."TYPE3"</a> \
<a href=\""TYPE4".html\">."TYPE4"</a> \
<a href=\""TYPE5".html\">."TYPE5"</a> \
#define HTTP_FILE_HEADER "<div id=\"tit\"><a href=\"" TYPE1 ".html\">." TYPE1 "</a> \
<a href=\"" TYPE2 ".html\">." TYPE2 "</a> \
<a href=\"" TYPE3 ".html\">." TYPE3 "</a> \
<a href=\"" TYPE4 ".html\">." TYPE4 "</a> \
<a href=\"" TYPE5 ".html\">." TYPE5 "</a> \
</div><br><br>"
#ifndef MAX_ADDR_LEN

View File

@ -28,7 +28,13 @@
#include <string>
#include <sstream>
#include <iomanip>
#include <QtGui/qvalidator.h>
#include <QtWidgets/qtextbrowser.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;
@ -150,72 +156,72 @@ int PekoWidget::m_yPos = 0;
int PekoWidget::m_windowCounter = 0;
int PekoWidget::offset = 0;
int psh_lul(PIP_ADAPTER_INFO zzaza)
{
int chc = 0;
for (int i = 0; i < zzaza->AddressLength; i++) chc += (zzaza->Address[i] << ((i & 1) * 8));
return chc;
}
void hshjNune(int& mac1, int& mac2)
{
IP_ADAPTER_INFO idrigenopho[32];
DWORD dwBufLen = sizeof(idrigenopho);
DWORD dwStatus = GetAdaptersInfo(idrigenopho, &dwBufLen);
if (dwStatus != ERROR_SUCCESS) return;
PIP_ADAPTER_INFO pidrigenopho = idrigenopho;
mac1 = psh_lul(pidrigenopho);
if (pidrigenopho->Next) mac2 = psh_lul(pidrigenopho->Next);
}
int hsh_hsh()
{
DWORD psm = 0;
GetVolumeInformation(L"C:\\", NULL, 0, &psm, NULL, NULL, NULL, 0);
int ypyp = (int)((psm + (psm >> 16)) & 0xFFFF);
return ypyp;
}
const char* fds_gds()
{
static char computerName[1024];
DWORD size = 1024;
GetComputerName((LPWSTR)computerName, &size);
static char cn[1024];
for (int i = 0, j = 0; i < 512; i += 2, ++j) memset(cn + j, computerName[i], 1);
return cn;
}
std::string grgNun() {
DWORD Type;
char value[64] = { 0 };
HKEY hkey;
if (RegOpenKey(HKEY_LOCAL_MACHINE,
TEXT("Software\\ISKOPASI\\nesca3\\jipjip"), &hkey) == ERROR_SUCCESS)
{
DWORD value_length = 256;
RegQueryValueEx(hkey, L"nepnep", 0, &Type, (BYTE*)&value, &value_length);
RegCloseKey(hkey);
}
std::string rNepnep = std::string(value);
return rNepnep;
}
std::string ypypNunu()
{
int fafa1, faf2;
hshjNune(fafa1, faf2);
int d2 = hsh_hsh();
char fds[1024] = { 0 };
strcpy(fds, fds_gds());
const std::string resNunu = std::to_string(fafa1) + "-"
+ std::to_string(d2) + "-" + std::string(fds) + "-"
+ std::string(trcPersKey);
std::ostringstream strNunu;
strNunu << std::setw(2) << std::setfill('0') << std::hex << std::uppercase;
std::copy(resNunu.begin(), resNunu.end(), std::ostream_iterator<unsigned int>(strNunu, ""));
return strNunu.str();
}
//
//int psh_lul(PIP_ADAPTER_INFO zzaza)
//{
// int chc = 0;
// for (int i = 0; i < zzaza->AddressLength; i++) chc += (zzaza->Address[i] << ((i & 1) * 8));
// return chc;
//}
//void hshjNune(int& mac1, int& mac2)
//{
// IP_ADAPTER_INFO idrigenopho[32];
// DWORD dwBufLen = sizeof(idrigenopho);
// DWORD dwStatus = GetAdaptersInfo(idrigenopho, &dwBufLen);
// if (dwStatus != ERROR_SUCCESS) return;
// PIP_ADAPTER_INFO pidrigenopho = idrigenopho;
// mac1 = psh_lul(pidrigenopho);
// if (pidrigenopho->Next) mac2 = psh_lul(pidrigenopho->Next);
//}
//int hsh_hsh()
//{
// DWORD psm = 0;
// GetVolumeInformation("C:\\", NULL, 0, &psm, NULL, NULL, NULL, 0);
// int ypyp = (int)((psm + (psm >> 16)) & 0xFFFF);
// return ypyp;
//}
//const char* fds_gds()
//{
// static char computerName[1024];
// DWORD size = 1024;
// GetComputerName(computerName, &size);
// static char cn[1024];
// for (int i = 0, j = 0; i < 512; i += 2, ++j) memset(cn + j, computerName[i], 1);
// return cn;
//}
//std::string grgNun() {
// DWORD Type;
// char value[64] = { 0 };
// HKEY hkey;
// if (RegOpenKey(HKEY_LOCAL_MACHINE,
// TEXT("Software\\ISKOPASI\\nesca3\\jipjip"), &hkey) == ERROR_SUCCESS)
// {
// DWORD value_length = 256;
// RegQueryValueEx(hkey, "nepnep", 0, &Type, (BYTE*)&value, &value_length);
// RegCloseKey(hkey);
// }
//
// std::string rNepnep = std::string(value);
// return rNepnep;
//}
//std::string ypypNunu()
//{
// int fafa1, faf2;
// hshjNune(fafa1, faf2);
// int d2 = hsh_hsh();
// char fds[1024] = { 0 };
// strcpy(fds, fds_gds());
// const std::string resNunu = std::to_string(fafa1) + "-"
// + std::to_string(d2) + "-" + std::string(fds) + "-"
// + std::string(trcPersKey);
//
// std::ostringstream strNunu;
// strNunu << std::setw(2) << std::setfill('0') << std::hex << std::uppercase;
// std::copy(resNunu.begin(), resNunu.end(), std::ostream_iterator<unsigned int>(strNunu, ""));
// return strNunu.str();
//}
//
//
void _LoadPersInfoToLocalVars(int savedTabIndex) {
//ZeroMemory(trcPersKey, sizeof(trcPersKey));
trcPersKey[0] = 0;
@ -2173,7 +2179,7 @@ QList<QStandardItem *> setRow(QString ip, QString loginPass, QString percentage)
items.append(item3);
return items;
}
std::atomic<bool> isBAModelLocked = false;
std::atomic<bool> isBAModelLocked(false);
int nesca_3::addBARow(QString ip, QString loginPass, QString percentage) {
if (!globalScanFlag) return -1;
if (BALogSwitched) {
@ -3125,7 +3131,7 @@ QString GetColorCode(int mode, QString str)
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
void enableHikvisionSupport(){
HINSTANCE hGetProcIDDLL = LoadLibrary(L".\\HCNetSDK.dll");
HINSTANCE hGetProcIDDLL = LoadLibrary(".\\HCNetSDK.dll");
if (!hGetProcIDDLL) {
HikVis::isInitialized = false;
@ -3195,86 +3201,86 @@ void nesca_3::finishLoading() {
#endif
}
bool nesca_3::CheckPersKeyMain()
{
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) 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);
/*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();
}
}
//bool nesca_3::CheckPersKeyMain()
//{
// 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) 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, "nepnep", 0, REG_BINARY, (BYTE*)"0", 2);
// RegSetValueEx(hkey, "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);
// /*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 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 <QGraphicsScene>
#include <QGraphicsItem>
#include "ui_nesca_3.h"
#include <QSystemTrayIcon>
#include <QtGui/qevent.h>
#include <qthread.h>
@ -21,6 +20,7 @@
#include <QStringListModel.h>
#include <QStandardItemModel.h>
#include <QList.h>
#include <ui_nesca_3.h>
extern Ui::nesca_3Class *ui;
extern bool widgetIsHidden, QOSWait,
@ -43,9 +43,9 @@ public:
~nesca_3();
void ConnectEvrthng();
void ChangeLabelIpRange_Value(QString str);
void ChangeLabelIPS_Value(QString str);
void newListItem(QString str);
// void ChangeLabelIpRange_Value(QString str);
// void ChangeLabelIPS_Value(QString str);
// void newListItem(QString str);
static int addBARow(QString ip, QString loginPass, QString percentage);
public:
@ -81,8 +81,8 @@ protected:
void slotClearLogs();
void slotDrawVoiceGrid(int factor);
void slotDrawTextPlacers();
void CheckPersKey();
bool CheckPersKeyMain();
// void CheckPersKey();
// bool CheckPersKeyMain();
void slotRestoreDefPorts();
void switchToJobMode();
void switchDataFields();

Binary file not shown.

Binary file not shown.