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/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 7b23bb5..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) @@ -194,7 +195,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; @@ -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/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; }; }; 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.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/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_3.cpp b/nesca_3.cpp index fdcbe95..bbd3a79 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); diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index 7009697..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], @@ -751,7 +757,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; }); @@ -781,7 +787,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 +798,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); @@ -2065,7 +2071,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 +2199,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 +2404,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); } 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