FTP brute fixed.

NPE on restart fixed.
This commit is contained in:
cora32 2016-04-10 00:16:03 +03:00
parent 536342b6f4
commit 6a91e4620e
5 changed files with 12 additions and 8 deletions

View File

@ -562,6 +562,7 @@ int Connector::connectToPort(char* ip, int port)
else if (21 == port) { else if (21 == port) {
//strcpy(tempIp, "ftp://"); //strcpy(tempIp, "ftp://");
sprintf(tempIp, "ftp://%s:%d", ip, port); sprintf(tempIp, "ftp://%s:%d", ip, port);
//sprintf(tempIp, "%s", ip);
} }
/*else if (554 == port) { /*else if (554 == port) {
sprintf(tempIp, "rtsp://%s:%d", ip, port); sprintf(tempIp, "rtsp://%s:%d", ip, port);
@ -574,6 +575,7 @@ int Connector::connectToPort(char* ip, int port)
if (port != 37777 && port != 8000 && port != 34567 && port != 9000){ if (port != 37777 && port != 8000 && port != 34567 && port != 9000){
if (port == 22) size = SSHAuth::SSHLobby(ip, port, &buffer); //SSH if (port == 22) size = SSHAuth::SSHLobby(ip, port, &buffer); //SSH
else if (21 == port) size = nConnect(ip, port, &buffer);
else size = nConnect(tempIp, port, &buffer); else size = nConnect(tempIp, port, &buffer);
if (size > 0) if (size > 0)

View File

@ -36,7 +36,7 @@ lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) {
strcpy(pass, ftpPassLst[j]); strcpy(pass, ftpPassLst[j]);
if (strlen(pass) <= 1) continue; if (strlen(pass) <= 1) continue;
lpString = string(login) + string(pass); lpString = string(login) + ":" + string(pass);
Connector con; Connector con;
res = con.nConnect(ip, port, &buffer, NULL, NULL, &lpString); res = con.nConnect(ip, port, &buffer, NULL, NULL, &lpString);

View File

@ -393,6 +393,7 @@ long getFileSize(const char *fileName) {
} }
void updateList(const char *fileName, long *szPtr, void *funcPtr(void)) { void updateList(const char *fileName, long *szPtr, void *funcPtr(void)) {
if (!globalScanFlag) return;
long sz = getFileSize(fileName); long sz = getFileSize(fileName);
if(sz != *szPtr) { if(sz != *szPtr) {
@ -408,7 +409,7 @@ void updateList(const char *fileName, long *szPtr, void *funcPtr(void)) {
void FileUpdater::updateLists() { void FileUpdater::updateLists() {
running = true; running = true;
while(globalScanFlag) { while(globalScanFlag) {
Sleep(1000); Sleep(30000);
if(!globalScanFlag) break; if(!globalScanFlag) break;
loadOnce(); loadOnce();
} }

View File

@ -2964,17 +2964,16 @@ void parseFlag(int flag, char* ip, char *ipRaw, int port, std::string *buff, con
{ {
++PieBA; ++PieBA;
sprintf(log, "[FTP]:<font color=\"#0f62e2\">%s:%d</font>; Received: %d<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a>%s (F:%d)", sprintf(log, "[FTP]:<font color=\"#0f62e2\">%s</font>; Received: %d<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a>%s (F:%d)",
ip, port, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ps.headr, ps.directoryCount); ip, size, lps.login, lps.pass, ipRaw, lps.login, lps.pass, ipRaw, ps.headr, ps.directoryCount);
sprintf(logEmit, "[FTP]:<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> (F:%d)", sprintf(logEmit, "[FTP]:<a href=\"ftp://%s:%s@%s\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> (F:%d)",
lps.login, lps.pass, ip, lps.login, lps.pass, ip, ps.directoryCount); lps.login, lps.pass, ipRaw, lps.login, lps.pass, ipRaw, ps.directoryCount);
fputsf(log, flag); fputsf(log, flag);
fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "NULL", cp, "FTP"); fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "NULL", cp, "FTP");
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit)); stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
} }
else if (strstr(lps.other, "ROUTER") != NULL) else if (strstr(lps.other, "ROUTER") != NULL)
{ {
@ -2998,6 +2997,8 @@ void parseFlag(int flag, char* ip, char *ipRaw, int port, std::string *buff, con
stt->doEmitionFoundData(QString::fromLocal8Bit(log)); stt->doEmitionFoundData(QString::fromLocal8Bit(log));
}; };
return;
} }
const std::string &cookieRef = Utils::getHeaderValue(buff, "Set-Cookie: ", "Cookie: "); const std::string &cookieRef = Utils::getHeaderValue(buff, "Set-Cookie: ", "Cookie: ");

View File

@ -1 +1 @@
271CF-7D5 2729A-B