Brute-disabling option added

This commit is contained in:
cora48 2015-04-02 15:33:49 +03:00
parent f09e6e28b7
commit 892be9c934
6 changed files with 55 additions and 33 deletions

View File

@ -68,11 +68,17 @@ lopaStr BA::BABrute(const char *ip, const int port) {
} }
lopaStr BA::BALobby(const char *ip, const int port) { lopaStr BA::BALobby(const char *ip, const int port) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); if(gMaxBrutingThreads > 0) {
BruteUtils::BConInc(); while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
const lopaStr &lps = BABrute(ip, port);
BruteUtils::BConDec();
return lps; BruteUtils::BConInc();
const lopaStr &lps = BABrute(ip, port);
BruteUtils::BConDec();
return lps;
} else {
lopaStr lps;
return lps;
}
} }

View File

@ -65,11 +65,16 @@ lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) {
} }
lopaStr FTPA::FTPLobby(const char *ip, const int port, PathStr *ps) { lopaStr FTPA::FTPLobby(const char *ip, const int port, PathStr *ps) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); if(gMaxBrutingThreads > 0) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
BruteUtils::BConInc(); BruteUtils::BConInc();
const lopaStr &lps = FTPBrute(ip, port, ps); const lopaStr &lps = FTPBrute(ip, port, ps);
BruteUtils::BConDec(); BruteUtils::BConDec();
return lps; return lps;
} else {
lopaStr lps;
return lps;
}
} }

View File

@ -171,13 +171,18 @@ QString strIP;
QString strPort; QString strPort;
int SSHAuth::SSHLobby(const char *ip, int port, std::string *buffer) int SSHAuth::SSHLobby(const char *ip, int port, std::string *buffer)
{ {
const char &banner = _get_ssh_banner(ip, port); if(gMaxBrutingThreads > 0) {
if(strlen(&banner) > 0)
{ while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
BruteUtils::BConInc();
int res = SSHBrute(ip, port, buffer, &banner); const char &banner = _get_ssh_banner(ip, port);
BruteUtils::BConDec(); if(strlen(&banner) > 0)
return res; {
}; BruteUtils::BConInc();
return -1; int res = SSHBrute(ip, port, buffer, &banner);
BruteUtils::BConDec();
return res;
};
return -1;
} else return -1;
} }

View File

@ -21,12 +21,13 @@ private:
public: public:
WFClass(){ WFClass(){
if(gMaxBrutingThreads > 0) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700);
while(BrutingThrds >= gMaxBrutingThreads) Sleep(700); ++WF;
BConInc();
++WF; passCounter = 1;
BConInc(); }
passCounter = 1;
} }
~WFClass(){ ~WFClass(){

View File

@ -256,8 +256,8 @@ lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
if(res == 1) if(res == 1)
{ {
strcpy(lps.login, loginLst[i]); strcpy(lps.login, login);
strcpy(lps.pass, passLst[j]); strcpy(lps.pass, pass);
return lps; return lps;
} }
else if(res == -1) else if(res == -1)
@ -275,11 +275,16 @@ lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC) lopaStr _IPCameraBLobby(const char *ip, int port, char *SPEC)
{ {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000); if(gMaxBrutingThreads > 0) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);
BruteUtils::BConInc(); BruteUtils::BConInc();
lopaStr res = _IPCameraBrute(ip, port, SPEC); lopaStr lps = _IPCameraBrute(ip, port, SPEC);
BruteUtils::BConDec(); BruteUtils::BConDec();
return res; return lps;
} else {
lopaStr lps;
return lps;
}
} }

View File

@ -28,7 +28,7 @@ int ipsstart[4], ipsend[4],
overallPorts, flCounter, octet[4]; overallPorts, flCounter, octet[4];
int BA = 0; int BA = 0;
int gPingTimeout = 1; int gPingTimeout = 1;
int gMaxBrutingThreads = 200; int gMaxBrutingThreads = 50;
unsigned int Activity = 0; unsigned int Activity = 0;
unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL; unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL;