mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 18:52:19 +00:00
Merge branch 'master' of https://bitbucket.org/cora32/nesca
This commit is contained in:
commit
089b1595aa
131
CMakeLists.txt
Normal file
131
CMakeLists.txt
Normal 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)
|
@ -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()));
|
||||||
};
|
};
|
||||||
|
176
Connector.cpp
176
Connector.cpp
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
38
Utils.cpp
38
Utils.cpp
@ -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() {
|
||||||
|
64
finder.cpp
64
finder.cpp
@ -588,12 +588,12 @@ int __checkFileExistence(int flag)
|
|||||||
{
|
{
|
||||||
char fileName[64] = {0};
|
char fileName[64] = {0};
|
||||||
|
|
||||||
if (flag == -22) sprintf(fileName, "./result_files-%s/"TYPE5".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 == 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 == 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 == 16) sprintf(fileName, "./result_files-%s/" TYPE4 ".html", Utils::getStartDate().c_str());
|
||||||
else if(flag >= 17 || flag == 11 || flag == 12
|
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");
|
FILE *f = fopen(fileName, "r");
|
||||||
if(f == NULL) return true;
|
if(f == NULL) return true;
|
||||||
@ -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;
|
||||||
@ -618,25 +618,25 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
if(flag == 0 || flag == 15 || flag == -10)
|
if(flag == 0 || flag == 15 || flag == -10)
|
||||||
{
|
{
|
||||||
if (ftsCameras) ftsCameras = __checkFileExistence(flag);
|
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");
|
file = fopen(fileName, "a");
|
||||||
}
|
}
|
||||||
else if(flag == 1)
|
else if(flag == 1)
|
||||||
{
|
{
|
||||||
if(ftsOther) ftsOther = __checkFileExistence(flag);
|
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");
|
file = fopen(fileName, "a");
|
||||||
}
|
}
|
||||||
else if(flag == -22)
|
else if(flag == -22)
|
||||||
{
|
{
|
||||||
if(ftsSSH) ftsSSH = __checkFileExistence(flag);
|
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");
|
file = fopen(fileName, "a");
|
||||||
}
|
}
|
||||||
else if(flag == 3)
|
else if(flag == 3)
|
||||||
{
|
{
|
||||||
if(ftsFTP) ftsFTP = __checkFileExistence(flag);
|
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");
|
file = fopen(fileName, "a");
|
||||||
}
|
}
|
||||||
else if(flag >= 17 || flag == 11 || flag == 12
|
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);
|
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");
|
file = fopen(fileName, "a");
|
||||||
}
|
}
|
||||||
else stt->doEmitionRedFoundData("Unknown flag [FLAG: " + QString::number(flag) + "]");
|
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};
|
char tmsg[1024] = {0};
|
||||||
ftsCameras = false;
|
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, msg);
|
||||||
strcat(tmsg, HTTP_FILE_STYLE);
|
strcat(tmsg, HTTP_FILE_STYLE);
|
||||||
fputs (tmsg, file);
|
fputs (tmsg, file);
|
||||||
@ -712,7 +712,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
{
|
{
|
||||||
char tmsg[1024] = {0};
|
char tmsg[1024] = {0};
|
||||||
ftsOther = false;
|
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, msg);
|
||||||
strcat(tmsg, HTTP_FILE_STYLE);
|
strcat(tmsg, HTTP_FILE_STYLE);
|
||||||
fputs (tmsg, file);
|
fputs (tmsg, file);
|
||||||
@ -722,7 +722,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
{
|
{
|
||||||
char tmsg[1024] = {0};
|
char tmsg[1024] = {0};
|
||||||
ftsOther = false;
|
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, msg);
|
||||||
strcat(tmsg, HTTP_FILE_STYLE);
|
strcat(tmsg, HTTP_FILE_STYLE);
|
||||||
fputs (tmsg, file);
|
fputs (tmsg, file);
|
||||||
@ -732,7 +732,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
{
|
{
|
||||||
char tmsg[1024] = {0};
|
char tmsg[1024] = {0};
|
||||||
ftsFTP = false;
|
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, msg);
|
||||||
strcat(tmsg, HTTP_FILE_STYLE);
|
strcat(tmsg, HTTP_FILE_STYLE);
|
||||||
fputs (tmsg, file);
|
fputs (tmsg, file);
|
||||||
@ -742,7 +742,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
{
|
{
|
||||||
char tmsg[1024] = {0};
|
char tmsg[1024] = {0};
|
||||||
ftsBA = false;
|
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, msg);
|
||||||
strcat(tmsg, HTTP_FILE_STYLE);
|
strcat(tmsg, HTTP_FILE_STYLE);
|
||||||
fputs (tmsg, file);
|
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 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)
|
||||||
{
|
{
|
||||||
@ -819,12 +819,12 @@ void putInFile(int flag, const char *ip, int port, int size, const char *finalst
|
|||||||
//Generic camera
|
//Generic camera
|
||||||
if(flag == 0 || flag == 15 || flag == -10)
|
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
|
//Other
|
||||||
else if(flag == 1)
|
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)
|
//Special camera (Hikk, RVI, Safari, etc)
|
||||||
if(flag != 6 && flag != 5 && flag != 4)
|
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> 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,
|
||||||
|
@ -88,11 +88,11 @@ typedef int BOOL;
|
|||||||
|
|
||||||
#define TITLE_MAX_SIZE 512
|
#define TITLE_MAX_SIZE 512
|
||||||
#define COOKIE_MAX_SIZE 1024
|
#define COOKIE_MAX_SIZE 1024
|
||||||
#define TYPE1 "camera"
|
#define TYPE1 "camera"
|
||||||
#define TYPE2 "other"
|
#define TYPE2 "other"
|
||||||
#define TYPE3 "auth"
|
#define TYPE3 "auth"
|
||||||
#define TYPE4 "ftp"
|
#define TYPE4 "ftp"
|
||||||
#define TYPE5 "ssh"
|
#define TYPE5 "ssh"
|
||||||
|
|
||||||
#define PWD_LIST_FOLDER "./pwd_lists/"
|
#define PWD_LIST_FOLDER "./pwd_lists/"
|
||||||
#define LOGIN_FN PWD_LIST_FOLDER"login.txt"
|
#define LOGIN_FN PWD_LIST_FOLDER"login.txt"
|
||||||
@ -113,11 +113,11 @@ typedef int BOOL;
|
|||||||
a{color: gray;text-decoration: underline;} \
|
a{color: gray;text-decoration: underline;} \
|
||||||
a:focus{ outline-style: dashed;outline-width:1px; outline-color: red;}</style>"
|
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> \
|
#define HTTP_FILE_HEADER "<div id=\"tit\"><a href=\"" TYPE1 ".html\">." TYPE1 "</a> \
|
||||||
<a href=\""TYPE2".html\">."TYPE2"</a> \
|
<a href=\"" TYPE2 ".html\">." TYPE2 "</a> \
|
||||||
<a href=\""TYPE3".html\">."TYPE3"</a> \
|
<a href=\"" TYPE3 ".html\">." TYPE3 "</a> \
|
||||||
<a href=\""TYPE4".html\">."TYPE4"</a> \
|
<a href=\"" TYPE4 ".html\">." TYPE4 "</a> \
|
||||||
<a href=\""TYPE5".html\">."TYPE5"</a> \
|
<a href=\"" TYPE5 ".html\">." TYPE5 "</a> \
|
||||||
</div><br><br>"
|
</div><br><br>"
|
||||||
|
|
||||||
#ifndef MAX_ADDR_LEN
|
#ifndef MAX_ADDR_LEN
|
||||||
|
302
nesca_3.cpp
302
nesca_3.cpp
@ -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);
|
// while (CheckKey_Th::isActiveKey == -1) Sleep(10);
|
||||||
if (CheckKey_Th::isActiveKey == 1) return true;
|
// 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;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
void nesca_3::CheckPersKey()
|
//void nesca_3::CheckPersKey()
|
||||||
{
|
//{
|
||||||
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);
|
// //while (CheckKey_Th::isActiveKey == -1) Sleep(10);
|
||||||
/*if (CheckKey_Th::isActiveKey == 1) finishLoading();
|
// /*if (CheckKey_Th::isActiveKey == 1) finishLoading();
|
||||||
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, L"nepnep", 0, REG_BINARY, (BYTE*)"0", 2);
|
||||||
RegSetValueEx(hkey, L"jipjip", 0, REG_BINARY, (BYTE*)"0", 2);
|
// RegSetValueEx(hkey, L"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();
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
//#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*"
|
||||||
|
12
nesca_3.h
12
nesca_3.h
@ -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();
|
||||||
|
BIN
nesca_3.rc
BIN
nesca_3.rc
Binary file not shown.
BIN
resource.h
BIN
resource.h
Binary file not shown.
Loading…
Reference in New Issue
Block a user