Skip to content

Commit

Permalink
Revert "revert"
Browse files Browse the repository at this point in the history
This reverts commit 80795af.
  • Loading branch information
cora32 committed Jan 7, 2016
1 parent 4a87299 commit 4609949
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
5 changes: 5 additions & 0 deletions Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ int pConnect(const char* ip, const int port, std::string *buffer,
|| res == CURLE_SEND_ERROR
|| res == CURLE_RECV_ERROR
) {
if (gNegDebugMode)
{
stt->doEmitionDebugFoundData("NConnect failed (curl_code: " + QString::number(res) + ") [<a href=\"" + QString(ip) +
"/\"><font color=\"#0084ff\">" + QString(ip) + " Port:" + QString::number(port) + "</font></a>]");
}
SOCKET eNobuffSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
shutdown(eNobuffSocket, SD_BOTH);
closesocket(eNobuffSocket);
Expand Down
2 changes: 1 addition & 1 deletion externData.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern QJsonArray *jsonArr;

extern unsigned long long gTargetsNumber;
extern long long unsigned int gTargets;
extern std::atomic<int> cons(0), BrutingThrds(0), gThreads(0);
extern std::atomic<int> cons, BrutingThrds, gThreads;
extern char **loginLst, **passLst,
**wfLoginLst, **wfPassLst,
**ftpLoginLst, **ftpPassLst,
Expand Down
35 changes: 17 additions & 18 deletions finder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,17 +584,16 @@ void fillGlobalLogData(const char *ip, int port, const char *sz, const char *tit
};
}


int __checkFileExistence(int flag)
{
char fileName[64] = {0};

if (flag == -22) sprintf(fileName, "./result_files-%s/" TYPE5 ".html", Utils::getStartDate().c_str());
else if (flag == 0 || flag == 15 || flag == -10) sprintf(fileName, "./result_files-%s/" TYPE1 ".html", Utils::getStartDate().c_str());
else if (flag == 3) sprintf(fileName, "./result_files-%s/" TYPE2 ".html", Utils::getStartDate().c_str());
else if (flag == 16) sprintf(fileName, "./result_files-%s/" TYPE4 ".html", Utils::getStartDate().c_str());
if (flag == -22) sprintf(fileName, "./result_files-%s/"TYPE5".html", Utils::getStartDate().c_str());
else if (flag == 0 || flag == 15 || flag == -10) sprintf(fileName, "./result_files-%s/"TYPE1".html", Utils::getStartDate().c_str());
else if (flag == 3) sprintf(fileName, "./result_files-%s/"TYPE2".html", Utils::getStartDate().c_str());
else if (flag == 16) sprintf(fileName, "./result_files-%s/"TYPE4".html", Utils::getStartDate().c_str());
else if(flag >= 17 || flag == 11 || flag == 12
|| flag == 13 || flag == 14 || flag == 1) sprintf(fileName, "./result_files-%s/" TYPE3 ".html", Utils::getStartDate().c_str());
|| flag == 13 || flag == 14 || flag == 1) sprintf(fileName, "./result_files-%s/"TYPE3".html", Utils::getStartDate().c_str());

FILE *f = fopen(fileName, "r");
if(f == NULL) return true;
Expand All @@ -619,33 +618,33 @@ void fputsf(char *text, int flag, char *msg)
if(flag == 0 || flag == 15 || flag == -10)
{
if (ftsCameras) ftsCameras = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/" TYPE1 ".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/"TYPE1".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag == 1)
{
if(ftsOther) ftsOther = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/" TYPE2 ".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/"TYPE2".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag == -22)
{
if(ftsSSH) ftsSSH = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/" TYPE5 ".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/"TYPE5".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag == 3)
{
if(ftsFTP) ftsFTP = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/" TYPE4 ".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/"TYPE4".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else if(flag >= 17 || flag == 11 || flag == 12
|| flag == 13 || flag == 14 || flag == 2
)
{
if(ftsBA) ftsBA = __checkFileExistence(flag);
sprintf(fileName, "./result_files-%s/" TYPE3 ".html", Utils::getStartDate().c_str());
sprintf(fileName, "./result_files-%s/"TYPE3".html", Utils::getStartDate().c_str());
file = fopen(fileName, "a");
}
else stt->doEmitionRedFoundData("Unknown flag [FLAG: " + QString::number(flag) + "]");
Expand Down Expand Up @@ -703,7 +702,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsCameras = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE1 "</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE1"</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
Expand All @@ -713,7 +712,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsOther = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE2 "</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE2"</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
Expand All @@ -723,7 +722,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsOther = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE5 "</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE5"</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
Expand All @@ -733,7 +732,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsFTP = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE4 "</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE4"</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
Expand All @@ -743,7 +742,7 @@ void fputsf(char *text, int flag, char *msg)
{
char tmsg[1024] = {0};
ftsBA = false;
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" TYPE3 "</title>");
strcpy(tmsg, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>"TYPE3"</title>");
strcat(tmsg, msg);
strcat(tmsg, HTTP_FILE_STYLE);
fputs (tmsg, file);
Expand All @@ -767,8 +766,8 @@ void fputsf(char *text, int flag, char *msg)
};
}

#define REDIRECT_PIC "<img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAIAAAB/FOjAAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA7SURBVHjaYmIgEbAA8f///4lUzcjIyILMAxE4lMINZUEWAxE4DIazmcjxA6YxRGkg0ussxJsNAQABBgDDuAwgjmnSVwAAAABJRU5ErkJggg=='/>"
#define PEKO_PIC "<a href='[PEKO]'><img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAIAAAB/FOjAAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABASURBVHjaYmAgETAC8Yd1fESqFgj6BNLw//9/Yo1nZGSBsPg/SgHJTwLPiXISSTYQpe4/BIHNZSHJBnIAQIABAEhuFAfSpDW+AAAAAElFTkSuQmCC'/></a>"
#define REDIRECT_PIC "<img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAESSURBVHjaYvj//z8DEPxnBBEgFkAAMUJFGBgOHToEYv0HCCAGkAiMA6KZGBjgKhjs7OwYAAKIAWYKCMP0w5WDaBaQUmTABNaHBAACCMUMkDa49VAzWRgZGf/DjDlha8dQxohwBUgO7CyYsTBJZAD3Gkg1uiRQjhEggLAqAEnA2CzIkjC3wPhgE6CuhzvS4jCEDXIXzCS417r+M/xHDymUwAX5Aj3kUEzAhuFRia4T5gawN3GFAYgGCNA3FZgAAIKwiq7vrR4LI3MuTZBAnYpbTQrUszHsiOl8RFxFKeLYc0cGS9E4UeQX844pnrL1Wq0JA6+esQHbBk15y9fclaMVn6aQT9WY8RrRaF8Z1wp4Z5mrLRz17qdV1HtPAAAAAElFTkSuQmCC'/>"
#define PEKO_PIC "<a href='[PEKO]'><img src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADkSURBVHjaYvj//z8DEECIQ4cO/QcIIEaoCANcBCCAwCKHDx+GCzMxIAE7OzsGgABiQDLlP4jNwsjICNILVgFiM4AMgqkAYUao6XAzAAIIxQyQamQdIDkmZDNhAMQHYZAcE8wodEUwAPca2EVoACjHCBBAWBWAJGBsFmRJFP/BTED2FnowgRQwoYQbEhvFF8jGo7OZGHAAmIlM6MZj9SauMADRAAGGkgawKcRlMkpII2vEFSXYQgMejsRqxmYIRjDCJNFpZDbBYMYWqrhSHEoYkOoFnKkRm2HorsIajYSiEzn6YAAAuoS1lVGw2nsAAAAASUVORK5CYII='/></a>"

void putInFile(int flag, const char *ip, int port, int size, const char *finalstr, char *cp)
{
Expand Down
10 changes: 5 additions & 5 deletions mainResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ typedef int BOOL;
a{color: gray;text-decoration: underline;} \
a:focus{ outline-style: dashed;outline-width:1px; outline-color: red;}</style>"

#define HTTP_FILE_HEADER "<div id=\"tit\"><a href=\"" TYPE1 ".html\">." TYPE1 "</a> \
<a href=\"" TYPE2 ".html\">." TYPE2 "</a> \
<a href=\"" TYPE3 ".html\">." TYPE3 "</a> \
<a href=\"" TYPE4 ".html\">." TYPE4 "</a> \
<a href=\"" TYPE5 ".html\">." TYPE5 "</a> \
#define HTTP_FILE_HEADER "<div id=\"tit\"><a href=\""TYPE1".html\">."TYPE1"</a> \
<a href=\""TYPE2".html\">."TYPE2"</a> \
<a href=\""TYPE3".html\">."TYPE3"</a> \
<a href=\""TYPE4".html\">."TYPE4"</a> \
<a href=\""TYPE5".html\">."TYPE5"</a> \
</div><br><br>"

#ifndef MAX_ADDR_LEN
Expand Down
1 change: 1 addition & 0 deletions nesca_3.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/nesca_3">
<file>small_font.ttf</file>
<file>xc.jpg</file>
<file>nesca.ico</file>
</qresource>
</RCC>

0 comments on commit 4609949

Please sign in to comment.