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, "íåïðàâèëüíû") == -1
&& Utils::ustrstr(*buffer, "Ð<EFBFBD>еправильнÑ") == -1
&& Utils::ustrstr(*buffer, "code: \"401\"") == -1 //77.51.196.31:81
) {
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
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;
int res = Connector::nConnect(ip, port, &buffer, NULL, NULL, &lpString, digestMode);

View File

@ -122,11 +122,11 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
const std::string *lpString,
bool digestMode){
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) {
struct data config;
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;
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);
}

View File

@ -385,15 +385,16 @@ void MainStarter::saveBackupToFile()
FILE *savingFile = fopen("tempIPLst.bk", "w");
if (savingFile != NULL)
{
sprintf(ipRange, "%s-%d.%d.%d.%d\n",
currentIP,
ipsendfl[gflIndex][0],
ipsendfl[gflIndex][1],
ipsendfl[gflIndex][2],
ipsendfl[gflIndex][3]);
fputs(ipRange, savingFile);
ZeroMemory(ipRange, sizeof(ipRange));
if (gflIndex < MainStarter::flCounter) {
sprintf(ipRange, "%s-%d.%d.%d.%d\n",
currentIP,
ipsendfl[gflIndex][0],
ipsendfl[gflIndex][1],
ipsendfl[gflIndex][2],
ipsendfl[gflIndex][3]);
fputs(ipRange, savingFile);
ZeroMemory(ipRange, sizeof(ipRange));
}
for (int tCounter = gflIndex + 1; tCounter < MainStarter::flCounter; ++tCounter)
{
sprintf(ipRange, "%d.%d.%d.%d-%d.%d.%d.%d\n",
@ -484,18 +485,8 @@ void MainStarter::saveBackupToFile()
std::string finalSaveStr(saveBuffer);
std::ofstream file("restore");
file << finalSaveStr;
if (finalSaveStr.size() > 0) file << finalSaveStr;
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;

View File

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

View File

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