mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 18:52:19 +00:00
BA refac
This commit is contained in:
parent
c7a149efeb
commit
ed0be87e60
25
BasicAuth.cpp
Normal file
25
BasicAuth.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include <BasicAuth.h>
|
||||
|
||||
lopaStr BA::_BABrute(char *cookie,
|
||||
char *ip,
|
||||
int port,
|
||||
char *pathT,
|
||||
char *method)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
lopaStr BA::_BALobby(char *cookie,
|
||||
char *ip,
|
||||
int port,
|
||||
char *path,
|
||||
char *method)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700);
|
||||
|
||||
BruteUtils::BConInc();
|
||||
lopaStr res = _BABrute(cookie, ip, port, path, method);
|
||||
BruteUtils::BConDec();
|
||||
|
||||
return res;
|
||||
}
|
22
BasicAuth.h
Normal file
22
BasicAuth.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef BASICAUTH_H
|
||||
#define BASICAUTH_H
|
||||
|
||||
#include <BruteUtils.h>
|
||||
#include <mainResources.h>
|
||||
|
||||
class BA : BruteUtils{
|
||||
private:
|
||||
lopaStr _BABrute(char *cookie,
|
||||
char *ip,
|
||||
int port,
|
||||
char *pathT,
|
||||
char *method);
|
||||
|
||||
lopaStr _BALobby(char *cookie,
|
||||
char *ip,
|
||||
int port,
|
||||
char *path,
|
||||
char *method);
|
||||
};
|
||||
|
||||
#endif // BASICAUTH_H
|
35
BruteUtils.cpp
Normal file
35
BruteUtils.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include <BruteUtils.h>
|
||||
#include "STh.h"
|
||||
#include "externData.h"
|
||||
|
||||
void BruteUtils::BConInc()
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
__asm
|
||||
{
|
||||
lock inc BrutingThrds;
|
||||
};
|
||||
#else
|
||||
asm("lock incl BrutingThrds");
|
||||
#endif
|
||||
|
||||
stt->doEmitionChangeBA(QString::number(BrutingThrds));
|
||||
}
|
||||
|
||||
void BruteUtils::BConDec()
|
||||
{
|
||||
if(BrutingThrds > 0)
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
__asm
|
||||
{
|
||||
lock dec BrutingThrds;
|
||||
};
|
||||
#else
|
||||
asm("lock decl BrutingThrds");
|
||||
#endif
|
||||
}
|
||||
|
||||
stt->doEmitionChangeBA(QString::number(BrutingThrds));
|
||||
|
||||
}
|
11
BruteUtils.h
Normal file
11
BruteUtils.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef BRUTEUTILS_H
|
||||
#define BRUTEUTILS_H
|
||||
|
||||
class BruteUtils {
|
||||
|
||||
public:
|
||||
static void BConInc();
|
||||
static void BConDec();
|
||||
};
|
||||
|
||||
#endif // BRUTEUTILS_H
|
@ -173,7 +173,7 @@ int _EstablishSSHConnection(char *host, int port, std::string *buffer, const cha
|
||||
char pass[32] = {0};
|
||||
char temp[64] = {0};
|
||||
isActive = 1;
|
||||
BConInc();
|
||||
BruteUtils::BConInc();
|
||||
int sz = 0;
|
||||
char *ptr1 = 0;
|
||||
int res = -1;
|
||||
@ -192,19 +192,19 @@ int _EstablishSSHConnection(char *host, int port, std::string *buffer, const cha
|
||||
if(res == 0)
|
||||
{
|
||||
if(i == 0) return -2; //Failhit
|
||||
BConDec();
|
||||
BruteUtils::BConDec();
|
||||
isActive = 0;
|
||||
return 1;
|
||||
}
|
||||
else if(res == -2)
|
||||
{
|
||||
BConDec();
|
||||
BruteUtils::BConDec();
|
||||
isActive = 0;
|
||||
return -2;
|
||||
};
|
||||
Sleep(500);
|
||||
};
|
||||
BConDec();
|
||||
BruteUtils::BConDec();
|
||||
isActive = 0;
|
||||
return -1;
|
||||
}
|
||||
|
@ -2,8 +2,9 @@
|
||||
#define CONNECTOR_H
|
||||
|
||||
#include <externData.h>
|
||||
#include <STh.h>
|
||||
#include <Utils.h>
|
||||
#include <BruteUtils.h>
|
||||
#include "STh.h"
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
#include <iphlpapi.h>
|
||||
|
@ -2,13 +2,13 @@
|
||||
#define WEBFORMWORKER_H
|
||||
|
||||
#include <Utils.h>
|
||||
#include "STh.h"
|
||||
#include "Connector.h"
|
||||
#include <mainResources.h>
|
||||
#include <externData.h>
|
||||
#include <externFunctions.h>
|
||||
#include <BruteUtils.h>
|
||||
#include "STh.h"
|
||||
|
||||
class WFClass {
|
||||
class WFClass : BruteUtils {
|
||||
|
||||
private: static bool active;
|
||||
int passCounter = 1;
|
||||
|
@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include "STh.h"
|
||||
#include "STh.h"
|
||||
#include <libssh/libssh.h>
|
||||
#include <sstream>
|
||||
#include <openssl/md5.h>
|
||||
@ -8,6 +7,7 @@
|
||||
#include "externData.h"
|
||||
#include <openssl/err.h>
|
||||
#include <Utils.h>
|
||||
#include <BruteUtils.h>
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
#include <iphlpapi.h>
|
||||
@ -30,38 +30,6 @@ int _countFTPDirectories(char *recvBuff){
|
||||
return dirCounter;
|
||||
}
|
||||
|
||||
void BConInc()
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
__asm
|
||||
{
|
||||
lock inc BrutingThrds;
|
||||
};
|
||||
#else
|
||||
asm("lock incl BrutingThrds");
|
||||
#endif
|
||||
|
||||
stt->doEmitionChangeBA(QString::number(BrutingThrds));
|
||||
}
|
||||
|
||||
void BConDec()
|
||||
{
|
||||
if(BrutingThrds > 0)
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
__asm
|
||||
{
|
||||
lock dec BrutingThrds;
|
||||
};
|
||||
#else
|
||||
asm("lock decl BrutingThrds");
|
||||
#endif
|
||||
}
|
||||
|
||||
stt->doEmitionChangeBA(QString::number(BrutingThrds));
|
||||
|
||||
}
|
||||
|
||||
bool debugWriteWait = false;
|
||||
void _DebugWriteHTMLToFile(char *request, char *buff)
|
||||
{
|
||||
@ -904,9 +872,9 @@ lopaStr _BALobby(char *cookie, char *ip, int port, char *path, char *method)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700);
|
||||
|
||||
BConInc();
|
||||
BruteUtils::BConInc();
|
||||
lopaStr res = _BABrute(cookie, ip, port, path, method);
|
||||
BConDec();
|
||||
BruteUtils::BConDec();
|
||||
|
||||
return res;
|
||||
}
|
||||
@ -1338,9 +1306,9 @@ lopaStr _FTPLobby(char *ip, int port, PathStr *ps)
|
||||
ZeroMemory(lps.pass, sizeof(lps.pass));
|
||||
ZeroMemory(lps.other, sizeof(lps.other));
|
||||
|
||||
BConInc();
|
||||
BruteUtils::BConInc();
|
||||
lps = _FTPBrute(ip, port, ps);
|
||||
BConDec();
|
||||
BruteUtils::BConDec();
|
||||
|
||||
return lps;
|
||||
}
|
||||
@ -1744,9 +1712,9 @@ lopaStr _IPCameraBLobby(char *ip, int port, char *SPEC)
|
||||
{
|
||||
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
|
||||
|
||||
BConInc();
|
||||
BruteUtils::BConInc();
|
||||
lopaStr res = _IPCameraBrute(ip, port, SPEC);
|
||||
BConDec();
|
||||
BruteUtils::BConDec();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -40,7 +40,9 @@ SOURCES +=\
|
||||
WebformWorker.cpp \
|
||||
Connector.cpp \
|
||||
connector_old.cpp \
|
||||
Utils.cpp
|
||||
Utils.cpp \
|
||||
BruteUtils.cpp \
|
||||
BasicAuth.cpp
|
||||
|
||||
|
||||
HEADERS += ActivityDrawerTh_HorNet.h \
|
||||
@ -67,7 +69,9 @@ HEADERS += ActivityDrawerTh_HorNet.h \
|
||||
vercheckerthread.h \
|
||||
Utils.h \
|
||||
WebformWorker.h \
|
||||
Connector.h
|
||||
Connector.h \
|
||||
BasicAuth.h \
|
||||
BruteUtils.h
|
||||
|
||||
FORMS += nesca_3.ui
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user