mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 18:52:19 +00:00
File accessibility bug fixed.
This commit is contained in:
parent
15040efe40
commit
10e605d5ae
@ -51,7 +51,7 @@ public:
|
|||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||||
CreateDirectoryA(RESULT_DIR_NAME, NULL);
|
bool res = CreateDirectoryA(RESULT_DIR_NAME, NULL);
|
||||||
#else
|
#else
|
||||||
struct stat str = { 0 };
|
struct stat str = { 0 };
|
||||||
if (stat(RESULT_DIR_NAME, &str) == -1) {
|
if (stat(RESULT_DIR_NAME, &str) == -1) {
|
||||||
|
84
finder.cpp
84
finder.cpp
@ -516,7 +516,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
else if(flag == 7)
|
else if(flag == 7)
|
||||||
{
|
{
|
||||||
if(ftsLL) ftsLL = __checkFileExistence(flag);
|
if(ftsLL) ftsLL = __checkFileExistence(flag);
|
||||||
file = fopen(RESULT_DIR_NAME"/low_loads.html", "a");
|
file = fopen(RESULT_DIR_NAME"/low_loads.html", "a");
|
||||||
}
|
}
|
||||||
else if(flag == 10)
|
else if(flag == 10)
|
||||||
{
|
{
|
||||||
@ -535,10 +535,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
if(ftsBA) ftsBA = __checkFileExistence(flag);
|
if(ftsBA) ftsBA = __checkFileExistence(flag);
|
||||||
file = fopen(RESULT_DIR_NAME"/Basicauth.html", "a");
|
file = fopen(RESULT_DIR_NAME"/Basicauth.html", "a");
|
||||||
}
|
}
|
||||||
else
|
else stt->doEmitionRedFoundData("[WUT!?] Unknown flag [FLAG: " + QString::number(flag) + "]");
|
||||||
{
|
|
||||||
stt->doEmitionRedFoundData("[WUT!?] Unknown flag [FLAG: " + QString::number(flag) + "]");
|
|
||||||
};
|
|
||||||
|
|
||||||
if(file != NULL)
|
if(file != NULL)
|
||||||
{
|
{
|
||||||
@ -558,8 +555,10 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
strcat(delimiter, "</font></h5></center><hr>");
|
strcat(delimiter, "</font></h5></center><hr>");
|
||||||
fputs (delimiter, file);
|
fputs (delimiter, file);
|
||||||
};
|
};
|
||||||
|
|
||||||
++saved;
|
++saved;
|
||||||
char *string = new char[strlen(text) + 512];
|
char *string = new char[strlen(text) + 512];
|
||||||
|
|
||||||
if(flag != -22)
|
if(flag != -22)
|
||||||
{
|
{
|
||||||
strcpy (string, "<div id=\"ipd\" style=\"color:#707070;text-decoration: none;\">");
|
strcpy (string, "<div id=\"ipd\" style=\"color:#707070;text-decoration: none;\">");
|
||||||
@ -680,7 +679,7 @@ void fputsf(char *text, int flag, char *msg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stt->doEmitionRedFoundData("Cannot open file [FLAG: " + QString::number(flag) + "]");
|
stt->doEmitionRedFoundData("Cannot open file [FLAG: " + QString::number(flag) + "] " + QString::number(GetLastError()));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2158,7 +2157,7 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps, std::vector<std::string> *redirStrLst, int size)
|
int Lexems::_header(char *ip, int port, const char *str, Lexems *l, PathStr *ps, std::vector<std::string> *redirStrLst, int size)
|
||||||
{
|
{
|
||||||
std::string redirectStr = "";
|
std::string redirectStr = "";
|
||||||
|
|
||||||
@ -2187,12 +2186,8 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
&& strstr(str, "company") == NULL
|
&& strstr(str, "company") == NULL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (strstr(str, "CgiStart?page=Single") != NULL) {
|
if (strstr(str, "CgiStart?page=Single") != NULL) strcpy(ps->headr, "[IP Camera (Unibrowser)]");
|
||||||
strcpy(ps->headr, "[IP Camera (Unibrowser)]");
|
else strcpy(ps->headr, "[IP Camera]");
|
||||||
}
|
|
||||||
else {
|
|
||||||
strcpy(ps->headr, "[IP Camera]");
|
|
||||||
}
|
|
||||||
l->flag = 0;
|
l->flag = 0;
|
||||||
ps->flag = 0;
|
ps->flag = 0;
|
||||||
};
|
};
|
||||||
@ -2251,6 +2246,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
strncpy(temp3, (char*)(temp + 4), sz < 128 ? sz : 127);
|
strncpy(temp3, (char*)(temp + 4), sz < 128 ? sz : 127);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if(strstri(temp3, "http://") == NULL && strstri(temp3, "https://") == NULL)
|
if(strstri(temp3, "http://") == NULL && strstri(temp3, "https://") == NULL)
|
||||||
{
|
{
|
||||||
if(temp3[0] != '.')
|
if(temp3[0] != '.')
|
||||||
@ -2369,8 +2365,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
if(ps->flag >= 17 || ps->flag == 11 || ps->flag == 12
|
if(ps->flag >= 17 || ps->flag == 11 || ps->flag == 12
|
||||||
|| ps->flag == 13 || ps->flag == 14 || ps->flag == 1
|
|| ps->flag == 13 || ps->flag == 14 || ps->flag == 1
|
||||||
|| ps->flag == 10
|
|| ps->flag == 10
|
||||||
)
|
) return -2;
|
||||||
return -2;
|
|
||||||
else if(ps->flag == -1) return -1;
|
else if(ps->flag == -1) return -1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -2379,25 +2374,13 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
if(strstri(str, "ActiveXObject") != NULL
|
if(strstri(str, "ActiveXObject") != NULL
|
||||||
|| strstri(str, ".cab") != NULL
|
|| strstri(str, ".cab") != NULL
|
||||||
|| strstri(str, "clsid:") != NULL
|
|| strstri(str, "clsid:") != NULL
|
||||||
)
|
) strcat(ps->headr, "[ActiveX]");
|
||||||
{
|
|
||||||
strcat(ps->headr, "[ActiveX]");
|
|
||||||
};
|
|
||||||
|
|
||||||
if(strstri(str, "<applet") != NULL
|
if(strstri(str, "<applet") != NULL
|
||||||
&& strstri(str, ".jar") != NULL
|
&& strstri(str, ".jar") != NULL
|
||||||
)
|
) strcat(ps->headr, "[Java]");
|
||||||
{
|
if(strstri(str, "<script") != NULL) strcat(ps->headr, "[Javascript]");
|
||||||
strcat(ps->headr, "[Java]");
|
if(strstri(str, "<video") != NULL) strcat(ps->headr, "[Video]");
|
||||||
};
|
|
||||||
if(strstri(str, "<script") != NULL)
|
|
||||||
{
|
|
||||||
strcat(ps->headr, "[Javascript]");
|
|
||||||
};
|
|
||||||
if(strstri(str, "<video") != NULL)
|
|
||||||
{
|
|
||||||
strcat(ps->headr, "[Video]");
|
|
||||||
};
|
|
||||||
|
|
||||||
if(strstri(str, "<frameset") != NULL || strstri(str, "<frame") != NULL || strstri(str, "<iframe") != NULL)
|
if(strstri(str, "<frameset") != NULL || strstri(str, "<frame") != NULL || strstri(str, "<iframe") != NULL)
|
||||||
{
|
{
|
||||||
@ -2489,25 +2472,21 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
|
|
||||||
flag = ps->flag;
|
flag = ps->flag;
|
||||||
if(flag == 1 || flag == 11 || flag == 12
|
if(flag == 1 || flag == 11 || flag == 12
|
||||||
|| flag == 13 || flag == 14 || flag >= 17 || flag == 10)
|
|| flag == 13 || flag == 14 || flag >= 17 || flag == 10) return -2;
|
||||||
{
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
else if(ps->flag == -1) return -1;
|
else if(ps->flag == -1) return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stt->doEmitionRedFoundData("[FrameLocator] Corrupted tag. [" + QString(ip) +":" + QString::number(port) + "]");
|
stt->doEmitionRedFoundData("[FrameLocator] Corrupted tag. [" + QString(ip) + ":" +
|
||||||
|
QString::number(port) + "]");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
while(str1 != NULL);
|
while(str1 != NULL);
|
||||||
return -2;
|
return -2;
|
||||||
};
|
};
|
||||||
if (strstri(str, "<form ") != NULL)
|
|
||||||
{
|
if (strstri(str, "<form ") != NULL) strcat(ps->headr, "[Form]");
|
||||||
strcat(ps->headr, "[Form]");
|
|
||||||
}
|
|
||||||
//if(strstri(str, "<form ") != NULL)
|
//if(strstri(str, "<form ") != NULL)
|
||||||
//{
|
//{
|
||||||
// strcat(ps->headr, " [Login form detected]");
|
// strcat(ps->headr, " [Login form detected]");
|
||||||
@ -2565,14 +2544,8 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
if(strlen(ps->headr) == 0)
|
if(strlen(ps->headr) == 0)
|
||||||
{
|
{
|
||||||
strcat(ps->headr, "[Empty title]");
|
strcat(ps->headr, "[Empty title]");
|
||||||
if(strstri(str, "<html") == NULL && strstri(str, "<!doctype html") == NULL)
|
if(strstri(str, "<html") == NULL && strstri(str, "<!doctype html") == NULL) strcat(ps->headr, "[No html]");
|
||||||
{
|
if(strstri(str, "<body") == NULL) strcat(ps->headr, "[No body]");
|
||||||
strcat(ps->headr, "[No html]");
|
|
||||||
};
|
|
||||||
if(strstri(str, "<body") == NULL)
|
|
||||||
{
|
|
||||||
strcat(ps->headr, "[No body]");
|
|
||||||
};
|
|
||||||
|
|
||||||
const char *ptr1 = strstr(str, "\r\n\r\n");
|
const char *ptr1 = strstr(str, "\r\n\r\n");
|
||||||
if( ptr1 != NULL)
|
if( ptr1 != NULL)
|
||||||
@ -2582,16 +2555,10 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
strcat(ps->headr, " [Data: ");
|
strcat(ps->headr, " [Data: ");
|
||||||
|
|
||||||
char *ptr2 = strstri(ptr1 + 4, "<body");
|
char *ptr2 = strstri(ptr1 + 4, "<body");
|
||||||
if (ptr2 != NULL)
|
if (ptr2 != NULL) strncat(ps->headr, ptr2 + 5, 64);
|
||||||
{
|
|
||||||
strncat(ps->headr, ptr2 + 5, 64);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
ptr2 = strstri(ptr1 + 4, "<html");
|
ptr2 = strstri(ptr1 + 4, "<html");
|
||||||
if (ptr2 != NULL)
|
if (ptr2 != NULL) strncat(ps->headr, strstri(ptr1, "<html") + 5, 64);
|
||||||
{
|
|
||||||
strncat(ps->headr, strstri(ptr1, "<html") + 5, 64);
|
|
||||||
}
|
|
||||||
else strncat(ps->headr, ptr1 + 4, 64);
|
else strncat(ps->headr, ptr1 + 4, 64);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2621,10 +2588,7 @@ int Lexems::_header(char *ip, int port, const char str[], Lexems *l, PathStr *ps
|
|||||||
|
|
||||||
ps->flag = ContentFilter(str, port, ip, ps->codepage, size);
|
ps->flag = ContentFilter(str, port, ip, ps->codepage, size);
|
||||||
|
|
||||||
if(strstri(str, "window.open(") != NULL)
|
if(strstri(str, "window.open(") != NULL) _getPopupTitle(ps, strstri(str, "window.open("));
|
||||||
{
|
|
||||||
_getPopupTitle(ps, strstri(str, "window.open("));
|
|
||||||
};
|
|
||||||
|
|
||||||
strcpy(ps->path, "/");
|
strcpy(ps->path, "/");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
WebDAV
|
||||||
Company Limited
|
Company Limited
|
||||||
àðåíäà ñåðâ
|
àðåíäà ñåðâ
|
||||||
首页
|
首页
|
||||||
51yes.com
|
51yes.com
|
||||||
|
nasne&trade
|
||||||
google-site-verification
|
google-site-verification
|
||||||
áåñïëàòíûé õîñò
|
áåñïëàòíûé õîñò
|
||||||
àíòèâèðóñ
|
àíòèâèðóñ
|
||||||
|
@ -2914,7 +2914,7 @@ void nesca_3::appendDefaultText(QString str)
|
|||||||
|
|
||||||
void nesca_3::appendErrText(QString str)
|
void nesca_3::appendErrText(QString str)
|
||||||
{
|
{
|
||||||
ui->dataText->append("<span style=\"color:red;background-color:#313131;\">[" + QTime::currentTime().toString() + "]" + QString::fromUtf8(str.toLocal8Bit().data()) + "</span>");
|
ui->dataText->append("<span style=\"color:red;\">[" + QTime::currentTime().toString() + "]" + QString::fromUtf8(str.toLocal8Bit().data()) + "</span>");
|
||||||
|
|
||||||
if(stt->isRunning() == false)
|
if(stt->isRunning() == false)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user