问题
I have been doing some recent experimentation with AHK, an interpreted automation scripting language, that can do tasks such as window move, mouse move, save and log info for files and I have found it very useful. I wanted to make a script that could sort of count, but with characters and symbols, a password list generator. As I need one for my attempts as a white hat.
;list of characters here
send, aaaaa
;then
send, aaaab
using a method like this I would very much appreciate help on the matter, thank you!
回答1:
If you are looking for a brute force kind of function, you could try this one:
BruteForce(Chars, Min, Max, Prefix, Stage)
{
Loop, Parse, Chars
{
If (Stage >= Min-1)
FileAppend, % Prefix A_loopField "`n", BruteForce.txt ;you could replace the line with: Send % Prefix A_loopField
If (Stage < Max-1)
BruteForce(Chars, Min, Max, Prefix A_LoopField, Stage + 1)
}
}
BruteForce("abc", 1, 2, "", 0) ;this would create every possible combination of the letters abc (min length 1, max length 2)
The result is stored in the file BruteForce.txt
来源:https://stackoverflow.com/questions/25707231/counting-with-ahk-letters