From 1008076feccc5953a4d243498656e606bcd23233 Mon Sep 17 00:00:00 2001 From: cora32 Date: Sat, 29 Nov 2014 09:36:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=81=D1=87=D1=91=D1=82=D1=87=D0=B8=D0=BA=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D1=84?= =?UTF-8?q?=D1=82=D0=BF=20=D0=B8=20=D1=84=D0=B8=D0=BA=D1=81=20=D1=84=D0=B5?= =?UTF-8?q?=D0=B9=D0=BA=D1=85=D0=B8=D1=82=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20ssh.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connector.cpp | 26 +++++++++++++++++++++++--- finder.cpp | 6 +++--- mainResources.h | 1 + sshpass.txt | 1 + 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/connector.cpp b/connector.cpp index 7f76e75..a0446aa 100644 --- a/connector.cpp +++ b/connector.cpp @@ -15,6 +15,18 @@ int gMaxBrutingThreads = 200; fd_set write_fs; + +int _countFTPDirectories(char *recvBuff){ + int dirCounter = 0; + strcat(recvBuff, "\n"); + char *dirPtr = strstr(recvBuff, "\n"); + while(dirPtr != NULL){ + ++dirCounter; + dirPtr = strstr(dirPtr + 1, "\n"); + }; + + return dirCounter; +}; void BConInc() { __asm @@ -1107,6 +1119,7 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps) #pragma region Get pasv Port char *ptr0 = strstr(recvBuff2, "227 "); + if( ptr0 != NULL ) { if(strstr(ptr0, "(") != NULL) @@ -1136,7 +1149,6 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps) connectionResult = connect(newSockFTP, (sockaddr*)&sockAddr, sizeof(sockAddr)); send(sockFTP, "LIST\r\n", 6, 0); - ZeroMemory(recvBuff, sizeof(recvBuff)); int x = recvWT(newSockFTP, recvBuff, sizeof(recvBuff), gTimeOut + 3, &bTO); if(x <= 0 || strstr(recvBuff, "unknown command") != NULL) @@ -1155,9 +1167,16 @@ lopaStr _FTPBrute(char *ip, int port, PathStr *ps) strcpy(lps.login, "UNKNOWN"); return lps; } - else stt->doEmition_BAGreenData("[+] " + QString(pass) + " [MLSD succeeded]"); + else { + stt->doEmition_BAGreenData("[+] " + QString(pass) + " [MLSD succeeded]"); + ps->directoryCount = _countFTPDirectories(recvBuff); + }; } - else stt->doEmition_BAGreenData("[+] " + QString(pass) + " [LIST succeeded]"); + else + { + stt->doEmition_BAGreenData("[+] " + QString(pass) + " [LIST succeeded]"); + ps->directoryCount = _countFTPDirectories(recvBuff); + }; CSSOCKET(newSockFTP); } @@ -2014,6 +2033,7 @@ int _EstablishSSHConnection(char *host, int port, conSTR *CSTR, char *banner) ZeroMemory(temp, sizeof(temp)); if(res == 0) { + if(i == 0) return -2; //Failhit SSHConDec(); isActive = 0; return 0; diff --git a/finder.cpp b/finder.cpp index d8fc683..cab18bf 100644 --- a/finder.cpp +++ b/finder.cpp @@ -698,9 +698,7 @@ void fputsf(char *ip, char *port, char *text, int flag, char *msg) } else { -#pragma region QTGUI_Area stt->doEmitionRedFoundData("Cannot open file [FLAG: " + QString::number(flag) + "]"); -#pragma endregion }; }; void putInFile(int flag, char *ip, char *port, int recd, char *finalstr, char *hl, char *cp) @@ -1634,7 +1632,9 @@ int Lexems::_filler(int p, char* buffcpy, char* ip, int recd, Lexems *lx, char * strcat(logEmit, lps.pass); strcat(logEmit, "@"); strcat(logEmit, ip); - strcat(logEmit, ""); + strcat(logEmit, " (F:"); + strcat(logEmit, std::to_string((long double)ps.directoryCount).c_str()); + strcat(logEmit, ")"); fputsf(ip, port, log, flag, "FTP"); diff --git a/mainResources.h b/mainResources.h index 14ccdd4..8f98a9d 100644 --- a/mainResources.h +++ b/mainResources.h @@ -59,6 +59,7 @@ struct PathStr{ int port; char ip[MAX_ADDR_LEN]; char cookie[COOKIE_MAX_SIZE]; + int directoryCount; }; struct lopaStr{ diff --git a/sshpass.txt b/sshpass.txt index 2310446..5c6c017 100644 --- a/sshpass.txt +++ b/sshpass.txt @@ -1,3 +1,4 @@ +hw230f8034t:17932yhf823 root:root root:admin admin:admin