diff --git a/Connector.cpp b/Connector.cpp index dd62679..c21e38b 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -151,7 +151,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, } curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut + 5); if(postData != NULL) { curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData); @@ -186,6 +186,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, return buffer->size(); } else { if (res != 28 && + res != 6 && res != 7 && res != 67 && res != 52 && @@ -208,12 +209,6 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer, ":" + QString::number(port)); return -2; } - else if (res == 6) { - stt->doEmitionFoundData("Couldn't resolve host. (" + - QString::number(res) + ") " + QString(ip) + - ":" + QString::number(port)); - return -2; - } else if (res == 18) { stt->doEmitionFoundData("Inappropriate file size. (" + QString::number(res) + ") " + QString(ip) + diff --git a/FileDownloader.cpp b/FileDownloader.cpp index fa1bdd0..c026590 100644 --- a/FileDownloader.cpp +++ b/FileDownloader.cpp @@ -3,6 +3,8 @@ #include "FileUpdater.h" #include "istream" +bool FileDownloader::running = false; + int getCL(std::string *buffer) { std::size_t pos1 = buffer->find("Content-Length:"); @@ -20,32 +22,37 @@ int getCL(std::string *buffer) { return stoi(res); } -void checkWeb(const char *fileName, long *ptr, void *func(void)) { +void checkWeb(const char *fileName, long *ptr) { std::string buffer; - Connector::nConnect(std::string("localhost/nesca/" + std::string(fileName)).c_str(), 8080, &buffer); + Connector::nConnect(std::string("http://nesca.d3w.org/files/" + std::string(fileName)).c_str(), 80, &buffer); - std::cout<toUnicode(res.toLocal8Bit().data()); + std::ofstream out(fileName); + out << std::string(res.toLocal8Bit().data()); out.close(); stt->doEmitionFoundData("File " + QString(fileName) + " downloaded."); } } -void loadNegatives(){ -} - void FileDownloader::checkWebFiles() { - //checkWeb("negatives.txt", &FileUpdater::oldNegLstSize, (void*(*)(void))loadNegatives); - //checkWeb("login.txt", (void*(*)(void))loadLogins); - //checkWeb("pass.txt", (void*(*)(void))loadPass); - //checkWeb("sshpass.txt", (void*(*)(void))loadSSHPass); - //checkWeb("wflogin.txt", (void*(*)(void))loadWFLogins); - //checkWeb("wfpass.txt", (void*(*)(void))loadWFPass); + running = true; + while (globalScanFlag) { + checkWeb("negatives.txt", &FileUpdater::oldNegLstSize); + checkWeb("login.txt", &FileUpdater::oldLoginLstSize); + checkWeb("pass.txt", &FileUpdater::oldPassLstSize); + checkWeb("sshpass.txt", &FileUpdater::oldSSHLstSize); + checkWeb("wflogin.txt", &FileUpdater::oldWFLoginLstSize); + checkWeb("wfpass.txt", &FileUpdater::oldWFPassLstSize); + Sleep(600000); + } + running = false; } diff --git a/FileDownloader.h b/FileDownloader.h index 6bb6a7d..73eaea6 100644 --- a/FileDownloader.h +++ b/FileDownloader.h @@ -3,6 +3,7 @@ class FileDownloader { public: + static bool running; static void checkWebFiles(); }; diff --git a/FileUpdater.cpp b/FileUpdater.cpp index abd3032..d1e8fe7 100644 --- a/FileUpdater.cpp +++ b/FileUpdater.cpp @@ -3,6 +3,7 @@ #include "STh.h" #include "mainResources.h" +bool FileUpdater::running = false; long FileUpdater::oldNegLstSize = 0; long FileUpdater::oldLoginLstSize = 0; long FileUpdater::oldPassLstSize = 0; @@ -76,12 +77,7 @@ void ReadUTF8(FILE* nFile, char *cp) { if(strstr((char*)buffFG, "\n") != 0) { - std::string res; -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) - res = xcode(buffFG, CP_UTF8, CP_ACP); -#else - res = std::string(buffFG); -#endif + std::string res = std::string(buffFG); int sz = res.size(); GlobalNegatives[i] = new char[sz + 1]; ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i])); @@ -91,12 +87,7 @@ void ReadUTF8(FILE* nFile, char *cp) { } else { - std::string res; -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) - res = xcode(buffFG, CP_UTF8, CP_ACP); -#else - res = std::string(buffFG); -#endif + std::string res = std::string(buffFG); int sz = res.size(); GlobalNegatives[i] = new char[sz + 1]; ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i])); @@ -104,14 +95,6 @@ void ReadUTF8(FILE* nFile, char *cp) { memset(GlobalNegatives[i] + sz, '\0', 1); ++i; }; - - unsigned char buffcpy2[256] = {0}; - int sz = strlen((char*)buffFG); -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) - strncpy((char*)buffcpy2, xcode(buffFG, CP_ACP, CP_UTF8).c_str(), sz); -#else - strncpy((char*)buffcpy2, buffFG, sz); -#endif ZeroMemory(buffFG, sizeof(buffFG)); }; @@ -436,11 +419,13 @@ void updateList(const char *fileName, long *szPtr, void *funcPtr(void)) { } void FileUpdater::updateLists() { + running = true; while(globalScanFlag) { Sleep(60000); if(!globalScanFlag) break; loadOnce(); } + running = false; } void FileUpdater::loadOnce() { diff --git a/FileUpdater.h b/FileUpdater.h index 5f37bc4..fbc386d 100644 --- a/FileUpdater.h +++ b/FileUpdater.h @@ -9,6 +9,7 @@ class FileUpdater { public: + static bool running; static long oldNegLstSize; static long oldLoginLstSize; static long oldPassLstSize; diff --git a/negatives.txt b/negatives.txt index 31f8dad..c40c104 100644 --- a/negatives.txt +++ b/negatives.txt @@ -1,14 +1,26 @@ -Adapto CMS + + + + + + +document.cookie +park +You are not permitted +Adapto CMS Account unavailable -баланс -средств -на вашем счету -абонент + + + + +xml-not-well-formed +No session +validator.w3.org RFB 009 00;39;49mroot: Authorization Required .swf -покуп + yadro.ru liveinternet #[Dlink] @@ -42,7 +54,7 @@ Content-Encoding: gzip no connections allowed pocket-solution trustclick -торг + #[/Dlink] 530 User access denied prelogin @@ -67,9 +79,9 @@ Defaultpage 502 bad gateway 505 http version 501 not implemented -bad request - invalid hostname -http error 400. -bad request (invalid hostname) +invalid hostname +http error 400 +400 ERROR include_path= function.require failed to open stream @@ -172,7 +184,7 @@ apache_pb.gif airties aktualizacji amicaweb -Alan Adı +Alan Ad? and supervision tool annex b apache http server test @@ -301,7 +313,6 @@ drupal Dreamweaver MX due to maintance dsnextgen.com -dsparking.com DATA LAN DISK TEST SITE eap web interface @@ -443,7 +454,6 @@ mobile phone was detected mobile web viewer mobile_viewer_login mobile login -Mobile Parking modem (administrator m&w munin @@ -493,7 +503,6 @@ pagerrorimg pagos CodeIgniter parkerad -parking. paradox ip module parallels confixx parallels operations automation default @@ -571,7 +580,6 @@ searchpage.aspx searchremagnified secure login page securepaynet -sedoparking.com selectkind.html server application error server default page @@ -759,15 +767,15 @@ www.sedo.com xenserver CommuniGate Pro MACROSCOP -Бухгалтер -бюджет + + Welcome to WildFly Welcome to jboss VoIP Router Can't connect to xfinity -строй -строит + + VoIP Telephone This site requires JavaScript xtreamer @@ -777,110 +785,110 @@ your explorer is no support frame your website yweb wkrotce -азартные игры -аккорды -анекдот -аптек -архив новостей -в стадии разработки -в разработке -фильм + + + + + + + + film -Не удается отобразить страницу + page does not exist -права защищены -дач -дешев -дешёв + + + + pm2-web -доставка -заказать доставку -заработок в сети -знакомства -истек срок -карикатуры -конкурс -контакты -кухни -главная страница -личный кабинет -лотере -международн -мода -мы предоставляем -на реконструкции -позже -найти работу -находится в разработке -наш баннер -компани -низкие цены -Некорректный URL -Невозможно подключиться -новый адрес -магаз -о нас -остев -партнерк -перевод текстов -перееха -персональный сайт -пиши -подержан -отключен -профилактические работы -временные неудобства -Неверный ключ + + + + + + + + + + + + + + + + + + + + + + + URL + + + + + + + + + + + + + + + Seo -подписаться -поиск работы -прикол -продукция -производств -процесі розробки -работа в интернете -регистрации доменных -рекламные ссылки -ремонт -сайт в разработке -сайт недоступен -сайт клана -скоро запустится -сайт на разработке -связь с нами -скидк -раскрут -скоро открытие -служба поддержки -создание недорогих сайтов -создание сайтов -спонсоры -стартовая страни -стихи -тестовая страни -технические работы -услуги -флешки -ошибка -на хостинге + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fatal error: mc.yandex.ru UNKNOWN HOST host not found -Сайт закрыт + ?partner -хокке -добро пожаловать в -статусы -высказывани -флэшки -футбол -юмор -новости -на реконструкции -обновление сайта -офис -юридич -страница не найдена -купить -прода \ No newline at end of file + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index b2e3a23..29caa33 100644 --- a/nesca_startModule.cpp +++ b/nesca_startModule.cpp @@ -1730,15 +1730,20 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) { } void runAuxiliaryThreads() { - std::thread lpThread(FileUpdater::updateLists); - lpThread.detach(); - std::thread fuThread(FileDownloader::checkWebFiles); - fuThread.detach(); + if (!FileUpdater::running) { + std::thread lpThread(FileUpdater::updateLists); + lpThread.detach(); + Sleep(500); + } + if (!FileDownloader::running) { + std::thread fuThread(FileDownloader::checkWebFiles); + fuThread.detach(); + } std::thread trackerThread(_tracker); trackerThread.detach(); std::thread timerThread(_timer); timerThread.detach(); - Sleep(1000); + Sleep(500); std::thread saverThread(_saver); saverThread.detach(); } @@ -1969,7 +1974,7 @@ int startScan(char* args) { stt->doEmitionYellowFoundData("Starting DNS-scan..."); stt->doEmitionChangeStatus("Scanning..."); - int y = _GetDNSFromMask(dataEntry, dataEntry, dataEntry); + int y = _GetDNSFromMask(dataEntry, "", dataEntry); if (y == -1) { stt->doEmitionRedFoundData("DNS-Mode error"); diff --git a/version b/version index f0c4d22..30f772b 100644 --- a/version +++ b/version @@ -1 +1 @@ -24B39-75 \ No newline at end of file +24B81-7F6 \ No newline at end of file