diff --git a/BasicAuth.cpp b/BasicAuth.cpp index 28e77de..2dd9468 100644 --- a/BasicAuth.cpp +++ b/BasicAuth.cpp @@ -16,10 +16,7 @@ int BA::checkOutput(const string *buffer, const char *ip, const int port) { return 1; } else if (Utils::ustrstr(*buffer, "http/1.1 404") != -1 - || Utils::ustrstr(*buffer, "http/1.0 404") != -1) { - stt->doEmitionRedFoundData("BA - 404 " + QString(ip) + ":" + QString::number(port)); - return -2; - } + || Utils::ustrstr(*buffer, "http/1.0 404") != -1) return -2; else if (Utils::ustrstr(*buffer, "503 service unavailable") != -1 || Utils::ustrstr(*buffer, "http/1.1 503") != -1 || Utils::ustrstr(*buffer, "http/1.0 503") != -1 @@ -76,7 +73,10 @@ lopaStr BA::BABrute(const char *ip, const int port, bool digestMode) { if (res == -2) return lps; else if (res != -1) { res = checkOutput(&buffer, ip, port); - if (res == -2) return lps; + if (res == -2) { + strcpy(lps.other, "404"); + return lps; + } if (res == -1) { ++i; break; diff --git a/Connector.cpp b/Connector.cpp index 3bbb9a4..f8ce1fa 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -124,47 +124,48 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, buffer->clear(); CURL *curl = curl_easy_init(); - if (curl != NULL) - { - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); - if (MapWidgetOpened) { - struct data config; - config.trace_ascii = 1; /* enable ascii tracing */ - curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); - curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - } - curl_easy_setopt(curl, CURLOPT_URL, ip); - curl_easy_setopt(curl, CURLOPT_PORT, port); - curl_easy_setopt(curl, CURLOPT_USERAGENT, - "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0"); - curl_easy_setopt(curl, CURLOPT_HEADER, 1L); - curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, nWriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer); - int proxyPort = std::atoi(gProxyPort); - if(strlen(gProxyIP) != 0 && (proxyPort > 0 && proxyPort < 65535)) { - curl_easy_setopt(curl, CURLOPT_PROXY, gProxyIP); - curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxyPort); - } else { - curl_easy_setopt(curl, CURLOPT_PROXY, ""); - } - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut + 3); + if (curl != NULL) + { + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); + if (MapWidgetOpened) { + struct data config; + config.trace_ascii = 1; /* enable ascii tracing */ + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); + curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + } + curl_easy_setopt(curl, CURLOPT_URL, ip); + curl_easy_setopt(curl, CURLOPT_PORT, port); + curl_easy_setopt(curl, CURLOPT_USERAGENT, + "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0"); + curl_easy_setopt(curl, CURLOPT_HEADER, 1L); + curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, nWriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer); + int proxyPort = std::atoi(gProxyPort); + if (strlen(gProxyIP) != 0 && (proxyPort > 0 && proxyPort < 65535)) { + curl_easy_setopt(curl, CURLOPT_PROXY, gProxyIP); + curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxyPort); + } + else { + curl_easy_setopt(curl, CURLOPT_PROXY, ""); + } + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut + 3); - if(postData != NULL) curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData); + if (postData != NULL) curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData); - if(customHeaders != NULL) { + if (customHeaders != NULL) { - struct curl_slist *chunk = NULL; + struct curl_slist *chunk = NULL; - for(auto &ch : *customHeaders) chunk = curl_slist_append(chunk, ch.c_str()); + for (auto &ch : *customHeaders) chunk = curl_slist_append(chunk, ch.c_str()); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); - } + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); + } int res = 0; diff --git a/IPCAuth.cpp b/IPCAuth.cpp index 5c0f0eb..861a2c7 100644 --- a/IPCAuth.cpp +++ b/IPCAuth.cpp @@ -66,6 +66,10 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC) { negVector.push_back("action=\"setup_login.cgi\""); } + else if (strcmp(SPEC, "WEBCAMXP") == 0) + { + negVector.push_back("Not logged in"); + } else { stt->doEmitionRedFoundData("[_IPCameraBrute] No \"SPEC\" specified!"); @@ -144,6 +148,12 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC) sprintf(request, "%s:%d/setup_login.cgi", ip, port); sprintf(postData, "check_username=%s&check_password=%s&login=", login, pass); } + else if (strcmp(SPEC, "WEBCAMXP") == 0) + { + doPost = true; + sprintf(request, "%s:%d/login.html", ip, port); + sprintf(postData, "username=%s&password=%s&Redir=/", login, pass); + } std::string buffer; if(doPost) res = Connector::nConnect(request, port, &buffer, postData); diff --git a/MainStarter.cpp b/MainStarter.cpp index 775f2f8..31c0238 100644 --- a/MainStarter.cpp +++ b/MainStarter.cpp @@ -24,23 +24,16 @@ char gTLD[128] = { 0 }; char gPorts[65536] = { 0 }; char currentIP[MAX_ADDR_LEN] = { 0 }; char finalIP[32] = { 0 }; - bool gPingNScan = false; std::atomic cons = 0, BrutingThrds = 0, gThreads; - std::vector MainStarter::portVector; int MainStarter::flCounter = 0; bool MainStarter::savingBackUpFile = false; - QJsonArray *jsonArr = new QJsonArray(); - bool horLineFlag = false; bool gShuffle = true; - int ipCounter = 0; - long long unsigned gTargets = 0, gTargetsNumber = 1; - char currentMask[128] = { 0 }; char metaRange[256] = { 0 }; char metaPercent[256] = { 0 }; @@ -49,6 +42,10 @@ char metaTargets[256] = { 0 }; char metaETA[256] = { 0 }; char metaOffline[256] = { 0 }; + +void MainStarter::unBlockButtons(){ + stt->doEmitionBlockButton(false); +} int MainStarter::fileLoader(const char *fileName) { char curIP[256] = { 0 }, curIPCopy[256] = { 0 }; @@ -1286,6 +1283,17 @@ void MainStarter::runAuxiliaryThreads() { } void MainStarter::start(const char* targets, const char* ports) { + + curl_global_init(CURL_GLOBAL_ALL); + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) + bool res = CreateDirectoryA(RESULT_DIR_NAME, NULL); +#else + struct stat str = { 0 }; + if (stat(RESULT_DIR_NAME, &str) == -1) { + mkdir(RESULT_DIR_NAME, 0700); + } +#endif if (loadTargets(targets) == -1 || loadPorts(ports, ',') == -1) { diff --git a/MainStarter.h b/MainStarter.h index 44a3754..fb0389a 100644 --- a/MainStarter.h +++ b/MainStarter.h @@ -44,18 +44,6 @@ public: ZeroMemory(ipsstart, sizeof(ipsstart)); ZeroMemory(ipsend, sizeof(ipsend)); - - curl_global_init(CURL_GLOBAL_ALL); - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) - bool res = CreateDirectoryA(RESULT_DIR_NAME, NULL); -#else - struct stat str = { 0 }; - if (stat(RESULT_DIR_NAME, &str) == -1) { - mkdir(RESULT_DIR_NAME, 0700); - } -#endif - } ~MainStarter(){ FileUpdater::FUClear(); @@ -107,8 +95,11 @@ public: delete[]ipsendfl; ipsendfl = NULL; }; + + unBlockButtons(); } + void unBlockButtons(); void runAuxiliaryThreads(); void saver(); void saveBackupToFile(); diff --git a/STh.cpp b/STh.cpp index fc168f9..57c8d23 100644 --- a/STh.cpp +++ b/STh.cpp @@ -71,7 +71,11 @@ void STh::doEmitionDataSaved(bool status) } void STh::doEmitionUpdateArc(unsigned long gTargets) { - emit stt->signalUpdateArc(gTargets); + emit stt->signalUpdateArc(gTargets); +} +void STh::doEmitionBlockButton(bool value) +{ + emit stt->signalBlockButton(value); } void STh::setMode(short mode) { diff --git a/STh.h b/STh.h index ec3a576..1b102ba 100644 --- a/STh.h +++ b/STh.h @@ -37,7 +37,8 @@ public: static void doEmitionBAData(QString str); static void doEmitionDebugFoundData(QString); static void doEmitionShowRedVersion(); - static void doEmitionUpdateArc(unsigned long gTargets); + static void doEmitionUpdateArc(unsigned long gTargets); + static void doEmitionBlockButton(bool value); signals: public: signals: void showRedVersion(); @@ -56,8 +57,9 @@ public: signals: void changeDebugFoundData(QString); public: signals: void changeStatus(QString); public: signals: void killSttThread(); public: signals: void sIncData(QString, QString); -public: signals: void sOutData(QString); -public: signals: void signalUpdateArc(unsigned long); +public: signals : void sOutData(QString); +public: signals : void signalUpdateArc(unsigned long); +public: signals : void signalBlockButton(bool); protected: void run(); diff --git a/finder.cpp b/finder.cpp index 6032495..3b6e2a5 100644 --- a/finder.cpp +++ b/finder.cpp @@ -381,6 +381,9 @@ int sharedDetector(const char * ip, int port, const std::string *buffcpy, const || Utils::ustrstr(buffcpy, "/app/live/sim/single.asp") != -1) ) return 50; //Network Video System if (Utils::ustrstr(buffcpy, "MASPRO DENKOH") != -1) return 51; //MASPRO + if (Utils::ustrstr(buffcpy, "webcamXP") != -1 + && Utils::ustrstr(buffcpy, "a valid username/password") != -1 + ) return 52; //Webcamxp5 if(((Utils::ustrstr(buffcpy, "220") != -1) && (port == 21)) || (Utils::ustrstr(buffcpy, "220 diskStation ftp server ready") != -1) || @@ -1193,10 +1196,8 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char *comment, char *cp, int size, char *SPEC) { - lopaStr lps = {"UNKNOWN", "", ""}; - - IPC ipc; - lps = ipc.IPCLobby(ip, port, SPEC); + IPC ipc; + lopaStr lps = ipc.IPCLobby(ip, port, SPEC); if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) { @@ -1206,12 +1207,19 @@ void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char }; } -void _specBrute(const char *ip, int port, +int _specBrute(const char *ip, int port, char *finalstr, int flag, char *path, char *comment, char *cp, int size) { const lopaStr &lps = BA::BALobby((string(ip) + string(path)).c_str(), port, (strcmp(comment, "[DIGEST]") == 0 ? true : false)); + if (strcmp(lps.other, "404") == 0) { + + stt->doEmitionRedFoundData("BA - 404 " + + QString(ip) + ":" + QString::number(port) + QString(path) + ""); + return -1; + } + if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) { _specFillerBA(ip, port, finalstr, lps.login, lps.pass, flag); @@ -2572,9 +2580,15 @@ int Lexems::filler(char* ip, int port, const std::string *buffcpy, int size, Lex { _specWEBIPCAMBrute(ip, port, "[MASPRO] WEB IP Camera", flag, "WEB Authorization", cp, size, "MASPRO"); } + else if (flag == 52) //webcamxp5 + { + _specWEBIPCAMBrute(ip, port, "[WEBCAMXP] WEB IP Camera", flag, "WEB Authorization", cp, size, "WEBCAMXP"); + } else if (flag == 20) //AXIS Camera { - _specBrute(ip, port, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, size); + if (_specBrute(ip, port, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, size) == -1){ + _specBrute(ip, port, "AXIS Camera", flag, "/view/viewer_index.shtml?", "Basic Authorization", cp, size); + } } else if (flag == 19) //reecam cameras { diff --git a/negatives.txt b/negatives.txt index 0419561..7a0b64f 100644 --- a/negatives.txt +++ b/negatives.txt @@ -1,3 +1,4 @@ +Unable to open WebDAV Ruckus Wireless Company Limited diff --git a/nesca_3.cpp b/nesca_3.cpp index b184dfd..3758d6a 100644 --- a/nesca_3.cpp +++ b/nesca_3.cpp @@ -59,7 +59,6 @@ DrawerTh_GridQoSScanner *dtGridQoS = new DrawerTh_GridQoSScanner(); CheckKey_Th *chKTh = new CheckKey_Th(); ActivityDrawerTh_HorNet *adtHN = new ActivityDrawerTh_HorNet(); DrawerTh_VoiceScanner *vsTh = new DrawerTh_VoiceScanner(); -//IRC_NMBlinker *irc_nmb = new IRC_NMBlinker(); PieStat *psTh = new PieStat(); ProgressbarDrawer *pbTh = new ProgressbarDrawer(); @@ -1315,6 +1314,7 @@ void nesca_3::importAndScan() ); ui->importButton->setText("STOP!"); + stt->doEmitionBlockButton(true); stt->doEmitionYellowFoundData("Trying to stop. Please, wait..."); importFileName = ""; } @@ -2045,43 +2045,7 @@ void nesca_3::IPScanSeq() ); ui->dataText->clear(); } - else - { - stt->doEmitionRedFoundData("No ports specified!"); - }; - } - else - { - if(stopFirst == false) - { - stopFirst = true; - globalScanFlag = false; - ui->startScanButton_3->setStyleSheet( - " QPushButton {" - "background-color: qlineargradient(spread:none, x1:1, y1:0, x2:1, y2:1, stop:0.681818 rgba(0, 0, 0, 250), stop:1 rgba(255, 255, 255, 130));" - "color: red;" - "border: 0.5px solid qlineargradient(spread:reflect, x1:0.54, y1:0.488591, x2:0.54, y2:0, stop:0 rgba(255, 255, 255, 130), stop:1 rgba(0, 0, 0, 255));" - "}" - ); - - ui->startScanButton_3->setText("STOP!"); - stt->doEmitionYellowFoundData("Trying to stop. Please, wait..."); - } - else - { - globalScanFlag = false; - ui->startScanButton_3->setStyleSheet( - " QPushButton {" - "background-color: qlineargradient(spread:none, x1:1, y1:0, x2:1, y2:1, stop:0.681818 rgba(0, 0, 0, 250), stop:1 rgba(255, 255, 255, 130));" - "color: yellow;" - "border: 0.5px solid qlineargradient(spread:reflect, x1:0.54, y1:0.488591, x2:0.54, y2:0, stop:0 rgba(255, 255, 255, 130), stop:1 rgba(0, 0, 0, 255));" - "}" - ); - - ui->startScanButton_3->setText("Wait..."); - stt->doEmitionYellowFoundData("Wait, killing threads..."); - STTTerminate(); - }; + else stt->doEmitionRedFoundData("No ports specified!"); }; } @@ -2277,9 +2241,16 @@ void nesca_3::onLinkClicked(QUrl link) QDesktopServices::openUrl(link); } +void nesca_3::slotBlockButtons(bool value) { + ui->startScanButton_3->setEnabled(!value); + ui->startScanButton_4->setEnabled(!value); + ui->importButton->setEnabled(!value); +} + void nesca_3::ConnectEvrthng() { - connect ( pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate())); + connect(stt, SIGNAL(signalBlockButton(bool)), this, SLOT(slotBlockButtons(bool))); + connect(pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate())); connect ( ui->secretMessageBut_1, SIGNAL( clicked() ), this, SLOT( smReaction() ) ); connect ( ui->secretMessageBut_2, SIGNAL( clicked() ), this, SLOT( smReaction() ) ); connect ( ui->secretMessageBut_3, SIGNAL( clicked() ), this, SLOT( smReaction() ) ); @@ -2777,6 +2748,7 @@ void nesca_3::startScanButtonClicked() ); ui->startScanButton_3->setText("STOP!"); + stt->doEmitionBlockButton(true); stt->doEmitionYellowFoundData("Trying to stop. Please, wait..."); } else @@ -2832,6 +2804,7 @@ void nesca_3::startScanButtonClickedDNS() ); ui->startScanButton_4->setText("STOP!"); + stt->doEmitionBlockButton(true); stt->doEmitionYellowFoundData("Trying to stop. Please, wait..."); } else @@ -2889,7 +2862,7 @@ void nesca_3::MaxBrutingThr_ChangeValue(QString str) void nesca_3::appendRedBAData(QString str) { - ui->BAText->append("" + QString::fromUtf8(str.toLocal8Bit().data()) + ""); + ui->BAText->append("" + QString::fromUtf8(str.toLocal8Bit().data()) + ""); } void nesca_3::appendGreenBAData(QString str) diff --git a/nesca_3.h b/nesca_3.h index d1c67a7..93a07ce 100644 --- a/nesca_3.h +++ b/nesca_3.h @@ -116,6 +116,7 @@ protected: void appendRedBAData(QString str); void STTTerminate(); void drawVerboseArcs(unsigned long gTargets); + void slotBlockButtons(bool value); private: QPoint dragPosition; }; diff --git a/version b/version index af45d4d..644158d 100644 --- a/version +++ b/version @@ -1 +1 @@ -24B94-34 \ No newline at end of file +24B95-4C1 \ No newline at end of file