Advertisement
somdcomputerguy

Bruteforce Example

Jul 18th, 2025 (edited)
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.45 KB | Source Code | 0 0
  1. #include <Array.au3>
  2.  
  3. Local $hTimer = TimerInit()
  4. Local $charset = "abcdefghijklmnopqrstuvwxyz" ; ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
  5. Local $password = "applies"
  6. Local $pwdlength = StringLen($password)
  7. Local $startime = @MON &  "/" & @MDAY & " " & @HOUR & ":" & @MIN
  8.  
  9. For $length = 1 To $pwdlength
  10.  Local $combinations = GenerateCombinations($charset, $length)
  11.  For $i = 0 To UBound($combinations) - 1
  12.   Local $fDiff = Round((TimerDiff($hTimer) / 1000) / 60)
  13.   Tooltip("   Password: " & $password & "  " & $fDiff & @CRLF & "   " & $i & " of " & UBound($combinations) - 1 & " -> " & $length & " of " & $pwdlength & " -> " & $combinations[$i])
  14.   If CheckPassword($combinations[$i], $password) Then
  15.    ToolTip("")
  16.    MsgBox(0, "Password found! " & $startime & " -> " & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN, $fDiff & " -> " & $i & " -> " & $combinations[$i])
  17.    Exit
  18.   EndIf
  19.  Next
  20. Next
  21.  
  22. Func GenerateCombinations($charset, $length)
  23.     Local $result[1] = [""]
  24.     For $i = 1 To $length
  25.         Local $temp[UBound($result) * StringLen($charset)]
  26.         Local $index = 0
  27.         For $j = 0 To UBound($result) - 1
  28.             For $k = 1 To StringLen($charset)
  29.                 $temp[$index] = $result[$j] & StringMid($charset, $k, 1)
  30.                 $index += 1
  31.             Next
  32.         Next
  33.         $result = $temp
  34.     Next
  35.     Return $result
  36. EndFunc
  37.  
  38. Func CheckPassword($attempt, $actualPassword)
  39.     Return $attempt == $actualPassword
  40. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement