Skip to content

Commit

Permalink
Multiple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cora32 committed Aug 30, 2015
1 parent 726bb1a commit f1d0e32
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 65 deletions.
27 changes: 18 additions & 9 deletions Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,23 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
if (MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(buffer->c_str()));
Activity += sz;
return sz;
} else {
}
else if (res == CURLE_LOGIN_DENIED && port == 21) {
return -1;
}
else if (res == CURLE_OPERATION_TIMEDOUT
|| res == CURLE_COULDNT_CONNECT
|| res == CURLE_SEND_ERROR
|| res == CURLE_RECV_ERROR
) {
return -1;
}
else {
if (res == 6) return -2;
else if (res != 28 &&
res != 7 &&
res != 13 &&
else if (res != 13 &&
res != 67 &&
res != 52 &&
res != 56 &&
res != 55 &&
res != 35 &&
res != 19 &&
res != 23)
Expand All @@ -234,10 +242,11 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
QString(ip) + ":" + QString::number(port));
};

if (res == 23 && sz > 0) {
return sz;
}
else return -1;
//if (res == 23 && sz > 0) {
// return sz;
//}
return sz;
//else return -1;
}

if (MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(buffer->c_str()));
Expand Down
10 changes: 10 additions & 0 deletions IPCAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
{
negVector.push_back("/error.asp");
}
else if (strcmp(SPEC, "JUAN") == 0)
{
negVector.push_back("errno=\"4\"");
}
else
{
stt->doEmitionRedFoundData("[_IPCameraBrute] No \"SPEC\" specified!");
Expand Down Expand Up @@ -174,6 +178,12 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
sprintf(request, "%s:%d/webs/httplogin?username=%s&password=%s&UserID=45637757",
ip, port, login, pass);
}
else if (strcmp(SPEC, "JUAN") == 0)
{
//sprintf(request, "%s:%d/cgi-bin/gw.cgi?xml=<juan ver=\"\" squ=\"\" dir=\"\"><envload type=\"0\" usr=\"%s\" pwd=\"%s\"/></juan>&_=1450923182693",
sprintf(request, "%s:%d/cgi-bin/gw.cgi?xml=%%3Cjuan%%20ver=%%22%%22%%20squ=%%22%%22%%20dir=%%22%%22%%3E%%3Cenvload%%20type=%%220%%22%%20usr=%%22%s%%22%%20pwd=%%22%s%%22/%%3E%%3C/juan%%3E&_=1450923182693",
ip, port, login, pass);
}

std::string buffer;
Connector con;
Expand Down
2 changes: 2 additions & 0 deletions Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <vector>
#include <qdatetime.h>

#define STRSTR(buff, str) Utils::ustrstr(buff, str)

using namespace std;

template<typename charT>
Expand Down
Loading

0 comments on commit f1d0e32

Please sign in to comment.