c++ - String Permutation -
I'm struggling to find out what's wrong with my current project. First of all, my goal is to try and program a brutefault attack by using all the letters of the alphabet and numbers from 0-9.
I stumbled on string permutation, which allows me to generate all the possible combinations in all the letters. String Like The following can help you: (C ++ 11) () abc should give me
abc ,
acb ,
bca .. I have a character of 36 characters i Want to generate all the combinations in all ways with number / long long combinations like
aa
a1
a2 15 characters and number combinations. My code is below, which makes all combinations possible in a single line of 36 characters. Also, to give attention, I tried to resize the string, but it only displays the first 5 characters and not all of them.
class attack {public: string combination; }; Zero bruteforceAtt () {ent bruteforce; Bruteforce.combinations = "abcdefghijklmnopqrstuvwxyz123456789"; Cout & lt; & Lt; "Brutforce invasion is a go ..." & lt; & Lt; Endl; The court's & lt; & Lt; "Searching ..." & lt; & Lt; Endl; The court's & lt; & Lt; "" & Lt; & Lt; Endl; Do {bruteforce.combinations.resize (5); The court's & lt; & Lt; Bruteforce.combinations & lt; & Lt; Endl; } While (next_permutation (bruteforce.combinations.begin), bruteforce.combinations.end ())); System ("pause"); };
template & lt; std :: size_t N & gt; bool rise (std :: array & lt; std :: size_t, n & gt; & amp; a, std :: size_t base) {for (auto rit = a.rbegin (); rit! = a.rend () ; ++ rit) {++ * rit; If (* rit! = Base) {back true; } * Rit = 0; } return false; }
Comments
Post a Comment