From baefcabbdaf44d0cac4da44828ae823833139ef0 Mon Sep 17 00:00:00 2001 From: cora32 Date: Sun, 24 Jan 2016 22:03:28 +0300 Subject: [PATCH] Multiple fixes, QLikView added. --- BasicAuth.cpp | 1 + Connector.cpp | 2 +- FTPAuth.cpp | 1 + HikvisionLogin.cpp | 2 ++ IPCAuth.cpp | 1 + MainStarter.cpp | 1 - SSHAuth.cpp | 1 + finder.cpp | 55 ++++++++++++++++++++++++++++++---------------- version | 2 +- 9 files changed, 44 insertions(+), 22 deletions(-) diff --git a/BasicAuth.cpp b/BasicAuth.cpp index ce6bbaf..c1179d3 100644 --- a/BasicAuth.cpp +++ b/BasicAuth.cpp @@ -158,6 +158,7 @@ lopaStr BA::BALobby(const char *ip, const int port) { ++baCount; ++BrutingThrds; + stt->doEmitionUpdateArc(gTargets); const lopaStr &lps = BABrute(ip, port); --BrutingThrds; diff --git a/Connector.cpp b/Connector.cpp index e2a68ea..60f93ea 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -286,9 +286,9 @@ void eraser(std::string *buffer, const std::string delim1, const std::string del } } void cutoutComments(std::string *buffer) { + //eraser(buffer, "//", "\n"); //Cant's handle urls: http://bla.bla eraser(buffer, ""); eraser(buffer, "/*", "*/"); - eraser(buffer, "//", "\n"); } int Connector::nConnect(const char* ip, const int port, std::string *buffer, diff --git a/FTPAuth.cpp b/FTPAuth.cpp index 71fc48c..e2cb4f1 100644 --- a/FTPAuth.cpp +++ b/FTPAuth.cpp @@ -98,6 +98,7 @@ lopaStr FTPA::FTPLobby(const char *ip, const int port, PathStr *ps) { ++baCount; ++BrutingThrds; + stt->doEmitionUpdateArc(gTargets); const lopaStr &lps = FTPBrute(ip, port, ps); --BrutingThrds; diff --git a/HikvisionLogin.cpp b/HikvisionLogin.cpp index 26b48de..9f5e77c 100644 --- a/HikvisionLogin.cpp +++ b/HikvisionLogin.cpp @@ -540,6 +540,7 @@ lopaStr HikVis::HVLobby(const char *ip, const int port) { ++baCount; ++BrutingThrds; + stt->doEmitionUpdateArc(gTargets); const lopaStr &lps = hikLogin(ip, port); --BrutingThrds; @@ -558,6 +559,7 @@ lopaStr HikVis::RVILobby(const char *ip, const int port) { ++baCount; ++BrutingThrds; + stt->doEmitionUpdateArc(gTargets); const lopaStr &lps = rviLogin(ip, port); --BrutingThrds; diff --git a/IPCAuth.cpp b/IPCAuth.cpp index 93cf815..6c79c0e 100644 --- a/IPCAuth.cpp +++ b/IPCAuth.cpp @@ -259,6 +259,7 @@ lopaStr IPC::IPCLobby(const char *ip, int port, char *SPEC) { ++baCount; ++BrutingThrds; + stt->doEmitionUpdateArc(gTargets); lopaStr lps = IPCBrute(ip, port, SPEC); --BrutingThrds; diff --git a/MainStarter.cpp b/MainStarter.cpp index 62671a6..eb4e4f1 100644 --- a/MainStarter.cpp +++ b/MainStarter.cpp @@ -908,7 +908,6 @@ void _tracker() { } void verboseProgress(unsigned long target) { - stt->doEmitionUpdateArc(gTargets); if (gTargets > 0) --gTargets; diff --git a/SSHAuth.cpp b/SSHAuth.cpp index 7ca26c0..b3d4bf1 100644 --- a/SSHAuth.cpp +++ b/SSHAuth.cpp @@ -201,6 +201,7 @@ int SSHAuth::SSHLobby(const char *ip, int port, std::string *buffer) if (strlen(sshBanner.c_str()) > 0) { ++BrutingThrds; + stt->doEmitionUpdateArc(gTargets); int res = SSHBrute(ip, port, buffer, sshBanner.c_str()); --BrutingThrds; diff --git a/finder.cpp b/finder.cpp index f815d52..2c47387 100644 --- a/finder.cpp +++ b/finder.cpp @@ -390,10 +390,10 @@ int sharedDetector(const char * ip, int port, const std::string *buffcpy, const if(Utils::ustrstr(buffcpy, "hikvision-webs") != -1 || ( - (Utils::ustrstr(buffcpy, "hikvision digital") != -1 - || Utils::ustrstr(buffcpy, "doc/page/login.asp") != -1) - && Utils::ustrstr(buffcpy, "dvrdvs-webs") != -1) - || (Utils::ustrstr(buffcpy, "lapassword") != -1 + (Utils::ustrstr(buffcpy, "hikvision digital") != -1 || Utils::ustrstr(buffcpy, "doc/page/login.asp") != -1) + && Utils::ustrstr(buffcpy, "dvrdvs-webs") != -1 || Utils::ustrstr(buffcpy, "app-webs") != -1) + || + (Utils::ustrstr(buffcpy, "lapassword") != -1 && Utils::ustrstr(buffcpy, "lausername") != -1 && Utils::ustrstr(buffcpy, "dologin()") != -1) ) return 34; //hikvision cam @@ -462,6 +462,8 @@ int sharedDetector(const char * ip, int port, const std::string *buffcpy, const if (Utils::ustrstr(buffcpy, "dvr_remember") != -1 && Utils::ustrstr(buffcpy, "login_chk_usr_pwd") != -1 ) return 57; //Network video client (http://203.190.113.54:60001/) + if (Utils::ustrstr(buffcpy, "QlikView") != -1) return 58; //QLikView (http://203.96.113.183/qlikview/login.htm) + //if (Utils::ustrstr(buffcpy, "ShareCenter") != -1) return 58; //ShareCenter (http://49.50.207.6/) if (Utils::ustrstr(buffcpy, "nas - ") != -1 @@ -2724,22 +2726,33 @@ bool jsRedirectHandler(std::string *buff, char* ip, int port, Lexems *counter) { std::string subLocation = subRedirect.substr(quotePosFirst + 1, quotePosSecond - quotePosFirst - 1); std::string location = ""; if (-1 != STRSTR((const std::string *) &buffcpy, "http")) { - if (-1 != STRSTR((const std::string *) &buffcpy, "https")) { - location += "https://"; - } - else if (-1 != STRSTR((const std::string *) &buffcpy, "http")) { - location += "http://"; - } +// /*if (-1 != STRSTR((const std::string *) &buffcpy, "https")) { +// location += "https://"; +// } +// else if (-1 != STRSTR((const std::string *) &buffcpy, "http")) { +// location += "http://"; +// } +//*/ +// int quotePosSecond2 = subLocation.find_first_of(";\n", quotePosFirst + 1); +// std::string redirectLine = subLocation.substr(quotePosFirst + 1, quotePosSecond2 - (quotePosFirst + 1)); +// int posFinalAddition = redirectLine.find_last_of("+"); +// std::string finalAddition = redirectLine.substr(posFinalAddition + 1); +// int pos1 = finalAddition.find_first_of("'\""); +// int pos2 = finalAddition.find_first_of("'\"", pos1 + 1); +// +// std::string path = finalAddition.substr(pos1 + 1, pos2 - (pos1 + 1)); + //location += std::string(ip) + "/" + path; - int quotePosSecond2 = subRedirect.find_first_of(";\n", quotePosFirst + 1); - std::string redirectLine = subRedirect.substr(quotePosFirst + 1, quotePosSecond2 - (quotePosFirst + 1)); - int posFinalAddition = redirectLine.find_last_of("+"); - std::string finalAddition = redirectLine.substr(posFinalAddition + 1); - int pos1 = finalAddition.find_first_of("'\""); - int pos2 = finalAddition.find_first_of("'\"", pos1 + 1); - - std::string path = finalAddition.substr(pos1 + 1, pos2 - (pos1 + 1)); - location += std::string(ip) + "/" + path; + int portDelim = subLocation.find(":", 7); + if (-1 != portDelim) { + std::string portString = subLocation.substr(portDelim + 1); + int trimPos = portString.find("/"); + if (-1 != trimPos) { + portString = portString.substr(0, trimPos); + } + port = std::stoi(portString); + } + location = subLocation; } else { location = std::string(ip) + (subLocation[0] == '/' ? "" : "/") + subLocation; @@ -3133,6 +3146,10 @@ void parseFlag(int flag, char* ip, int port, int size, const std::string &header { _specWEBIPCAMBrute(ip, port, "[JUAN] WEB IP Camera", flag, "WEB Authorization", cp, size, "JUAN"); } + else if (flag == 58) //QLikView + { + _specBrute(ip, port, "[QLikView] IP Camera", flag, "/QvAJAXZfc/Authenticate.aspx?_=1453661324640", "Basic Authorization", cp, size); + } else if (flag == 20) //AXIS Camera { if (_specBrute(ip, port, "AXIS Camera", flag, "/mjpg/video.mjpg", "Basic Authorization", cp, size) == -1) { diff --git a/version b/version index a187fb3..f5021a8 100644 --- a/version +++ b/version @@ -1 +1 @@ -2716B-2E6 \ No newline at end of file +2716B-167 \ No newline at end of file