BA check, import-index, curl fixes.

This commit is contained in:
cora32 2015-04-20 22:27:06 +03:00
parent 8f16fd8d16
commit d31f9f70f8
5 changed files with 19 additions and 30 deletions

View File

@ -11,6 +11,7 @@ int BA::checkOutput(const string *buffer, const char *ip, const int port) {
&& Utils::ustrstr(*buffer, "<statusString>Unauthorized</statusString>") == -1 && Utils::ustrstr(*buffer, "<statusString>Unauthorized</statusString>") == -1
&& Utils::ustrstr(*buffer, "íåïðàâèëüíû") == -1 && Utils::ustrstr(*buffer, "íåïðàâèëüíû") == -1
&& Utils::ustrstr(*buffer, "Ð<EFBFBD>еправильнÑ") == -1 && Utils::ustrstr(*buffer, "Ð<EFBFBD>еправильнÑ") == -1
&& Utils::ustrstr(*buffer, "code: \"401\"") == -1 //77.51.196.31:81
) { ) {
return 1; return 1;
} }
@ -38,7 +39,8 @@ int BA::checkOutput(const string *buffer, const char *ip, const int port) {
//http://www.coresecurity.com/advisories/hikvision-ip-cameras-multiple-vulnerabilities 2 //http://www.coresecurity.com/advisories/hikvision-ip-cameras-multiple-vulnerabilities 2
inline bool commenceHikvisionEx1(const char *ip, const int port, bool digestMode) { inline bool commenceHikvisionEx1(const char *ip, const int port, bool digestMode) {
std::string lpString = string("anonymous") + ":" + string("\177\177\177\177\177\177"); //std::string lpString = string("anonymous") + ":" + string("\177\177\177\177\177\177");
std::string lpString = string("anonymous") + ":" + string("123");
string buffer; string buffer;
int res = Connector::nConnect(ip, port, &buffer, NULL, NULL, &lpString, digestMode); int res = Connector::nConnect(ip, port, &buffer, NULL, NULL, &lpString, digestMode);

View File

@ -124,9 +124,9 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
buffer->clear(); buffer->clear();
CURL *curl = curl_easy_init(); CURL *curl = curl_easy_init();
if (curl) if (curl != NULL)
{ {
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0L); curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
if (MapWidgetOpened) { if (MapWidgetOpened) {
struct data config; struct data config;
config.trace_ascii = 1; /* enable ascii tracing */ config.trace_ascii = 1; /* enable ascii tracing */
@ -161,10 +161,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
struct curl_slist *chunk = NULL; struct curl_slist *chunk = NULL;
for(auto &ch : *customHeaders) { for(auto &ch : *customHeaders) chunk = curl_slist_append(chunk, ch.c_str());
chunk = curl_slist_append(chunk, ch.c_str());
}
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
} }

View File

@ -385,6 +385,7 @@ void MainStarter::saveBackupToFile()
FILE *savingFile = fopen("tempIPLst.bk", "w"); FILE *savingFile = fopen("tempIPLst.bk", "w");
if (savingFile != NULL) if (savingFile != NULL)
{ {
if (gflIndex < MainStarter::flCounter) {
sprintf(ipRange, "%s-%d.%d.%d.%d\n", sprintf(ipRange, "%s-%d.%d.%d.%d\n",
currentIP, currentIP,
ipsendfl[gflIndex][0], ipsendfl[gflIndex][0],
@ -392,8 +393,8 @@ void MainStarter::saveBackupToFile()
ipsendfl[gflIndex][2], ipsendfl[gflIndex][2],
ipsendfl[gflIndex][3]); ipsendfl[gflIndex][3]);
fputs(ipRange, savingFile); fputs(ipRange, savingFile);
ZeroMemory(ipRange, sizeof(ipRange)); ZeroMemory(ipRange, sizeof(ipRange));
}
for (int tCounter = gflIndex + 1; tCounter < MainStarter::flCounter; ++tCounter) for (int tCounter = gflIndex + 1; tCounter < MainStarter::flCounter; ++tCounter)
{ {
sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n", sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n",
@ -484,18 +485,8 @@ void MainStarter::saveBackupToFile()
std::string finalSaveStr(saveBuffer); std::string finalSaveStr(saveBuffer);
std::ofstream file("restore"); std::ofstream file("restore");
file << finalSaveStr; if (finalSaveStr.size() > 0) file << finalSaveStr;
ZeroMemory(saveBuffer, strlen(saveBuffer)); ZeroMemory(saveBuffer, strlen(saveBuffer));
/*FILE *savingFile = fopen("restore", "w");
if (savingFile != NULL)
{
fputs(saveBuffer, savingFile);
fclose(savingFile);
}
else stt->doEmitionRedFoundData("[_saver] Cannot open file.");*/
} }
bool saverRunning = false; bool saverRunning = false;

View File

@ -2345,7 +2345,6 @@ int Lexems::filler(char* ip, int port, const std::string *buffcpy, int size, Lex
ps.flag = flag; ps.flag = flag;
char baPath[256] = { 0 }; char baPath[256] = { 0 };
strcpy(baPath, "/");
std::vector<std::string> redirStrLst; std::vector<std::string> redirStrLst;
if (flag == 0 || flag == 3 || flag == 7) if (flag == 0 || flag == 3 || flag == 7)

View File

@ -1 +1 @@
24B93-664 24B94-34