mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-12-26 01:11:47 +00:00
ftp fixes
This commit is contained in:
parent
6a91e4620e
commit
7003bc0392
22
FTPAuth.cpp
22
FTPAuth.cpp
@ -45,11 +45,27 @@ lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) {
|
||||
return lps;
|
||||
}
|
||||
else if (res != -1) {
|
||||
if (!globalScanFlag) return lps;
|
||||
strcpy(lps.login, login);
|
||||
strcpy(lps.pass, pass);
|
||||
if (buffer.find("syslog") != -1 || buffer.find("CFG-PAGE") != -1) {
|
||||
if (gNegDebugMode) {
|
||||
stt->doEmitionDebugFoundData("Ignoring " + QString(ip) + " (syslog or CFG-PAGE)");
|
||||
}
|
||||
return lps;
|
||||
}
|
||||
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);
|
||||
|
||||
return lps;
|
||||
|
66
finder.cpp
66
finder.cpp
@ -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);
|
||||
|
||||
if (strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
|
||||
{
|
||||
++PieBA;
|
||||
if (0 != ps.directoryCount) {
|
||||
if (strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
|
||||
{
|
||||
++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)",
|
||||
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)",
|
||||
lps.login, lps.pass, ipRaw, lps.login, lps.pass, ipRaw, ps.directoryCount);
|
||||
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);
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -106,7 +106,9 @@ typedef int BOOL;
|
||||
#define NEGATIVE_FN PWD_LIST_FOLDER "negatives.txt"
|
||||
|
||||
#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%;} \
|
||||
#ipd{background:black;width:100%;white-space:nowrap;overflow-x:none;display:inline-block;} \
|
||||
#ipd:hover{color: #909090;background:#202020;} \
|
||||
|
@ -1404,10 +1404,10 @@ void nesca_3::switchToJobMode()
|
||||
}
|
||||
|
||||
void copyToClipboardLocation() {
|
||||
ui->currentDirectoryLine->selectAll();
|
||||
QClipboard *c = QApplication::clipboard();
|
||||
//ui->currentDirectoryLine->selectAll();
|
||||
//QClipboard *c = QApplication::clipboard();
|
||||
QString dir = ui->currentDirectoryLine->text();
|
||||
c->setText(dir);
|
||||
//c->setText(dir);
|
||||
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(dir));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user