From 478510e20a7896fe5708212f2e341f9eeac6a75c Mon Sep 17 00:00:00 2001 From: cora32 Date: Mon, 23 Mar 2015 19:32:33 +0300 Subject: [PATCH 1/6] -- --- Connector.cpp | 2 +- DrawerTh_ME2Scanner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Connector.cpp b/Connector.cpp index b624985..54172fb 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -329,7 +329,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, QString(ip) + ":" + QString::number(port)); return -2; } else if (res == 8) { - stt->doEmitionFoundData("Strange ftp repl. (" + + stt->doEmitionFoundData("Strange ftp reply. (" + QString::number(res) + ") " + QString(ip) + ":" + QString::number(port)); return -2; diff --git a/DrawerTh_ME2Scanner.cpp b/DrawerTh_ME2Scanner.cpp index a6b92cd..04e028c 100644 --- a/DrawerTh_ME2Scanner.cpp +++ b/DrawerTh_ME2Scanner.cpp @@ -109,7 +109,7 @@ int MakePolygonLine(int gWidth) if(Alive > 0) { - if(xtx < 261 ) fact7+=1; + if(xtx < 254 ) fact7+=1; else fact7-=1; }; }; From 69d73e076adab0abb175d7fb858833c250949a0a Mon Sep 17 00:00:00 2001 From: cora32 Date: Mon, 23 Mar 2015 20:11:00 +0300 Subject: [PATCH 2/6] -- --- BasicAuth.h | 3 +-- BruteUtils.h | 2 ++ CheckKey_Th.h | 2 +- Connector.cpp | 3 ++- Connector.h | 12 +++--------- FTPAuth.h | 3 +-- SSHAuth.h | 3 +-- nesca_startModule.cpp | 8 ++++---- 8 files changed, 15 insertions(+), 21 deletions(-) diff --git a/BasicAuth.h b/BasicAuth.h index b10eaa5..e78e747 100644 --- a/BasicAuth.h +++ b/BasicAuth.h @@ -1,9 +1,8 @@ #ifndef BASICAUTH_H #define BASICAUTH_H -#include "Connector.h" -#include "BruteUtils.h" #include "Utils.h" +#include "Connector.h" #include "externData.h" #include "mainResources.h" diff --git a/BruteUtils.h b/BruteUtils.h index 1580076..56c810c 100644 --- a/BruteUtils.h +++ b/BruteUtils.h @@ -1,6 +1,8 @@ #ifndef BRUTEUTILS_H #define BRUTEUTILS_H +#include "externData.h" + class BruteUtils { public: diff --git a/CheckKey_Th.h b/CheckKey_Th.h index d150d4a..e7fe606 100644 --- a/CheckKey_Th.h +++ b/CheckKey_Th.h @@ -1,8 +1,8 @@ #ifndef CHECKKEY_TH_H #define CHECKKEY_TH_H -#pragma once #include "STh.h" + extern int emitIfOK; class CheckKey_Th : public QThread { diff --git a/Connector.cpp b/Connector.cpp index 465a79c..9547b65 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -1,4 +1,5 @@ #include "Connector.h" +#include "SSHAuth.h" #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) int _pingMyTarget(const char *ip) @@ -227,7 +228,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, return buffer->size(); } -int Connector::_ConnectToPort(string ip, int port, char *hl) +int Connector::_ConnectToPort(std::string ip, int port, char *hl) { if(gPingNScan) { diff --git a/Connector.h b/Connector.h index 2ea66fd..2be5089 100644 --- a/Connector.h +++ b/Connector.h @@ -1,11 +1,8 @@ #ifndef CONNECTOR_H #define CONNECTOR_H -#include "externData.h" -#include "Utils.h" -#include "BruteUtils.h" -#include "SSHAuth.h" #include "STh.h" +#include "BruteUtils.h" #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #include @@ -13,16 +10,13 @@ #pragma comment(lib, "iphlpapi.lib") #pragma comment(lib,"curllib.lib") #endif -#include "mainResources.h" - class Connector { public: static int nConnect(const char* ip, const int port, std::string *buffer, const char *postData = NULL, const std::vector *customHeaders = NULL, - const string *lpString = NULL); - static int _ConnectToPort(string ip, int port, char *hl); - static int _SSHLobby(std::string ip, int port, std::string *buffer); + const std::string *lpString = NULL); + static int _ConnectToPort(std::string ip, int port, char *hl); }; #endif // CONNECTOR_H diff --git a/FTPAuth.h b/FTPAuth.h index f35e7d0..9b97b98 100644 --- a/FTPAuth.h +++ b/FTPAuth.h @@ -1,9 +1,8 @@ #ifndef FTPAUTH_H #define FTPAUTH_H -#include "Connector.h" -#include "BruteUtils.h" #include "Utils.h" +#include "Connector.h" #include "externData.h" #include "mainResources.h" diff --git a/SSHAuth.h b/SSHAuth.h index e454a24..b069ea1 100644 --- a/SSHAuth.h +++ b/SSHAuth.h @@ -1,9 +1,8 @@ #ifndef SSHAUTH_H #define SSHAUTH_H -#include "Connector.h" -#include "BruteUtils.h" #include "Utils.h" +#include "Connector.h" #include "externData.h" #include "mainResources.h" diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index 7009697..5c9b749 100644 --- a/nesca_startModule.cpp +++ b/nesca_startModule.cpp @@ -751,7 +751,7 @@ std::string toLowerStr(const char *str) } void _connect() { - string ip = ""; + std::string ip = ""; while (globalScanFlag) { std::unique_lock lk(Threader::m); Threader::cv.wait(lk, []{return Threader::ready; }); @@ -2065,7 +2065,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) { if(!globalScanFlag) return 0; verboseProgressDNS(--gTargets, mask, top_level_domain, saveMask); - string res = string(mask) + string(top_level_domain); + std::string res = std::string(mask) + std::string(top_level_domain); ++indexIP; @@ -2193,7 +2193,7 @@ int startScan(char* args) { ++indexIP; tAddr.s_addr = ntohl(i); - res = string(inet_ntoa(tAddr)); + res = std::string(inet_ntoa(tAddr)); verboseProgress(gTargets--, res.c_str()); Threader::fireThread(res, (void*(*)(void))_connect); @@ -2398,7 +2398,7 @@ int startScan(char* args) { ++indexIP; tAddr.s_addr = ntohl(i); - std::string res = string(inet_ntoa(tAddr)); + std::string res = std::string(inet_ntoa(tAddr)); verboseProgress(gTargets--, res.c_str()); Threader::fireThread(res, (void*(*)(void))_connect); } From 65dbbfb0396c6e9933204b8368984af6899afa3c Mon Sep 17 00:00:00 2001 From: cora32 Date: Mon, 23 Mar 2015 20:47:48 +0300 Subject: [PATCH 3/6] Typo fix. --- BasicAuth.cpp | 2 +- nesca_startModule.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BasicAuth.cpp b/BasicAuth.cpp index 5c368ed..d0b44ce 100644 --- a/BasicAuth.cpp +++ b/BasicAuth.cpp @@ -54,7 +54,7 @@ lopaStr BA::BABrute(const char *ip, const int port) { return lps; }; - if (BALogSwitched) stt->doEmitionBAData("FTP: " + QString(ip) + ":" + QString::number(port) + + if (BALogSwitched) stt->doEmitionBAData("BA: " + QString(ip) + ":" + QString::number(port) + "; l/p: " + QString(loginLst[i]) + ":" + QString(passLst[j]) + "; - Progress: (" + QString::number((++passCounter / (double)(MaxPass*MaxLogin)) * 100).mid(0, 4) + "%)"); diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index 5c9b749..5cc3d14 100644 --- a/nesca_startModule.cpp +++ b/nesca_startModule.cpp @@ -781,7 +781,7 @@ void _connect() { } } -inline void progressOutput(long long unsigned int target) { +inline void progressOutput(unsigned long target) { char targetNPers[128] = {0}; float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 0); @@ -792,13 +792,13 @@ inline void progressOutput(long long unsigned int target) { sprintf(metaPercent, "%.1f", percent); } -void verboseProgress(long long unsigned int target, const char *ip) { +void verboseProgress(unsigned long target, const char *ip) { stt->doEmitionIPRANGE(QString(ip)); strcpy(currentIP, ip); progressOutput(target); } -void verboseProgressDNS(long long unsigned int target, const char *ip, const char *TLD, const char *mask) { +void verboseProgressDNS(unsigned long target, const char *ip, const char *TLD, const char *mask) { stt->doEmitionIPRANGE(QString(ip) + QString(TLD)); strcpy(currentIP, mask); From 8b4e8b0a91d8e65513da82cac2f717fb2ae15354 Mon Sep 17 00:00:00 2001 From: cora32 Date: Tue, 24 Mar 2015 00:00:53 +0300 Subject: [PATCH 4/6] Added sshpass checking. --- SSHAuth.cpp | 4 ++++ sshpass.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SSHAuth.cpp b/SSHAuth.cpp index 82b3f63..3398382 100644 --- a/SSHAuth.cpp +++ b/SSHAuth.cpp @@ -94,6 +94,10 @@ int SSHBrute(const char* host, int port, std::string *buffer, const char *banner if(!globalScanFlag) break; strcpy(temp, sshlpLst[i]); ptr1 = strstr(temp, ":"); + if (ptr1 == NULL) { + stt->doEmitionRedFoundData("[SSH]Wrong format: " + QString(temp)); + return -1; + } sz = ptr1 - temp; strncpy(login, temp, sz); strcpy(pass, ptr1 + 1); diff --git a/sshpass.txt b/sshpass.txt index 9589491..6510a24 100644 --- a/sshpass.txt +++ b/sshpass.txt @@ -22,5 +22,5 @@ admin:123123 admin:654321 root:password admin:pasword -test:test root:1qazXSW@ +test:test \ No newline at end of file From cf7dfeb26b3070a620bc64e3da57347249ac6c3c Mon Sep 17 00:00:00 2001 From: cora32 Date: Tue, 24 Mar 2015 00:32:12 +0300 Subject: [PATCH 5/6] Import list-mode saving fix. --- nesca_startModule.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index 5cc3d14..ce66688 100644 --- a/nesca_startModule.cpp +++ b/nesca_startModule.cpp @@ -204,7 +204,13 @@ void _SaveBackupToFile() FILE *savingFile = fopen("tempIPLst.bk", "w"); if (savingFile != NULL) { - for(int tCounter = gC; tCounter < flCounter; ++tCounter) + sprintf(ipRange, "%s-%d.%d.%d.%d\n", + currentIP, + ipsendfl[gC][0], ipsendfl[gC][1], ipsendfl[gC][2], ipsendfl[gC][3]); + fputs(ipRange, savingFile); + + ZeroMemory(ipRange, sizeof(ipRange)); + for(int tCounter = gC + 1; tCounter < flCounter; ++tCounter) { sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n", ipsstartfl[tCounter][0], ipsstartfl[tCounter][1], ipsstartfl[tCounter][2], ipsstartfl[tCounter][3], From 9ef9b5dca72428067d45cda87a83feee524320a2 Mon Sep 17 00:00:00 2001 From: cora32 Date: Tue, 24 Mar 2015 00:49:38 +0300 Subject: [PATCH 6/6] Link clicker fix. --- nesca_3.cpp | 5 +++++ nesca_3.h | 1 + 2 files changed, 6 insertions(+) diff --git a/nesca_3.cpp b/nesca_3.cpp index b3bf5bd..2f32856 100644 --- a/nesca_3.cpp +++ b/nesca_3.cpp @@ -2187,6 +2187,11 @@ void nesca_3::changeNSTrackLabel(bool status) else ui->NSTrackStatusLabel->setStyleSheet("background-color: black; border: 1px solid white;"); } +void nesca_3::onLinkClicked(QUrl link) +{ + QDesktopServices::openUrl(link); +} + void nesca_3::ConnectEvrthng() { connect ( pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate())); diff --git a/nesca_3.h b/nesca_3.h index 1636de3..82ed5c5 100644 --- a/nesca_3.h +++ b/nesca_3.h @@ -61,6 +61,7 @@ protected: QString GetSSLContent(QString str); void SSLConnect(QString str); protected slots: + void onLinkClicked(QUrl); void MaxBrutingThr_ChangeValue(QString str); void ThreadDelay_ChangeValue(QString val); void ChangePingerOK(bool val);