Фикс счетчика директорий и тестовый фикс 10038

This commit is contained in:
cora32 2014-11-30 19:17:35 +03:00
parent 1008076fec
commit 4b965e5976
4 changed files with 26 additions and 12 deletions

View File

@ -17,14 +17,14 @@ fd_set write_fs;
int _countFTPDirectories(char *recvBuff){ int _countFTPDirectories(char *recvBuff){
if(strcmp(recvBuff, "dummy\r\n") == 0) return 0;
int dirCounter = 0; int dirCounter = 0;
strcat(recvBuff, "\n"); if(recvBuff[strlen(recvBuff) - 1] != '\n') strcat(recvBuff, "\n");
char *dirPtr = strstr(recvBuff, "\n"); char *dirPtr = strstr(recvBuff, "\n");
while(dirPtr != NULL){ while(dirPtr != NULL){
++dirCounter; ++dirCounter;
dirPtr = strstr(dirPtr + 1, "\n"); dirPtr = strstr(dirPtr + 1, "\n");
}; };
return dirCounter; return dirCounter;
}; };
void BConInc() void BConInc()
@ -918,8 +918,7 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
while (true) while (true)
{ {
Sleep(100); Sleep(100);
if(globalScanFlag == false) break; ZeroMemory(recvBuff, 1024);
ZeroMemory(recvBuff, sizeof(recvBuff));
x = recvWT(sockFTP, recvBuff, 1024, gTimeOut + 5, &bTO); x = recvWT(sockFTP, recvBuff, 1024, gTimeOut + 5, &bTO);
if(x <= 0) break; if(x <= 0) break;
if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(recvBuff)); if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(recvBuff));
@ -993,6 +992,8 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps)
break; break;
}; };
if(globalScanFlag == false) break;
if((strstr(recvBuff, "530 Sorry") != NULL) if((strstr(recvBuff, "530 Sorry") != NULL)
|| (strstr(recvBuff, "530") != NULL && strstr(recvBuff, "maximum") != NULL) || (strstr(recvBuff, "530") != NULL && strstr(recvBuff, "maximum") != NULL)
|| strstr(recvBuff, "exceeded") != NULL || strstr(recvBuff, "exceeded") != NULL
@ -1519,7 +1520,18 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
if (!iResult) ++offlines; if (!iResult) ++offlines;
else else
{ {
if(send(sock, request, strlen(request), 0) != SOCKET_ERROR) int sResult = send(sock, request, strlen(request), 0);
while(sResult == SOCKET_ERROR)
{
stt->doEmitionRedFoundData("[_EC]Resending: " + QString(ip) + " - " + QString::number(WSAGetLastError()));
CSSOCKET(sock);
Sleep(100);
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
connect(sock, (sockaddr*)&sockAddr, sizeof(sockAddr));
sResult = send(sock, request, strlen(request), 0);
};
if(sResult != SOCKET_ERROR)
{ {
if(MapWidgetOpened) stt->doEmitionAddOutData(QString(ip), QString(request)); if(MapWidgetOpened) stt->doEmitionAddOutData(QString(ip), QString(request));
Activity += strlen(request); Activity += strlen(request);
@ -1555,7 +1567,7 @@ int Connector::_EstablishConnection(char *ip, int port, char *request, conSTR *C
else else
{ {
++offlines; ++offlines;
stt->doEmitionRedFoundData("Send error " + QString(ip) + " - " + QString::number(WSAGetLastError())); stt->doEmitionRedFoundData("[_EC]Send error: " + QString(ip) + " - " + QString::number(WSAGetLastError()));
}; };
}; };
}; };

View File

@ -3,7 +3,7 @@
#define SD_BOTH 2 #define SD_BOTH 2
#define PORTSET "80,81,88,8080,8081,60001,60002,8008,8888,554,9000,441,4111,6667,3536,22,21" #define PORTSET "80,81,88,8080,8081,60001,60002,8008,8888,554,9000,441,4111,6667,3536,22,21"
#define IRC_CHAN "iskopasi_lab03" #define IRC_CHAN "iskopasi_lab03"
#define CSSOCKET(Socket) shutdown(Socket, SD_BOTH); closesocket(Socket); #define CSSOCKET(Socket) shutdown(Socket, SD_BOTH); closesocket(Socket); Socket = -1;
extern QJsonArray *jsonArr; extern QJsonArray *jsonArr;

View File

@ -244,11 +244,12 @@ int _mainFinderFirst(char *buffcpy, int f, int port, char *ip)
if(strstr(buffcpy, "vilar ipcamera")) return 13; if(strstr(buffcpy, "vilar ipcamera")) return 13;
if(strstr(buffcpy, "window.location = \"rdr.cgi\"")) return 14; if(strstr(buffcpy, "window.location = \"rdr.cgi\"")) return 14;
if(strstr(buffcpy, "httpfileserver")) return 15; if(strstr(buffcpy, "httpfileserver")) return 15;
if(((strstr(buffcpy, "220") != NULL) && (port == 21)) || if(((strstr(buffcpy, "220") != NULL && port == 21) ||
(strstri(buffcpy, "220 diskStation ftp server ready") != NULL) || strstr(buffcpy, "220 diskstation ftp server ready") != NULL ||
(strstri(buffcpy, "220 ftp server ready") != NULL) strstr(buffcpy, "220 ftp server ready") != NULL ||
|| strstr(buffcpy, "500 'get': command not understood") != NULL strstr(buffcpy, "500 'get': command not understood") != NULL
) return 16; // 16 - FTP )
&& strstr(buffcpy, "firewall authentication required") == NULL) return 16; // 16 - FTP
if(strstr(buffcpy, "real-time ip camera monitoring system") != NULL || if(strstr(buffcpy, "real-time ip camera monitoring system") != NULL ||
strstr(buffcpy, "server push mode") != NULL strstr(buffcpy, "server push mode") != NULL
) return 17; //Real-time IP Camera Monitoring System ) return 17; //Real-time IP Camera Monitoring System

View File

@ -1,4 +1,5 @@
yadro.ru yadro.ru
Firewall Authentication required before
liveinternet liveinternet
#[Dlink] #[Dlink]
session_login.php?reload=1 session_login.php?reload=1