ftp fixes

This commit is contained in:
cora32 2016-04-16 20:47:33 +03:00
parent 6a91e4620e
commit 7003bc0392
5 changed files with 60 additions and 40 deletions

View File

@ -45,11 +45,27 @@ lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) {
return lps; return lps;
} }
else if (res != -1) { else if (res != -1) {
if (!globalScanFlag) return lps; if (buffer.find("syslog") != -1 || buffer.find("CFG-PAGE") != -1) {
strcpy(lps.login, login); if (gNegDebugMode) {
strcpy(lps.pass, pass); stt->doEmitionDebugFoundData("Ignoring " + QString(ip) + " (syslog or CFG-PAGE)");
}
return lps;
}
ps->directoryCount = std::count(buffer.begin(), buffer.end(), '\n'); ps->directoryCount = std::count(buffer.begin(), buffer.end(), '\n');
if (3 == ps->directoryCount) {
if (-1 != buffer.find("pub") || -1 != buffer.find("incoming")) {
if (gNegDebugMode) {
stt->doEmitionDebugFoundData("Ignoring " + QString(ip) + " (pub or incoming)");
}
return lps;
}
}
if (!globalScanFlag) return lps;
strcpy(lps.login, login);
strcpy(lps.pass, pass);
rowIndex = Utils::addBARow(QString(ip), QString(login) + ":" + QString(pass), "OK", rowIndex); rowIndex = Utils::addBARow(QString(ip), QString(login) + ":" + QString(pass), "OK", rowIndex);
return lps; return lps;

View File

@ -2960,43 +2960,45 @@ void parseFlag(int flag, char* ip, char *ipRaw, int port, std::string *buff, con
const lopaStr &lps = FTPA::FTPLobby(ip, port, &ps); const lopaStr &lps = FTPA::FTPLobby(ip, port, &ps);
if (strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0) if (0 != ps.directoryCount) {
{ if (strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
++PieBA; {
++PieBA;
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)", sprintf(log, "<div id=\"hostspan\"><font color=\"#0f62e2\">%s</font></div><div id=\"hostspan2\"> Size: %d</div><a href=\"ftp://%s:%s@%s/\"><div id=\"hostspan3\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a>%s (F:%d)</div>",
ip, size, lps.login, lps.pass, ipRaw, lps.login, lps.pass, ipRaw, 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, ipRaw, lps.login, lps.pass, ipRaw, 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)
{
++PieBA;
sprintf(log, "<div id=\"hostspan\"><font color=\"#0f62e2\">%s:%d</font></div><div id=\"hostspan2\"> Size: %d</div><a href=\"ftp://%s:%s@%s/\"><div id=\"hostspan3\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></div></a> <font color=\"#43EC00\"><a href=\"%s\" style=\"color:#43EC00;\">[ROUTER]</a></font>%s",
ip, port, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip, ps.headr);
sprintf(logEmit, "[FTP]:<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> <font color=\"#43EC00\"><a href=\"%s/\" style=\"color:#43EC00;\">[ROUTER]</a></font>",
lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip);
fputsf(log, flag);
fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "Router FTP.", cp, "FTP");
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
}
else if (strstr(lps.login, "Unknown protocol") != NULL)
{
strcat(log, "; [!] USER/PASS commands failed. Dunno what to do.");
fputsf(log, flag);
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
};
} }
else if (strstr(lps.other, "ROUTER") != NULL)
{
++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> <font color=\"#43EC00\"><a href=\"%s\" style=\"color:#43EC00;\">[ROUTER]</a></font>%s",
ip, port, size, lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip, ps.headr);
sprintf(logEmit, "[FTP]:<a href=\"ftp://%s:%s@%s/\"><span style=\"color: #ff6600;\">ftp://%s:%s@%s</span></a> <font color=\"#43EC00\"><a href=\"%s/\" style=\"color:#43EC00;\">[ROUTER]</a></font>",
lps.login, lps.pass, ip, lps.login, lps.pass, ip, ip);
fputsf(log, flag);
fillGlobalLogData(ip, port, std::to_string(size).c_str(), "[FTP service]", lps.login, lps.pass, "Router FTP.", cp, "FTP");
stt->doEmitionFoundData(QString::fromLocal8Bit(logEmit));
}
else if (strstr(lps.login, "Unknown protocol") != NULL)
{
strcat(log, "; [!] USER/PASS commands failed. Dunno what to do.");
fputsf(log, flag);
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
};
return; return;
} }

View File

@ -106,7 +106,9 @@ typedef int BOOL;
#define NEGATIVE_FN PWD_LIST_FOLDER "negatives.txt" #define NEGATIVE_FN PWD_LIST_FOLDER "negatives.txt"
#define HTTP_FILE_STYLE "<style> #recvSpan{display: inline-block;width: 150px;} \ #define HTTP_FILE_STYLE "<style> #recvSpan{display: inline-block;width: 150px;} \
#hostSpan{display: inline-block;width: 200px;} \ #hostSpan{display: inline-block;width: 300px;} \
#hostSpan2{display: inline-block;width: 130px;} \
#hostSpan3{ display: inline-block; width: 210px; } \
body { background-color: #141414; font-family: monospace; font-size:95%;} \ body { background-color: #141414; font-family: monospace; font-size:95%;} \
#ipd{background:black;width:100%;white-space:nowrap;overflow-x:none;display:inline-block;} \ #ipd{background:black;width:100%;white-space:nowrap;overflow-x:none;display:inline-block;} \
#ipd:hover{color: #909090;background:#202020;} \ #ipd:hover{color: #909090;background:#202020;} \

View File

@ -1404,10 +1404,10 @@ void nesca_3::switchToJobMode()
} }
void copyToClipboardLocation() { void copyToClipboardLocation() {
ui->currentDirectoryLine->selectAll(); //ui->currentDirectoryLine->selectAll();
QClipboard *c = QApplication::clipboard(); //QClipboard *c = QApplication::clipboard();
QString dir = ui->currentDirectoryLine->text(); QString dir = ui->currentDirectoryLine->text();
c->setText(dir); //c->setText(dir);
QDesktopServices::openUrl(QUrl::fromLocalFile(dir)); QDesktopServices::openUrl(QUrl::fromLocalFile(dir));
} }

View File

@ -1 +1 @@
2729A-B 272A0-7FA