Multiple fixes.

This commit is contained in:
cora32 2015-04-01 22:23:52 +03:00
parent cd2d41fb75
commit f7dfdb38bb
8 changed files with 167 additions and 165 deletions

View File

@ -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_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut); 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) { if(postData != NULL) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData); 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(); return buffer->size();
} else { } else {
if (res != 28 && if (res != 28 &&
res != 6 &&
res != 7 && res != 7 &&
res != 67 && res != 67 &&
res != 52 && res != 52 &&
@ -208,12 +209,6 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
":" + QString::number(port)); ":" + QString::number(port));
return -2; 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) { else if (res == 18) {
stt->doEmitionFoundData("Inappropriate file size. (" + stt->doEmitionFoundData("Inappropriate file size. (" +
QString::number(res) + ") " + QString(ip) + QString::number(res) + ") " + QString(ip) +

View File

@ -3,6 +3,8 @@
#include "FileUpdater.h" #include "FileUpdater.h"
#include "istream" #include "istream"
bool FileDownloader::running = false;
int getCL(std::string *buffer) { int getCL(std::string *buffer) {
std::size_t pos1 = buffer->find("Content-Length:"); std::size_t pos1 = buffer->find("Content-Length:");
@ -20,32 +22,37 @@ int getCL(std::string *buffer) {
return stoi(res); return stoi(res);
} }
void checkWeb(const char *fileName, long *ptr, void *func(void)) { void checkWeb(const char *fileName, long *ptr) {
std::string buffer; 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<<buffer<<std::endl;
int cl = getCL(&buffer); int cl = getCL(&buffer);
if(cl == -1) return; if(cl == -1) return;
if(cl != *ptr) { if(cl != *ptr) {
QString res(buffer.substr(buffer.find("\r\n\r\n") + 4).c_str());
res.replace("\r\n", "\n");
QTextCodec *codec = QTextCodec::codecForName("Windows-1251");
res = codec->toUnicode(res.toLocal8Bit().data());
std::ofstream out(fileName); std::ofstream out(fileName);
out << buffer.substr(buffer.find("\r\n\r\n") + 4); out << std::string(res.toLocal8Bit().data());
out.close(); out.close();
stt->doEmitionFoundData("<font color=\"Pink\">File " + QString(fileName) + " downloaded.</font>"); stt->doEmitionFoundData("<font color=\"Pink\">File " + QString(fileName) + " downloaded.</font>");
} }
} }
void loadNegatives(){
}
void FileDownloader::checkWebFiles() { void FileDownloader::checkWebFiles() {
//checkWeb("negatives.txt", &FileUpdater::oldNegLstSize, (void*(*)(void))loadNegatives); running = true;
//checkWeb("login.txt", (void*(*)(void))loadLogins); while (globalScanFlag) {
//checkWeb("pass.txt", (void*(*)(void))loadPass); checkWeb("negatives.txt", &FileUpdater::oldNegLstSize);
//checkWeb("sshpass.txt", (void*(*)(void))loadSSHPass); checkWeb("login.txt", &FileUpdater::oldLoginLstSize);
//checkWeb("wflogin.txt", (void*(*)(void))loadWFLogins); checkWeb("pass.txt", &FileUpdater::oldPassLstSize);
//checkWeb("wfpass.txt", (void*(*)(void))loadWFPass); checkWeb("sshpass.txt", &FileUpdater::oldSSHLstSize);
checkWeb("wflogin.txt", &FileUpdater::oldWFLoginLstSize);
checkWeb("wfpass.txt", &FileUpdater::oldWFPassLstSize);
Sleep(600000);
}
running = false;
} }

View File

@ -3,6 +3,7 @@
class FileDownloader { class FileDownloader {
public: public:
static bool running;
static void checkWebFiles(); static void checkWebFiles();
}; };

View File

@ -3,6 +3,7 @@
#include "STh.h" #include "STh.h"
#include "mainResources.h" #include "mainResources.h"
bool FileUpdater::running = false;
long FileUpdater::oldNegLstSize = 0; long FileUpdater::oldNegLstSize = 0;
long FileUpdater::oldLoginLstSize = 0; long FileUpdater::oldLoginLstSize = 0;
long FileUpdater::oldPassLstSize = 0; long FileUpdater::oldPassLstSize = 0;
@ -76,12 +77,7 @@ void ReadUTF8(FILE* nFile, char *cp) {
if(strstr((char*)buffFG, "\n") != 0) if(strstr((char*)buffFG, "\n") != 0)
{ {
std::string res; std::string res = std::string(buffFG);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
res = xcode(buffFG, CP_UTF8, CP_ACP);
#else
res = std::string(buffFG);
#endif
int sz = res.size(); int sz = res.size();
GlobalNegatives[i] = new char[sz + 1]; GlobalNegatives[i] = new char[sz + 1];
ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i])); ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i]));
@ -91,12 +87,7 @@ void ReadUTF8(FILE* nFile, char *cp) {
} }
else else
{ {
std::string res; std::string res = std::string(buffFG);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
res = xcode(buffFG, CP_UTF8, CP_ACP);
#else
res = std::string(buffFG);
#endif
int sz = res.size(); int sz = res.size();
GlobalNegatives[i] = new char[sz + 1]; GlobalNegatives[i] = new char[sz + 1];
ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i])); ZeroMemory(GlobalNegatives[i], sizeof(*GlobalNegatives[i]));
@ -104,14 +95,6 @@ void ReadUTF8(FILE* nFile, char *cp) {
memset(GlobalNegatives[i] + sz, '\0', 1); memset(GlobalNegatives[i] + sz, '\0', 1);
++i; ++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)); ZeroMemory(buffFG, sizeof(buffFG));
}; };
@ -436,11 +419,13 @@ void updateList(const char *fileName, long *szPtr, void *funcPtr(void)) {
} }
void FileUpdater::updateLists() { void FileUpdater::updateLists() {
running = true;
while(globalScanFlag) { while(globalScanFlag) {
Sleep(60000); Sleep(60000);
if(!globalScanFlag) break; if(!globalScanFlag) break;
loadOnce(); loadOnce();
} }
running = false;
} }
void FileUpdater::loadOnce() { void FileUpdater::loadOnce() {

View File

@ -9,6 +9,7 @@
class FileUpdater { class FileUpdater {
public: public:
static bool running;
static long oldNegLstSize; static long oldNegLstSize;
static long oldLoginLstSize; static long oldLoginLstSize;
static long oldPassLstSize; static long oldPassLstSize;

View File

@ -1,14 +1,26 @@
Adapto CMS сайт времен
гарант
парк
телеком
регистрация
недоступен
document.cookie
park
You are not permitted
Adapto CMS
Account unavailable Account unavailable
баланс баланс
средств средств
на вашем счету на вашем счету
абонент абонент
xml-not-well-formed
No session
validator.w3.org
RFB 009 RFB 009
00;39;49mroot: 00;39;49mroot:
Authorization Required Authorization Required
.swf .swf
покуп покуп
yadro.ru yadro.ru
liveinternet liveinternet
#[Dlink] #[Dlink]
@ -42,7 +54,7 @@ Content-Encoding: gzip
no connections allowed no connections allowed
pocket-solution pocket-solution
trustclick trustclick
торг торг
#[/Dlink] #[/Dlink]
530 User access denied 530 User access denied
prelogin prelogin
@ -67,9 +79,9 @@ Defaultpage
502 bad gateway 502 bad gateway
505 http version 505 http version
501 not implemented 501 not implemented
bad request - invalid hostname invalid hostname
http error 400. http error 400
bad request (invalid hostname) 400 ERROR
include_path= include_path=
function.require function.require
failed to open stream failed to open stream
@ -172,7 +184,7 @@ apache_pb.gif
airties airties
aktualizacji aktualizacji
amicaweb amicaweb
Alan Adı Alan Ad?
and supervision tool and supervision tool
annex b annex b
apache http server test apache http server test
@ -301,7 +313,6 @@ drupal
Dreamweaver MX Dreamweaver MX
due to maintance due to maintance
dsnextgen.com dsnextgen.com
dsparking.com
DATA LAN DISK DATA LAN DISK
TEST SITE TEST SITE
eap web interface eap web interface
@ -443,7 +454,6 @@ mobile phone was detected
mobile web viewer mobile web viewer
mobile_viewer_login mobile_viewer_login
mobile login mobile login
Mobile Parking
modem (administrator modem (administrator
m&w m&w
munin munin
@ -493,7 +503,6 @@ pagerrorimg
pagos pagos
CodeIgniter CodeIgniter
parkerad parkerad
parking.
paradox ip module paradox ip module
parallels confixx parallels confixx
parallels operations automation default parallels operations automation default
@ -571,7 +580,6 @@ searchpage.aspx
searchremagnified searchremagnified
secure login page secure login page
securepaynet securepaynet
sedoparking.com
selectkind.html selectkind.html
server application error server application error
server default page server default page
@ -759,15 +767,15 @@ www.sedo.com
xenserver xenserver
CommuniGate Pro CommuniGate Pro
MACROSCOP MACROSCOP
Бухгалтер Бухгалтер
бюджет бюджет
Welcome to WildFly Welcome to WildFly
Welcome to jboss Welcome to jboss
VoIP Router VoIP Router
Can't connect to Can't connect to
xfinity xfinity
строй строй
строит строит
VoIP Telephone VoIP Telephone
This site requires JavaScript This site requires JavaScript
xtreamer xtreamer
@ -777,110 +785,110 @@ your explorer is no support frame
your website your website
yweb yweb
wkrotce wkrotce
азартные игры азартные игры
аккорды аккорды
анекдот анекдот
аптек аптек
архив новостей архив новостей
в стадии разработки в стадии разработки
в разработке в разработке
фильм фильм
film film
Не удается отобразить страницу Не удается отобразить страницу
page does not exist page does not exist
права защищены права защищены
дач дач
дешев дешев
дешёв дешёв
pm2-web pm2-web
доставка доставка
заказать доставку заказать доставку
заработок в сети заработок в сети
знакомства знакомства
истек срок истек срок
карикатуры карикатуры
конкурс конкурс
контакты контакты
кухни кухни
главная страница главная страница
личный кабинет личный кабинет
лотере лотере
международн международн
мода мода
мы предоставляем мы предоставляем
на реконструкции на реконструкции
позже позже
найти работу найти работу
находится в разработке находится в разработке
наш баннер наш баннер
компани компани
низкие цены низкие цены
Некорректный URL Некорректный URL
Невозможно подключиться Невозможно подключиться
новый адрес новый адрес
магаз магаз
о нас о нас
остев остев
партнерк партнерк
перевод текстов перевод текстов
перееха перееха
персональный сайт персональный сайт
пиши пиши
подержан подержан
отключен отключен
профилактические работы профилактические работы
временные неудобства временные неудобства
Неверный ключ Неверный ключ
Seo Seo
подписаться подписаться
поиск работы поиск работы
прикол прикол
продукция продукция
производств производств
процесі розробки процесі розробки
работа в интернете работа в интернете
регистрации доменных регистрации доменных
рекламные ссылки рекламные ссылки
ремонт ремонт
сайт в разработке сайт в разработке
сайт недоступен сайт недоступен
сайт клана сайт клана
скоро запустится скоро запустится
сайт на разработке сайт на разработке
связь с нами связь с нами
скидк скидк
раскрут раскрут
скоро открытие скоро открытие
служба поддержки служба поддержки
создание недорогих сайтов создание недорогих сайтов
создание сайтов создание сайтов
спонсоры спонсоры
стартовая страни стартовая страни
стихи стихи
тестовая страни тестовая страни
технические работы технические работы
услуги услуги
флешки флешки
ошибка ошибка
на хостинге на хостинге
Fatal error: Fatal error:
mc.yandex.ru mc.yandex.ru
UNKNOWN HOST UNKNOWN HOST
host not found host not found
Сайт закрыт Сайт закрыт
?partner ?partner
хокке хокке
добро пожаловать в добро пожаловать в
статусы статусы
высказывани высказывани
флэшки флэшки
футбол футбол
юмор юмор
новости новости
на реконструкции на реконструкции
обновление сайта обновление сайта
офис офис
юридич юридич
страница не найдена страница не найдена
купить купить
прода прода

View File

@ -1730,15 +1730,20 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
} }
void runAuxiliaryThreads() { void runAuxiliaryThreads() {
if (!FileUpdater::running) {
std::thread lpThread(FileUpdater::updateLists); std::thread lpThread(FileUpdater::updateLists);
lpThread.detach(); lpThread.detach();
Sleep(500);
}
if (!FileDownloader::running) {
std::thread fuThread(FileDownloader::checkWebFiles); std::thread fuThread(FileDownloader::checkWebFiles);
fuThread.detach(); fuThread.detach();
}
std::thread trackerThread(_tracker); std::thread trackerThread(_tracker);
trackerThread.detach(); trackerThread.detach();
std::thread timerThread(_timer); std::thread timerThread(_timer);
timerThread.detach(); timerThread.detach();
Sleep(1000); Sleep(500);
std::thread saverThread(_saver); std::thread saverThread(_saver);
saverThread.detach(); saverThread.detach();
} }
@ -1969,7 +1974,7 @@ int startScan(char* args) {
stt->doEmitionYellowFoundData("Starting DNS-scan..."); stt->doEmitionYellowFoundData("Starting DNS-scan...");
stt->doEmitionChangeStatus("Scanning..."); stt->doEmitionChangeStatus("Scanning...");
int y = _GetDNSFromMask(dataEntry, dataEntry, dataEntry); int y = _GetDNSFromMask(dataEntry, "", dataEntry);
if (y == -1) if (y == -1)
{ {
stt->doEmitionRedFoundData("DNS-Mode error"); stt->doEmitionRedFoundData("DNS-Mode error");

View File

@ -1 +1 @@
24B39-75 24B81-7F6