diff --git a/BasicAuth.cpp b/BasicAuth.cpp index ff5ae80..73859b5 100644 --- a/BasicAuth.cpp +++ b/BasicAuth.cpp @@ -33,14 +33,12 @@ bool BA::checkOutput(const string *buffer, const char *ip, const int port) { lopaStr BA::BABrute(const char *ip, const int port) { string buffer; string lpString; - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""}; ZeroMemory(lps.login, sizeof(lps.login)); ZeroMemory(lps.pass, sizeof(lps.pass)); ZeroMemory(lps.other, sizeof(lps.other)); int passCounter = 0; - strcpy(lps.login, "UNKNOWN"); - for(int i = 0; i < MaxLogin; ++i) { for (int j = 0; j < MaxPass; ++j) { FileUpdater::cv.wait(FileUpdater::lk, []{return FileUpdater::ready;}); @@ -78,7 +76,7 @@ lopaStr BA::BALobby(const char *ip, const int port) { return lps; } else { - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""}; return lps; } } diff --git a/BruteUtils.cpp b/BruteUtils.cpp index 8ad5d20..f6cf5c9 100644 --- a/BruteUtils.cpp +++ b/BruteUtils.cpp @@ -13,8 +13,7 @@ __asm #else asm("lock incl BrutingThrds"); #endif - - stt->doEmitionChangeBA(QString::number(BrutingThrds)); + stt->doEmitionUpdateArc(gTargets); } void BruteUtils::BConDec() @@ -30,6 +29,5 @@ void BruteUtils::BConDec() asm("lock decl BrutingThrds"); #endif } - - stt->doEmitionChangeBA(QString::number(BrutingThrds)); + stt->doEmitionUpdateArc(gTargets); } diff --git a/Connector.cpp b/Connector.cpp index 9046b79..e4d00d0 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -223,7 +223,6 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, if (MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString("[OVERFLOW]")); return buffer->size(); } else { - stt->doEmitionOffline(QString::number(++offlines)); return -1; } } @@ -255,7 +254,6 @@ int Connector::_ConnectToPort(char* ip, int port) if(size > 0) { ++Alive; - stt->doEmitionChangeParsed(QString::number(saved) + "/" + QString::number(++found)); Lexems lx; lx._filler(port, buffer.c_str(), ip, size, &lx); }; diff --git a/FTPAuth.cpp b/FTPAuth.cpp index 745db33..65f8aca 100644 --- a/FTPAuth.cpp +++ b/FTPAuth.cpp @@ -13,7 +13,7 @@ bool FTPA::checkOutput(const string *buffer) { lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) { string buffer; string lpString; - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""};; ZeroMemory(lps.login, sizeof(lps.login)); ZeroMemory(lps.pass, sizeof(lps.pass)); ZeroMemory(lps.other, sizeof(lps.other)); @@ -74,7 +74,7 @@ lopaStr FTPA::FTPLobby(const char *ip, const int port, PathStr *ps) { return lps; } else { - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""};; return lps; } } diff --git a/IPCAuth.cpp b/IPCAuth.cpp index 29c88c9..e381807 100644 --- a/IPCAuth.cpp +++ b/IPCAuth.cpp @@ -5,7 +5,7 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC) { - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""}; bool result = true; ZeroMemory(lps.login, sizeof(lps.login)); ZeroMemory(lps.pass, sizeof(lps.pass)); @@ -172,7 +172,6 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC) }; }; - strcpy(lps.login, "UNKNOWN"); return lps; } @@ -186,7 +185,7 @@ lopaStr IPC::IPCLobby(const char *ip, int port, char *SPEC) { return lps; } else { - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""}; return lps; } } diff --git a/STh.cpp b/STh.cpp index 076de45..e664604 100644 --- a/STh.cpp +++ b/STh.cpp @@ -3,38 +3,26 @@ void STh::doEmitionShowRedVersion() { emit stt->showRedVersion(); -}; +} void STh::doEmitionStartScanIP() { emit stt->startScanIP(); -}; +} void STh::doEmitionStartScanDNS() { emit stt->startScanDNS(); -}; +} void STh::doEmitionStartScanImport() { emit stt->startScanImport(); -}; +} void STh::doEmitionAddIncData(QString(ip), QString str) { emit stt->sIncData(ip, str); -}; +} void STh::doEmitionAddOutData( QString str) { emit stt->sOutData(str); -}; -void STh::doEmitionIPRANGE(QString str) -{ - emit stt->changeIpRange(str); -} -void STh::doEmitionThreads(QString str) -{ - emit stt->changeThreads(str); -} -void STh::doEmitionIPS(QString str) -{ - emit stt->changeIPS(str); } void STh::doEmitionFoundData(QString str) { @@ -47,7 +35,7 @@ void STh::doEmitionBAData(QString str) void STh::doEmition_BARedData(QString str) { emit stt->changeRedBAData(str); -}; +} void STh::doEmition_BAGreenData(QString str) { emit stt->changeGreenBAData(str); @@ -72,31 +60,20 @@ void STh::doEmitionChangeStatus(QString str) { emit stt->changeStatus(str); } -void STh::doEmitionTargetsLeft(QString str) -{ - emit stt->changeTargetsLeft(str); -} void STh::doEmitionKillSttThread() { emit stt->killSttThread(); -}; -void STh::doEmitionChangeParsed(QString str) -{ - emit stt->changeParsedValue(str); -}; -void STh::doEmitionChangeBA(QString str) -{ - emit stt->changeBAValue(str); -}; -void STh::doEmitionOffline(QString str) -{ - emit stt->changeOffline(str); -}; +} void STh::doEmitionDataSaved(bool status) { - emit stt->signalDataSaved(status); -}; + emit stt->signalDataSaved(status); +} +void STh::doEmitionUpdateArc(unsigned long gTargets) +{ + emit stt->signalUpdateArc(gTargets); +} + void STh::run() { startScan(inputStr); -} \ No newline at end of file +} diff --git a/STh.h b/STh.h index fd6ed2c..61a8499 100644 --- a/STh.h +++ b/STh.h @@ -20,23 +20,17 @@ public: static void doEmitionAddIncData(QString ip, QString str); static void doEmitionAddOutData(QString str); static void doEmition_BAGreenData(QString str); - static void doEmition_BARedData(QString str); - static void doEmitionIPRANGE(QString str); - static void doEmitionThreads(QString str); - static void doEmitionIPS(QString str); + static void doEmition_BARedData(QString str); static void doEmitionFoundData(QString str); static void doEmitionRedFoundData(QString str); static void doEmitionGreenFoundData(QString); static void doEmitionYellowFoundData(QString); - static void doEmitionChangeStatus(QString); - static void doEmitionTargetsLeft(QString); - static void doEmitionKillSttThread(); - static void doEmitionChangeParsed(QString); - static void doEmitionChangeBA(QString); - static void doEmitionOffline(QString); + static void doEmitionChangeStatus(QString); + static void doEmitionKillSttThread(); static void doEmitionBAData(QString str); static void doEmitionDebugFoundData(QString); static void doEmitionShowRedVersion(); + static void doEmitionUpdateArc(unsigned long gTargets); signals: public: signals: void showRedVersion(); @@ -47,22 +41,16 @@ public: signals: void signalDataSaved(bool); public: signals: void changeGreenBAData(QString); public: signals: void changeRedBAData(QString); public: signals: void changeBAData(QString); -public: signals: void changeOffline(QString); -public: signals: void changeBAValue(QString); -public: signals: void changeParsedValue(QString); -public: signals: void changeIpRange(QString); -public: signals: void changeThreads(QString); -public: signals: void changeIPS(QString); public: signals: void changeFoundData(QString); public: signals: void changeRedFoundData(QString); public: signals: void changeGreenFoundData(QString); public: signals: void changeYellowFoundData(QString); public: signals: void changeDebugFoundData(QString); public: signals: void changeStatus(QString); -public: signals: void changeTargetsLeft(QString); public: signals: void killSttThread(); public: signals: void sIncData(QString, QString); public: signals: void sOutData(QString); +public: signals: void signalUpdateArc(unsigned long); protected: void run(); diff --git a/WebformWorker.cpp b/WebformWorker.cpp index d556521..81f4eec 100644 --- a/WebformWorker.cpp +++ b/WebformWorker.cpp @@ -158,12 +158,12 @@ lopaStr WFClass::_WFBrute( const char *ip, char *passVal, char *formVal) { - lopaStr result = {"UNKNOWN", "UNKNOWN", "UNKNOWN"}; + lopaStr lps{"UNKNOWN", "", ""}; if(strstri(methodVal, "get") != NULL) { - result = doGetCheck(ip, port, actionVal, userVal, passVal, formVal); + lps = doGetCheck(ip, port, actionVal, userVal, passVal, formVal); } else if(strstri(methodVal, "post") != NULL) { - result = doPostCheck(ip, port, actionVal, userVal, passVal, formVal); + lps = doPostCheck(ip, port, actionVal, userVal, passVal, formVal); } else { stt->doEmitionFoundData(" - [WF]: Unknown method."); }; - return result; + return lps; } diff --git a/externData.h b/externData.h index 5fe6ff3..0f371e5 100644 --- a/externData.h +++ b/externData.h @@ -21,6 +21,7 @@ extern QJsonArray *jsonArr; extern unsigned long long gTargetsOverall; +extern long long unsigned int gTargets; extern volatile int cons, BrutingThrds, gThreads; extern char **loginLst, **passLst, **wfLoginLst, **wfPassLst, **sshlpLst, **GlobalNegatives; extern bool trackerOK, __savingBackUpFile, globalScanFlag, MapWidgetOpened, diff --git a/finder.cpp b/finder.cpp index 61e6823..e643e19 100644 --- a/finder.cpp +++ b/finder.cpp @@ -1134,16 +1134,16 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa } else { - if(gNegDebugMode) stt->doEmitionFoundData("" + QString(ip) + ":" + QString::number(port) + " - [WF]: Cannot find user/pass field."); - ///fillGlobalLogData(ip, tport, std::to_string(size).c_str(), title, "", "", "UnknownWebform", cp, tclass); - ///putInFile(flag, ip, tport, size, title, cp); + if(gNegDebugMode) stt->doEmitionFoundData("" + QString(ip) + ":" + QString::number(port) + + " - [WF]: Cannot find user/pass field."); }; }; } void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char *comment, char *cp, int size, char *SPEC) { - lopaStr lps; + lopaStr lps{"UNKNOWN", "", ""}; ZeroMemory(lps.login, sizeof(lps.login)); ZeroMemory(lps.pass, sizeof(lps.pass)); ZeroMemory(lps.other, sizeof(lps.other)); diff --git a/nesca.pro b/nesca.pro index 696b724..1e53f5c 100644 --- a/nesca.pro +++ b/nesca.pro @@ -35,7 +35,6 @@ SOURCES +=\ finder.cpp \ WebformWorker.cpp \ Connector.cpp \ - connector_old.cpp \ Utils.cpp \ BruteUtils.cpp \ BasicAuth.cpp \ diff --git a/nesca.pro.user b/nesca.pro.user index 8b7a334..97ae6e7 100644 --- a/nesca.pro.user +++ b/nesca.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/nesca_3.cpp b/nesca_3.cpp index 702c05f..7dac8b0 100644 --- a/nesca_3.cpp +++ b/nesca_3.cpp @@ -146,6 +146,10 @@ QList PhraseLog; bool ME2ScanFlag = true, QoSScanFlag = false, VoiceScanFlag = false, PieStatFlag = false; +QVector dots; +QVector dotsThreads; +QFont multiFontSmallFontPie; +QFont multiFontSmallFontArc; void _LoadPersInfoToLocalVars(int savedTabIndex) { ZeroMemory(currentIP, sizeof(currentIP)); @@ -209,6 +213,84 @@ void _LoadPersInfoToLocalVars(int savedTabIndex) { } Ui::nesca_3Class *ui = new Ui::nesca_3Class; +QGraphicsScene *testScene; + +qreal sharedY = 50; +qreal sharedheight = sharedY + 120; +QPen penAllThreads(QColor(255,255,255, 30), 10, Qt::CustomDashLine); +QPen penThreads(QColor(82,180,229), 10, Qt::SolidLine); +QPen penBAThreads(QColor(250,32,61), 5, Qt::CustomDashLine); +QPen penAllTargets(QColor(255,255,255, 30), 10, Qt::SolidLine); +QPen penTargets(QColor(250,94,32), 6, Qt::SolidLine); +QPen penSaved(QColor(72,255,0), 3, Qt::SolidLine); +void nesca_3::drawVerboseArcs(unsigned long gTargets) { + testScene->clear(); + qreal leftX = 185; + qreal rightX = -165; + int fSz = 10; + + QPainterPath pathAllThreads; + pathAllThreads.arcMoveTo(leftX, sharedY, rightX, sharedheight, 0); + pathAllThreads.arcTo(leftX, sharedY, rightX, sharedheight, 0, 180); + QGraphicsPathItem* itmAllThreads = new QGraphicsPathItem(pathAllThreads); + itmAllThreads->setPen(penAllThreads); + testScene->addItem(itmAllThreads); + + QPainterPath pathThreads; + pathThreads.arcMoveTo(leftX, sharedY, rightX, sharedheight, 0); + pathThreads.arcTo(leftX, sharedY, rightX, sharedheight, 0, cons*((float)(180/(float)gThreads))); + QGraphicsPathItem* itmThreads = new QGraphicsPathItem(pathThreads); + itmThreads->setPen(penThreads); + testScene->addItem(itmThreads); + + fSz = 5; + QPainterPath pathBAThreads; + pathBAThreads.arcMoveTo(leftX, sharedY, rightX, sharedheight, 0); + pathBAThreads.arcTo(leftX, sharedY, rightX, sharedheight, 0, BrutingThrds*((float)(180/(float)gThreads))); + QGraphicsPathItem* itmBAThreads = new QGraphicsPathItem(pathBAThreads); + itmBAThreads->setPen(penBAThreads); + testScene->addItem(itmBAThreads); + + fSz = 10; + int xOffsetl = fSz + 2; + int xOffsetr = xOffsetl * 2; + leftX += xOffsetl; + rightX -= xOffsetr; + qreal sharedheight1 = sharedheight - xOffsetl; + qreal sharedheight2 = sharedheight + xOffsetr; + qreal nSharedY = sharedY - xOffsetl; + + QPainterPath pathAllTargets; + pathAllTargets.arcMoveTo(leftX, sharedY, rightX, sharedheight1, 0); + pathAllTargets.arcTo(leftX, nSharedY, rightX, sharedheight2, 0, 180); + QGraphicsPathItem* itmAllTargets = new QGraphicsPathItem(pathAllTargets); + itmAllTargets->setPen(penAllTargets); + testScene->addItem(itmAllTargets); + + fSz = 6; + QPainterPath pathTargets; + pathTargets.arcMoveTo(leftX, sharedY, rightX, sharedheight1, 0); + pathTargets.arcTo(leftX, nSharedY, rightX, sharedheight2, 0, indexIP*((float)(180/(float)gTargetsOverall))); + QGraphicsPathItem* itmTargets = new QGraphicsPathItem(pathTargets); + itmTargets->setPen(penTargets); + testScene->addItem(itmTargets); + + fSz = 3; + QPainterPath pathSaved; + pathSaved.arcMoveTo(leftX, sharedY, rightX, sharedheight1, 0); + pathSaved.arcTo(leftX, nSharedY, rightX, sharedheight2, 0, saved*((float)(180/(float)gTargetsOverall))); + QGraphicsPathItem* itmSaved = new QGraphicsPathItem(pathSaved); + itmSaved->setPen(penSaved); + testScene->addItem(itmSaved); + + ui->ipLabel->setText(QString(currentIP)); + ui->labelSavedValue->setText(QString::number(saved)); + ui->labelPendingTargets->setText(QString::number(gTargets)); + ui->labelRunningThreads->setText(QString::number(cons) + "/" + + QString::number(BrutingThrds) + "/" + + QString::number(gThreads)); +} + void setSceneArea() { delete ui->graphicsVoice; @@ -256,16 +338,22 @@ void setSceneArea() ui->pbgv->setScene(pbScene); ui->jobRangeVisual->setScene(jobRangeVisualScene); - ui->graphicLog->setSceneRect(0, 0, ui->graphicLog->width(), ui->graphicLog->height()); - ui->graphicLog_2->setSceneRect(0, 0, ui->graphicLog_2->width(), ui->graphicLog_2->height()); - ui->graphicDelim->setSceneRect(0, 0, ui->graphicDelim->width(), ui->graphicDelim->height()); - ui->graphicLog_Upper->setSceneRect(0, 0, ui->graphicLog_Upper->width(), ui->graphicLog_Upper->height()); - ui->graphicActivity->setSceneRect(0, 0, ui->graphicActivity->width(), ui->graphicActivity->height()); - ui->graphicActivityGrid->setSceneRect(0, 0, ui->graphicActivityGrid->width(), ui->graphicActivityGrid->height()); - ui->graphicTextPlacer->setSceneRect(0, 0, ui->graphicTextPlacer->width(), ui->graphicTextPlacer->height()); - ui->graphicsVoice->setSceneRect(0, 0, ui->graphicsVoice->width(), ui->graphicsVoice->height()); - ui->pbgv->setSceneRect(0, 0, ui->pbgv->width(), ui->pbgv->height()); - ui->jobRangeVisual->setSceneRect(0, 0, ui->jobRangeVisual->width(), ui->jobRangeVisual->height()); + ui->graphicLog->setSceneRect(0, 0, ui->graphicLog->width(), ui->graphicLog->height()); + ui->graphicLog_2->setSceneRect(0, 0, ui->graphicLog_2->width(), ui->graphicLog_2->height()); + ui->graphicDelim->setSceneRect(0, 0, ui->graphicDelim->width(), ui->graphicDelim->height()); + ui->graphicLog_Upper->setSceneRect(0, 0, ui->graphicLog_Upper->width(), ui->graphicLog_Upper->height()); + ui->graphicActivity->setSceneRect(0, 0, ui->graphicActivity->width(), ui->graphicActivity->height()); + ui->graphicActivityGrid->setSceneRect(0, 0, ui->graphicActivityGrid->width(), ui->graphicActivityGrid->height()); + ui->graphicTextPlacer->setSceneRect(0, 0, ui->graphicTextPlacer->width(), ui->graphicTextPlacer->height()); + ui->graphicsVoice->setSceneRect(0, 0, ui->graphicsVoice->width(), ui->graphicsVoice->height()); + ui->pbgv->setSceneRect(0, 0, ui->pbgv->width(), ui->pbgv->height()); + ui->jobRangeVisual->setSceneRect(0, 0, ui->jobRangeVisual->width(), ui->jobRangeVisual->height()); + + + testScene = new QGraphicsScene(); + ui->graphicsTest->setScene(testScene); + ui->graphicsTest->setSceneRect(0, 0, ui->graphicsTest->width(), ui->graphicsTest->height()); + ui->graphicsTest->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing); } void setButtonStyleArea() @@ -1020,64 +1108,60 @@ void nesca_3::slotUpdatePie() float perc5 = ((float)PieWF/(float)(found) * 100) * degree; float perc6 = ((float)PieSSH/(float)(found) * 100) * degree; - QFont fnt; - fnt.setFamily("Eurostile"); - fnt.setPixelSize(10); - QString dataSaved = "Saved: " + QString::number(goods/(float)(found > 0 ? found : 1) * 100) + "%(" + QString::number(goods) + ")"; QString dataParsed = "Filtered: " + QString::number((found - goods)/(float)(found > 0 ? found : 1) * 100) + "%(" + QString::number(found - goods) + ")"; QString dataOnline = "Online: " + QString::number(found); QString dataAnom = "Anomalies: " + QString::number(PieAnomC1/(float)(goods > 0 ? goods : 1) * 100) + "%"; QString dataBA = "Basic Auth: " + QString::number(PieBA/(float)(goods > 0 ? goods : 1) * 100) + "%"; QString dataSusp = "Suspicious: " + QString::number(PieSusp/(float)(goods > 0 ? goods : 1) * 100) + "%"; - QString dataLowl = "Lowload: " + QString::number(PieLowl/(float)(goods > 0 ? goods : 1) * 100) + "%"; - QString dataWF = "WebForms: " + QString::number(PieWF/(float)(goods > 0 ? goods : 1) * 100) + "%"; - QString dataSSH = "SSH: " + QString::number(PieSSH/(float)(goods > 0 ? goods : 1) * 100) + "%"; + QString dataLowl = "Lowload: " + QString::number(PieLowl/(float)(goods > 0 ? goods : 1) * 100) + "%"; + QString dataWF = "WebForms: " + QString::number(PieWF/(float)(goods > 0 ? goods : 1) * 100) + "%"; + QString dataSSH = "SSH: " + QString::number(PieSSH/(float)(goods > 0 ? goods : 1) * 100) + "%"; int dataX = 1; int dataY = 13; - QGraphicsTextItem *titem = sceneGraph->addText(dataOnline, fnt); + QGraphicsTextItem *titem = sceneGraph->addText(dataOnline, multiFontSmallFontPie); titem->setX(dataX); titem->setY(-5); titem->setDefaultTextColor(QColor(255, 255, 255, 130)); - titem = sceneGraph->addText(dataSaved, fnt); + titem = sceneGraph->addText(dataSaved, multiFontSmallFontPie); titem->setX(dataX); titem->setY(5); titem->setDefaultTextColor(QColor(255, 255, 255, 130)); - titem = sceneGraph->addText(dataParsed, fnt); + titem = sceneGraph->addText(dataParsed, multiFontSmallFontPie); titem->setX(dataX); titem->setY(15); titem->setDefaultTextColor(QColor(255, 255, 255, 255)); - titem = sceneGraph->addText(dataAnom, fnt); + titem = sceneGraph->addText(dataAnom, multiFontSmallFontPie); titem->setX(dataX); titem->setY(dataY + 17); titem->setDefaultTextColor(QColor("red")); - titem = sceneGraph->addText(dataBA, fnt); + titem = sceneGraph->addText(dataBA, multiFontSmallFontPie); titem->setX(dataX); titem->setY(dataY + 27); titem->setDefaultTextColor(Qt::darkCyan); - titem = sceneGraph->addText(dataSusp, fnt); + titem = sceneGraph->addText(dataSusp, multiFontSmallFontPie); titem->setX(dataX); titem->setY(dataY + 37); titem->setDefaultTextColor(Qt::darkRed); - titem = sceneGraph->addText(dataLowl, fnt); + titem = sceneGraph->addText(dataLowl, multiFontSmallFontPie); titem->setX(dataX); titem->setY(dataY + 47); titem->setDefaultTextColor(Qt::magenta); - titem = sceneGraph->addText(dataWF, fnt); + titem = sceneGraph->addText(dataWF, multiFontSmallFontPie); titem->setX(dataX); titem->setY(dataY + 56); titem->setDefaultTextColor(Qt::darkGray); - titem = sceneGraph->addText(dataSSH, fnt); + titem = sceneGraph->addText(dataSSH, multiFontSmallFontPie); titem->setX(dataX); titem->setY(dataY + 66); titem->setDefaultTextColor(Qt::darkRed); @@ -1419,7 +1503,6 @@ void nesca_3::slotClearLogs() int c = 1; - void nesca_3::slotSaveImage(QAction *qwe) { QObject *smB = this->sender(); @@ -1641,7 +1724,6 @@ QRegExp _rOutProt(" HTTP/1.\\d+"); QRegExp _rOutPath(" /(\\w|\\.|,|/|:|-|_|\\?|!|\\@|#|\\$|%|\\^|&|\\*|\\(|\\)|=|\\+|<|>|;|:|\"|'|~|\\[|\\])* "); QRegExp _rOutHost("Host: ((\\w|\\d|\\.|:|/)*)\\r\\n"); QRegExp qrp("\\n(.+):"); - void nesca_3::slotOutData(QString str) { if(SendData != NULL) @@ -1980,9 +2062,7 @@ void nesca_3::IPScanSeq() { if(ui->portLine->text() != "") { - _LoadPersInfoToLocalVars(savedTabIndex); - ui->labelParsed_Value->setText("0/0"); - ui->labelOffline_Value->setText("0"); + _LoadPersInfoToLocalVars(savedTabIndex); stopFirst = false; ui->tabMainWidget->setTabEnabled(1, false); ui->tabMainWidget->setTabEnabled(2, false); @@ -2064,10 +2144,7 @@ void nesca_3::DNSScanSeq() if(ui->lineEditStartIPDNS->text() != "") { if(ui->lineEditPort->text() != "") - { - _LoadPersInfoToLocalVars(savedTabIndex); - ui->labelParsed_Value->setText("0/0"); - ui->labelOffline_Value->setText("0"); + { if(ui->lineEditStartIPDNS->text().indexOf(".") > 0) { QStringList lst = ui->lineEditStartIPDNS->text().split("."); @@ -2078,9 +2155,10 @@ void nesca_3::DNSScanSeq() topLevelDomainStr += "."; topLevelDomainStr += lst[i]; }; - ui->lineILVL->setText(topLevelDomainStr); + ui->lineILVL->setText(topLevelDomainStr); }; + _LoadPersInfoToLocalVars(savedTabIndex); stopFirst = false; ui->tabMainWidget->setTabEnabled(0, false); @@ -2128,9 +2206,6 @@ void nesca_3::ImportScanSeq() ui->tabMainWidget->setTabEnabled(0, false); ui->tabMainWidget->setTabEnabled(1, false); - ui->labelParsed_Value->setText("0/0"); - ui->labelOffline_Value->setText("0"); - strcpy(inputStr, ("DUMMY|-f|" + fileName + "|" + ui->importThreads->text() + "|-p" + ui->importPorts->text().replace(" ", "")).toLocal8Bit().data()); globalScanFlag = true; @@ -2327,15 +2402,11 @@ void nesca_3::ConnectEvrthng() connect ( stt, SIGNAL(changeRedFoundData(QString)), this, SLOT(appendErrText(QString))); connect ( stt, SIGNAL(changeGreenFoundData(QString)), this, SLOT(appendOKText(QString))); connect ( stt, SIGNAL(killSttThread()), this, SLOT(STTTerminate())); - connect ( stt, SIGNAL(changeParsedValue(QString)), ui->labelParsed_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeIpRange(QString)), ui->labelIpRange_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeThreads(QString)), ui->labelThreads_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeIPS(QString)), ui->labelIPS_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeFoundData(QString)), this, SLOT(appendDefaultText(QString))); - connect ( stt, SIGNAL(changeBAValue(QString)), ui->labelBAThreads_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeStatus(QString)), ui->labelStatus_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeTargetsLeft(QString)), ui->labelTargetsLeft_Value, SLOT(setText(QString))); - connect ( stt, SIGNAL(changeOffline(QString)), ui->labelOffline_Value, SLOT(setText(QString))); + + connect ( stt, SIGNAL(signalUpdateArc(unsigned long)), this, SLOT(drawVerboseArcs(unsigned long))); + + connect ( stt, SIGNAL(changeFoundData(QString)), this, SLOT(appendDefaultText(QString))); + connect ( stt, SIGNAL(changeStatus(QString)), ui->labelStatus_Value, SLOT(setText(QString))); connect ( stt, SIGNAL(changeBAData(QString)), ui->BAText, SLOT(append(QString))); connect ( stt, SIGNAL(changeGreenBAData(QString)), this, SLOT(appendGreenBAData(QString))); connect ( stt, SIGNAL(changeRedBAData(QString)), this, SLOT(appendRedBAData(QString))); @@ -2665,8 +2736,26 @@ void _startMsgCheck() ui->dataText->setOpenExternalLinks(true); ui->dataText->setOpenLinks(false); ui->rVerLabel->hide(); - setSceneArea(); - + setSceneArea(); + + dots << 0.5 << 0.3 << 0.5 << 0.3; + dotsThreads << 0.1 << 0.2 << 0.1 << 0.2; + penAllThreads.setCapStyle(Qt::FlatCap); + penAllThreads.setDashPattern(dotsThreads); + penThreads.setCapStyle(Qt::FlatCap); + penBAThreads.setDashPattern(dots); + penBAThreads.setCapStyle(Qt::FlatCap); + penAllTargets.setCapStyle(Qt::FlatCap); + penTargets.setCapStyle(Qt::FlatCap); + penSaved.setCapStyle(Qt::FlatCap); + + multiFontSmallFontPie.setFamily("small_fonts"); + multiFontSmallFontPie.setPixelSize(9); + multiFontSmallFontArc.setFamily("small_fonts"); + multiFontSmallFontArc.setPixelSize(10); + multiFontSmallFontArc.setUnderline(true); + ui->ipLabel->setFont(multiFontSmallFontArc); + tray = new QSystemTrayIcon(QIcon(":/nesca_3/nesca.ico"), this); tray->hide(); @@ -2678,8 +2767,7 @@ void _startMsgCheck() const std::string &gVERStr = GetVer(); strcpy(gVER, gVERStr.c_str()); - QString QVER(gVER); - ui->logoLabel->setToolTip("v3-" + QVER); + ui->logoLabel->setToolTip("v3-" + QString(gVER)); ui->logoLabel->setStyleSheet("color:white; border: none;background-color:black;"); ui->newMessageLabel->setStyleSheet("color:rgba(255, 0, 0, 0);background-color: rgba(2, 2, 2, 0);"); @@ -2690,9 +2778,6 @@ void _startMsgCheck() dtHN->start(); dtME2->start(); adtHN->start(); - - pbPointerFont.setFamily("Eurostile"); - pbPointerFont.setPixelSize(8); #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) WSADATA wsda; @@ -2710,6 +2795,7 @@ void _startMsgCheck() _startVerCheck(); _startMsgCheck(); qrp.setMinimal(true); + drawVerboseArcs(0); } void nesca_3::mousePressEvent(QMouseEvent *event) @@ -2789,9 +2875,7 @@ void nesca_3::STTTerminate() ui->tabMainWidget->setTabEnabled(1, true); ui->tabMainWidget->setTabEnabled(2, true); ui->tabMainWidget->setTabEnabled(3, true); - stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads)); - stt->doEmitionIPS("0"); - stt->doEmitionChangeBA("0"); + stt->doEmitionUpdateArc(0); BrutingThrds = 0; cons = 0; setButtonStyleArea(); @@ -2965,8 +3049,7 @@ void nesca_3::appendErrText(QString str) if(stt->isRunning() == false) { startFlag = false; - stt->doEmitionChangeStatus("Idle"); - stt->doEmitionIPS("0"); + stt->doEmitionChangeStatus("Idle"); ui->startScanButton_3->setText("Start"); stt->terminate(); }; diff --git a/nesca_3.h b/nesca_3.h index 82ed5c5..49d30c2 100644 --- a/nesca_3.h +++ b/nesca_3.h @@ -124,6 +124,7 @@ protected: void appendGreenBAData(QString str); void appendRedBAData(QString str); void STTTerminate(); + void drawVerboseArcs(unsigned long gTargets); private: QPoint dragPosition; }; diff --git a/nesca_3.ui b/nesca_3.ui index 3d489a4..0d45b05 100644 --- a/nesca_3.ui +++ b/nesca_3.ui @@ -1445,9 +1445,9 @@ border-radius: 3px; - 95 - 10 - 306 + 123 + 11 + 271 20 @@ -1535,52 +1535,22 @@ border-radius: 3px; X - - - - 20 - 230 - 61 - 20 - - - - - Small Fonts - 7 - 50 - false - false - true - false - - - - Qt::LeftToRight - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - Current IP: - - - 20 - 255 - 61 - 20 + 89 + 325 + 15 + 15 - Small Fonts - 7 + Sans + 10 50 false - true + false false @@ -1588,40 +1558,15 @@ border-radius: 3px; color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - Threads: + ⇶: - + - 20 - 280 - 71 - 20 - - - - - Small Fonts - 7 - 50 - false - true - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - Brute threads: - - - - - - 95 - 230 - 394 + 37 + 351 + 150 20 @@ -1637,7 +1582,7 @@ border-radius: 3px; 7 50 false - false + true @@ -1649,13 +1594,16 @@ border-radius: 3px; -- + + Qt::AlignCenter + - + - 95 - 255 - 91 + 104 + 324 + 67 20 @@ -1672,82 +1620,7 @@ border-radius: 3px; color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0); - 0/0 - - - - - - 95 - 280 - 61 - 20 - - - - - Small Fonts - 7 - 50 - false - false - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - 0 - - - - - - 20 - 330 - 61 - 20 - - - - - Small Fonts - 7 - 50 - false - true - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - IP/s: - - - - - - 95 - 330 - 106 - 20 - - - - - Small Fonts - 7 - 50 - false - false - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - 0 + 0/0/0 @@ -1812,78 +1685,10 @@ p, li { white-space: pre-wrap; } false - - - - 20 - 355 - 73 - 20 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - Small Fonts - 7 - 50 - false - true - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - 1 - - - Saved/Online: - - - false - - - - - - 95 - 355 - 108 - 20 - - - - - Small Fonts - 7 - 50 - false - false - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - 0/0 - - - 11 + 19 783 41 10 @@ -1923,7 +1728,7 @@ p, li { white-space: pre-wrap; } - 51 + 58 783 101 10 @@ -1945,34 +1750,34 @@ p, li { white-space: pre-wrap; } - 20 - 305 - 61 + 89 + 335 + 16 20 - Small Fonts - 7 + Sans + 10 50 false - true + false color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - Targets: + ⌬: - + - 95 - 305 - 114 + 104 + 337 + 71 20 @@ -2553,74 +2358,6 @@ p, li { white-space: pre-wrap; } QGraphicsView::CacheNone - - - - 19 - 380 - 73 - 20 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - Small Fonts - 7 - 50 - false - true - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - 1 - - - Offline: - - - false - - - - - - 95 - 380 - 71 - 20 - - - - - Small Fonts - 7 - 50 - false - false - - - - color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); - - - 0 - - @@ -3229,9 +2966,9 @@ background-color: #000000; - 36 - 15 - 86 + 31 + 16 + 82 10 @@ -3291,27 +3028,97 @@ background-color: #000000; + + + + 9 + 229 + 210 + 211 + + + + + Small Fonts + 7 + + + + border:1px white solid;background-color: rgba(26, 26,26, 0); + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QPainter::TextAntialiasing + + + QGraphicsView::CacheNone + + + + + + 104 + 311 + 67 + 20 + + + + + Small Fonts + 7 + 50 + false + false + + + + color: rgb(216, 216, 216); background-color: rgba(2, 2, 2, 0); + + + 0 + + + + + + 89 + 312 + 15 + 15 + + + + + Sans + 10 + 50 + false + false + false + + + + color: rgb(216, 216, 216);background-color: rgba(2, 2, 2, 0); + + + ✔: + + graphicTextPlacer BAText labelNesca_3 tabMainWidget line exitButton - labelIpRange - labelThreads - labelBaThreads - labelIpRange_Value - labelThreads_Value - labelBAThreads_Value - labelIPS - labelIPS_Value dataText - labelParsed - labelParsed_Value labelStatus labelStatus_Value - labelTargetsLeft - labelTargetsLeft_Value line_2 RedLabel YellowLabel @@ -3334,8 +3141,6 @@ background-color: #000000; graphicDelim graphicLog_2 graphicLog_Upper - labelBadAddr - labelOffline_Value switcherBut labelTracker graphicActivityGrid @@ -3358,6 +3163,14 @@ background-color: #000000; labelSSH rVerLabel NSTrackStatusLabel + graphicsTest + ipLabel + labelTargetsLeft + labelPendingTargets + labelThreads + labelRunningThreads + labelSavedValue + labelSaved @@ -3488,10 +3301,10 @@ background-color: #000000; :Jobs - widget widgetJOB - JobModeBut + widget DataflowModeBut + JobModeBut diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index ee6655b..beb6837 100644 --- a/nesca_startModule.cpp +++ b/nesca_startModule.cpp @@ -20,7 +20,7 @@ int PieAnomC1 = 0, PieBA = 0, PieSusp = 0, PieLowl = 0, PieWF = 0, PieSSH = 0; int AnomC1 = 0, Filt = 0, Overl = 0, Lowl = 0, Alive = 0, saved = 0, Susp = 0, WF = 0, offlines = 0, ssh = 0; int GlobalNegativeSize = 0; int ipCounter = 0; -int found = 0, indexIP = 1; +int found = 0, indexIP = 0; int gMode; int MaxPass = 0, MaxLogin = 0, MaxTags = 0, MaxWFLogin = 0, MaxWFPass = 0, MaxSSHPass = 0; int ipsstart[4], ipsend[4], @@ -334,23 +334,20 @@ void _timer() { strncpy(b, QString::number(ips).toLocal8Bit().data(), 5); strcpy(metaIPS, b); - strcat(timeLeft, b); - strcat(timeLeft, "/s ("); + //strcat(timeLeft, b); + //strcat(timeLeft, "/s ("); - if (ips > 0) - { - strncpy(dbuffer, std::to_string(((gTargets + 1) / ips / 3600 / 24)).c_str(), 5); - } - else strcpy(dbuffer, "INF"); - strcpy(metaETA, dbuffer); - strcat(dbuffer, "d)"); - strcat(timeLeft, (strcmp(dbuffer, "1.$d)") == 0 ? "INF)" : dbuffer)); + //if (ips > 0) + //{ + // strncpy(dbuffer, std::to_string(((gTargets + 1) / ips / 3600 / 24)).c_str(), 5); + //} + //else strcpy(dbuffer, "INF"); + //strcpy(metaETA, dbuffer); + //strcat(dbuffer, "d)"); + //strcat(timeLeft, (strcmp(dbuffer, "1.$d)") == 0 ? "INF)" : dbuffer)); - - stt->doEmitionIPS(QString(timeLeft)); - - ZeroMemory(timeLeft, sizeof(timeLeft)); - ZeroMemory(dbuffer, sizeof(dbuffer)); + //ZeroMemory(timeLeft, sizeof(timeLeft)); + //ZeroMemory(dbuffer, sizeof(dbuffer)); Sleep(1000); }; @@ -717,7 +714,7 @@ unsigned long int numOfIps(int ipsstart[], int ipsend[]) { gTargets += 65536 * (ipsend[1] - ipsstart[1]); gTargets += 256 * (ipsend[2] - ipsstart[2]); gTargets += (ipsend[3] - ipsstart[3]); - gTargetsOverall = gTargets; + gTargetsOverall = gTargets + 1; //unsigned long ip1 = (ipsstart[0] * 16777216) + (ipsstart[1] * 65536) + (ipsstart[2] * 256) + ipsstart[3]; //unsigned long ip2 = (ipsend[0] * 16777216) + (ipsend[1] * 65536) + (ipsend[2] * 256) + ipsend[3]; @@ -728,13 +725,13 @@ unsigned long int numOfIps(int ipsstart[], int ipsend[]) { void verboseProgress(unsigned long target) { - stt->doEmitionIPRANGE(QString(currentIP)); + stt->doEmitionUpdateArc(gTargets); + if(gTargets > 0) --gTargets; char targetNPers[128] = { 0 }; float percent = (gTargetsOverall != 0 ? (100 - target / (double)gTargetsOverall * 100) : 0); - sprintf(targetNPers, "%Lu (%.1f%%)", target, percent); - stt->doEmitionTargetsLeft(QString(targetNPers)); + sprintf(targetNPers, "%Lu (%.1f%%)", target, percent); sprintf(metaTargets, "%Lu", target); sprintf(metaPercent, "%.1f", @@ -1508,7 +1505,6 @@ int ParseArgs(int argc, char *argv[]) { if (strstr(p, ",") != NULL) { - lex = strtok(p, ","); portArr[indexPorts++] = atoi(lex); @@ -1539,7 +1535,6 @@ int ParseArgs(int argc, char *argv[]) { } else { - lex = strtok(p, "-p"); portArr[indexPorts++] = atoi(lex); }; @@ -1605,8 +1600,6 @@ void ConInc() #else asm("lock; incl cons"); #endif - stt->doEmitionThreads(QString::number(cons) + "/" + - QString::number(gThreads)); } void ConDec() { @@ -1622,8 +1615,7 @@ void ConDec() #endif }; - stt->doEmitionThreads(QString::number(cons) + "/" + - QString::number(gThreads)); + stt->doEmitionUpdateArc(gTargets); } void _connect() { @@ -1726,7 +1718,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) { ++indexIP; sprintf(currentIP, "%s%s", mask, gTLD); - verboseProgress(gTargets--); + verboseProgress(gTargets); Threader::fireThread(currentIP, (void*(*)(void))_connect); }; @@ -1796,10 +1788,7 @@ int startScan(char* args) { stt->doEmitionKillSttThread(); return -1; - }; - - stt->doEmitionIPRANGE(QString("--")); - stt->doEmitionThreads(QString::number(0) + "/" + QString::number(gThreads)); + }; runAuxiliaryThreads(); @@ -1833,7 +1822,7 @@ int startScan(char* args) { strcpy(currentIP, ipVec[0].c_str()); ipVec.erase(ipVec.begin()); - verboseProgress(gTargets--); + verboseProgress(gTargets); Threader::fireThread(currentIP, (void*(*)(void))_connect); } @@ -1854,7 +1843,7 @@ int startScan(char* args) { tAddr.s_addr = ntohl(i); strcpy(currentIP, inet_ntoa(tAddr)); - verboseProgress(gTargets--); + verboseProgress(gTargets); Threader::fireThread(currentIP, (void*(*)(void))_connect); } @@ -2036,7 +2025,7 @@ int startScan(char* args) { ++indexIP; strcpy(currentIP, ipVec[0].c_str()); ipVec.erase(ipVec.begin()); - verboseProgress(gTargets--); + verboseProgress(gTargets); Threader::fireThread(currentIP, (void*(*)(void))_connect); } @@ -2056,7 +2045,7 @@ int startScan(char* args) { tAddr.s_addr = ntohl(i); strcpy(currentIP, inet_ntoa(tAddr)); - verboseProgress(gTargets--); + verboseProgress(gTargets); Threader::fireThread(currentIP, (void*(*)(void))_connect); } break; @@ -2079,7 +2068,6 @@ int startScan(char* args) { }; stt->doEmitionGreenFoundData("Done. Saved: " + QString::number(saved) + "; Alive: " + QString::number(found) + "."); - stt->doEmitionChangeParsed(QString::number(saved) + "/" + QString::number(found)); stt->doEmitionChangeStatus("Idle"); Sleep(1000); //Wait for lock release