Advertisement
FlyFar

Simple Password Bruteforcer - Bash

Jul 10th, 2023
2,726
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | Cybersecurity | 0 0
  1. #!/usr/bin/bash
  2.  
  3. #Simple bruteforce script in bash for programs that take passwords as arguments.
  4.  
  5. SUCESS="Sucess!" #As the name suggests, this string is the standard sucess output of the program.  
  6.  
  7. for i in {0..N}; do #loop N times, or just make a while true:
  8.  STRING="./[program name] $i" #$i can be anything, numbers, random strings, etc.
  9.  COMMAND=`$STRING` #Executes the command N times.
  10.  if [ "$SUCESS" = "$COMMAND" ]; then #if the output of the command is equal to the sucess string...
  11.   echo "password found! Password is: $i"
  12.   exit 0 #print the right password ($i) and exits.
  13.  else
  14.   echo "trying...$i"
  15.  fi
  16. done
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement