Dictionary attack simulation.
I am trying to create a program to run a simulation of a dictionary attack. But I want it to not only use the words as it is… but also use different combinations on the word… such as:
Quote:
Word
WOrd
wORd
etc etc
And
The fallowing code is the best I can come up with, but its still not right… and I cant for the life of me work out why… Please help :(
Code:
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string word = "word";
string wordTemp = word;
int pos = word.length();
do
{
wordTemp[pos] = toupper(wordTemp[pos]);
for (int i=0; i<word.length(); i++)
{
wordTemp[i] = toupper(wordTemp[i]);
for (int i=0; i<100; i++)
{
char data[99];
itoa(i, data, 10);
wordTemp.replace(4, 2, data);
cout << wordTemp << endl;
}
if (i < pos) continue;
wordTemp[i] = tolower(wordTemp[i]);
}
pos--;
} while (pos >= 0);
system("PAUSE");
return EXIT_SUCCESS;
}