Skip to content

Commit

Permalink
DNS mode session restoration fix
Browse files Browse the repository at this point in the history
  • Loading branch information
forsdev1 committed Mar 23, 2015
1 parent fecbd46 commit 22478e5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 38 deletions.
2 changes: 1 addition & 1 deletion externData.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern unsigned int Activity;
extern char trcSrv[256], trcScr[256], trcProxy[128], trcPersKey[64],
ircServer[32], ircPort[32], ircProxy[64], ircProxyPort[8], ircNick[32],
trcPort[32], trcSrvPortLine[32], saveEndIP[128],
gRange[128], gFirstDom[128], gPorts[65536], endIP2[128],
gRange[128], gFirstDom[128], gPorts[65536],
gVER[16],
gProxyIP[64], gProxyPort[8],
currentIP[MAX_ADDR_LEN],
Expand Down
10 changes: 4 additions & 6 deletions nesca_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2941,7 +2941,6 @@ void nesca_3::ConnectEvrthng()
}

void _LoadPersInfoToLocalVars(int savedTabIndex) {
ZeroMemory(endIP2, sizeof(endIP2));
ZeroMemory(top_level_domain, sizeof(top_level_domain));
ZeroMemory(gPorts, sizeof(gPorts));

Expand All @@ -2957,16 +2956,15 @@ void _LoadPersInfoToLocalVars(int savedTabIndex) {
QList<QString> splittedTargetLine = targetLine.split("-");
strcpy(currentIP, splittedTargetLine[0].toLocal8Bit().data());
strcpy(finalIP, splittedTargetLine[1].toLocal8Bit().data());
strcpy(endIP2, ui->ipLine->text().toLocal8Bit().data());
}
}
else
{
if(ui->ipLine->text().indexOf("/") < 0)
{
strcpy(endIP2, ui->ipLine->text().toLocal8Bit().data());
strcat(endIP2, "-");
strcat(endIP2, ui->ipLine->text().toLocal8Bit().data());
strcpy(currentIP, ui->ipLine->text().toLocal8Bit().data());
strcat(currentIP, "-");
strcat(currentIP, ui->ipLine->text().toLocal8Bit().data());
};
};

Expand All @@ -2978,7 +2976,7 @@ void _LoadPersInfoToLocalVars(int savedTabIndex) {
gMode = 1;
gThreads = ui->lineEditThread->text().toInt();

strcpy(endIP2, ui->lineEditStartIPDNS->text().toLocal8Bit().data());
strcpy(currentIP, ui->lineEditStartIPDNS->text().toLocal8Bit().data());
strcpy(top_level_domain, ui->lineILVL->text().toLocal8Bit().data());
strncpy(gPorts, ("-p" + ui->lineEditPort->text()).toLocal8Bit().data(), 65536);
gPorts[ui->lineEditPort->text().size()] = '\0';
Expand Down
2 changes: 1 addition & 1 deletion nesca_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern bool widgetIsHidden, IRCLogToggled, blinkFlag, disableBlink, debugFileOK,
smBit_8, smBit_7, smBit_6, smBit_5, smBit_4, smBit_3, smBit_2, smBit_1, printDelimiter;
extern float QoSStep;
extern int MaxDataVal;
extern char endIP2[128], inputStr[256];
extern char inputStr[256];
extern SOCKET lSock;

extern QVector<int> vAlivLst, vAnomLst, vWFLst, vSuspLst, vLowlLst, vBALst, vSSHLst, vOvrlLst, actLst;
Expand Down
45 changes: 15 additions & 30 deletions nesca_startModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ unsigned int Activity = 0;
unsigned char **ipsstartfl = NULL, **ipsendfl = NULL, **starterIP = NULL;
double ips = 0;
char top_level_domain[128] = {0};
char endIP2[128] = {0};
char **GlobalNegatives = 0;
char **loginLst, **passLst;
char **wfLoginLst, **wfPassLst;
Expand Down Expand Up @@ -805,49 +804,37 @@ void _connect() {
}
}

void verboseProgress(long long unsigned int target, const char *ip) {

inline void progressOutput(long long unsigned int target) {
char targetNPers[128] = {0};
float percent = (gTargetsOverall != 0 ? (100 - target/(double)gTargetsOverall * 100) : 0);

stt->doEmitionIPRANGE(QString(ip));
strcpy(currentIP, ip);

sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
stt->doEmitionTargetsLeft(QString(targetNPers));

sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f",
percent);
}
void verboseProgressDNS(long long unsigned int target, const char *ip, const char *TLD) {

char targetNPers[128] = { 0 };
float percent = (gTargetsOverall != 0 ? (100 - target / (double)gTargetsOverall * 100) : 0);

stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
strcpy(currentIP, ip);
void verboseProgress(long long unsigned int target, const char *ip) {

sprintf(targetNPers, "%Lu (%.1f%%)", target, percent);
stt->doEmitionTargetsLeft(QString(targetNPers));
stt->doEmitionIPRANGE(QString(ip));
progressOutput(target);
}
void verboseProgressDNS(long long unsigned int target, const char *ip, const char *TLD) {

sprintf(metaTargets, "%Lu", target);
sprintf(metaPercent, "%.1f",
percent);
stt->doEmitionIPRANGE(QString(ip) + QString(TLD));
progressOutput(target);
}

void _passLoginLoader() {
MaxLogin = 0;
MaxPass = 0;

FILE *loginList;
FILE *passList;

char buffFG[32] = {0};
int i = 0;

loginList = fopen("login.txt", "r");
passList = fopen("pass.txt", "r");
FILE *loginList = fopen("login.txt", "r");
FILE *passList = fopen("pass.txt", "r");

if(passList != NULL && loginList != NULL)
{
Expand Down Expand Up @@ -1898,22 +1885,19 @@ int ParseArgs(int argc, char *argv[]) {
};

strcpy(saveEndIP, gRange);
strcpy(endIP2, gRange);
strcpy(finalIP, strstr(gRange, "-") + 1);
}
else if(gMode == 1)
{
if(strstr(argv[2], "/") != NULL)
{
strcpy(gRange, argv[2]);
strcpy(saveEndIP, argv[2]);
strcpy(endIP2, argv[2]);
strcpy(saveEndIP, argv[2]);
}
else
{
strcpy(gRange, argv[2]);
strcpy(saveEndIP, gRange);
strcpy(endIP2, gRange);
strcpy(saveEndIP, gRange);
};

};
Expand Down Expand Up @@ -2037,8 +2021,9 @@ int _getChunkCount(char *data) {
}

int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {

if(strstr(mask, "[") != NULL)
{
{
char maskEnd[1024] = {0};
char maskRes[1024] = {0};
char *ptr1 = strstr(mask, "[");
Expand Down Expand Up @@ -2095,7 +2080,7 @@ int _GetDNSFromMask(char *mask, char *saveMask, char *saveMaskEnder) {
}
else
{
strcpy(endIP2, saveMask);
strcpy(currentIP, saveMask);

while(cons >= gThreads && globalScanFlag) Sleep(300);
if(!globalScanFlag) return 0;
Expand Down

0 comments on commit 22478e5

Please sign in to comment.