progress output fix

This commit is contained in:
cora48 2015-03-23 11:39:37 +03:00
parent 7a9b19553a
commit fecbd4672f
5 changed files with 24 additions and 27 deletions

View File

@ -179,7 +179,7 @@ int _EstablishSSHConnection(const char* host, int port, std::string *buffer, con
for(int i = 0; i < MaxSSHPass; ++i) for(int i = 0; i < MaxSSHPass; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
strcpy(temp, sshlpLst[i]); strcpy(temp, sshlpLst[i]);
ptr1 = strstr(temp, ":"); ptr1 = strstr(temp, ":");
sz = ptr1 - temp; sz = ptr1 - temp;

View File

@ -62,10 +62,10 @@ lopaStr WFClass::doGetCheck(const char *ip,
for(int i = 0; i < MaxWFLogin; ++i) for(int i = 0; i < MaxWFLogin; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
for(int j = firstCycle; j < MaxWFPass; ++j) for(int j = firstCycle; j < MaxWFPass; ++j)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4; int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4;
@ -105,10 +105,10 @@ lopaStr WFClass::doPostCheck(const char *ip,
for(int i = 0; i < MaxWFLogin; ++i) for(int i = 0; i < MaxWFLogin; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
for(int j = firstCycle; j < MaxWFPass; ++j) for(int j = firstCycle; j < MaxWFPass; ++j)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4; int rSize = strlen(ip) + strlen(actionVal) + strlen(userVal) + strlen(wfLoginLst[i]) + strlen(passVal) + strlen(wfPassLst[j]) + 4;

View File

@ -498,13 +498,13 @@ lopaStr _IPCameraBrute(const char *ip, int port, char *SPEC)
for(int i = 0; i < MaxLogin; i++) for(int i = 0; i < MaxLogin; i++)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
if(strcmp(loginLst[i], " ") == 0) continue; if(strcmp(loginLst[i], " ") == 0) continue;
ZeroMemory(login, sizeof(login)); ZeroMemory(login, sizeof(login));
strcpy(login, loginLst[i]); strcpy(login, loginLst[i]);
for(int j = 0; j < MaxPass; j++) for(int j = 0; j < MaxPass; j++)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
if(strcmp(passLst[j], " ") == 0) continue; if(strcmp(passLst[j], " ") == 0) continue;
ZeroMemory(pass, sizeof(pass)); ZeroMemory(pass, sizeof(pass));

View File

@ -2724,7 +2724,7 @@ void nesca_3::slotShowServerMsg(QString str)
void nesca_3::DNSLine_ValueChanged() void nesca_3::DNSLine_ValueChanged()
{ {
if(globalScanFlag == 0) ui->startScanButton_4->setText("Start"); if(!globalScanFlag) ui->startScanButton_4->setText("Start");
} }
void nesca_3::slotRestoreDefPorts() void nesca_3::slotRestoreDefPorts()

View File

@ -408,7 +408,7 @@ void _tracker() {
while(true) { while(true) {
while(!trackerOK) Sleep(1000); while(!trackerOK) Sleep(1000);
if(globalScanFlag == false && jsonArr->size() == 0) break; if(!globalScanFlag && jsonArr->size() == 0) break;
char rBuffT[250000] = {0}; char rBuffT[250000] = {0};
char *msg = new char[4096]; char *msg = new char[4096];
ZeroMemory(msg, sizeof(*msg)); ZeroMemory(msg, sizeof(*msg));
@ -563,7 +563,7 @@ void _tracker() {
while(true) while(true)
{ {
if(globalScanFlag == false && jsonArr->size() == 0) break; if(!globalScanFlag && jsonArr->size() == 0) break;
if(!trackerOK) { if(!trackerOK) {
Sleep(1000); Sleep(1000);
continue; continue;
@ -797,7 +797,7 @@ void _connect() {
ConInc(); ConInc();
for (int i = 0; i <= overallPorts; ++i) for (int i = 0; i <= overallPorts; ++i)
{ {
if (globalScanFlag == false) break; if (!globalScanFlag) break;
if (Connector::_ConnectToPort(ip, portArr[i], "") == -2) break; if (Connector::_ConnectToPort(ip, portArr[i], "") == -2) break;
}; };
ConDec(); ConDec();
@ -813,8 +813,8 @@ void verboseProgress(long long unsigned int target, const char *ip) {
stt->doEmitionIPRANGE(QString(ip)); stt->doEmitionIPRANGE(QString(ip));
strcpy(currentIP, ip); strcpy(currentIP, ip);
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent); sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers)); stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target); sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f", sprintf(metaPercent, "%.1f",
@ -828,8 +828,8 @@ void verboseProgressDNS(long long unsigned int target, const char *ip, const cha
stt->doEmitionIPRANGE(QString(ip) + QString(TLD)); stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
strcpy(currentIP, ip); strcpy(currentIP, ip);
//sprintf(targetNPers, "%Lu (%.1f%%)", target, percent); sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
//stt->doEmitionTargetsLeft(QString(targetNPers)); stt->doEmitionTargetsLeft(QString(targetNPers));
sprintf(metaTargets, "%Lu", target); sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f", sprintf(metaPercent, "%.1f",
@ -2069,17 +2069,14 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
int szMask = strlen(mask); int szMask = strlen(mask);
int szOffset = startPosition + 2; int szOffset = startPosition + 2;
if(szMask != szOffset) strcpy(maskEnd, strstr(mask, "]") + 1); if(szMask != szOffset) strcpy(maskEnd, strstr(mask, "]") + 1);
else else ZeroMemory(maskEnd, sizeof(maskEnd));;
{
ZeroMemory(maskEnd, sizeof(maskEnd));
};
char maskSaver[128] = {0}; char maskSaver[128] = {0};
if(firstPos != -1 && secondPos != -1) if(firstPos != -1 && secondPos != -1)
{ {
for(int i = firstPos; i <= secondPos; ++i) for(int i = firstPos; i <= secondPos; ++i)
{ {
if(globalScanFlag == false) break; if(!globalScanFlag) break;
strcpy(maskSaver, saveMask); strcpy(maskSaver, saveMask);
strcat(maskSaver, maskEntry); strcat(maskSaver, maskEntry);
@ -2101,7 +2098,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
strcpy(endIP2, saveMask); strcpy(endIP2, saveMask);
while(cons >= gThreads && globalScanFlag) Sleep(300); while(cons >= gThreads && globalScanFlag) Sleep(300);
if(globalScanFlag == false) return 0; if(!globalScanFlag) return 0;
string res = string(mask); string res = string(mask);
verboseProgressDNS(--gTargets, res.c_str(), top_level_domain); verboseProgressDNS(--gTargets, res.c_str(), top_level_domain);
@ -2193,7 +2190,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break; if (!globalScanFlag) break;
unsigned long offset = ip2 - i; unsigned long offset = ip2 - i;
tAddr.s_addr = ntohl(i); tAddr.s_addr = ntohl(i);
@ -2206,7 +2203,7 @@ int startScan(char* args) {
while (ipVec.size() != 0) { while (ipVec.size() != 0) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) goto haters_gonna_hate_IPM; if (!globalScanFlag) goto haters_gonna_hate_IPM;
++indexIP; ++indexIP;
std::string res = ipVec[0]; std::string res = ipVec[0];
@ -2227,7 +2224,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) break; if (!globalScanFlag) break;
std::string res = ""; std::string res = "";
++indexIP; ++indexIP;
@ -2400,7 +2397,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
if (globalScanFlag == false) break; if (!globalScanFlag) break;
unsigned long offset = ip2 - i; unsigned long offset = ip2 - i;
tAddr.s_addr = ntohl(i); tAddr.s_addr = ntohl(i);
@ -2413,7 +2410,7 @@ int startScan(char* args) {
while (ipVec.size() != 0) { while (ipVec.size() != 0) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) goto haters_gonna_hate_IM; if (!globalScanFlag) goto haters_gonna_hate_IM;
++indexIP; ++indexIP;
std::string res = ipVec[0]; std::string res = ipVec[0];
@ -2433,7 +2430,7 @@ int startScan(char* args) {
for (unsigned long i = ip1; i <= ip2; ++i) { for (unsigned long i = ip1; i <= ip2; ++i) {
while (cons >= gThreads && globalScanFlag) Sleep(500); while (cons >= gThreads && globalScanFlag) Sleep(500);
if (globalScanFlag == false) break; if (!globalScanFlag) break;
++indexIP; ++indexIP;