Last active
          September 17, 2022 11:00 
        
      - 
      
 - 
        
Save chvancooten/34f26f90c1e174e16e4228764e9c5dcb to your computer and use it in GitHub Desktop.  
Revisions
- 
        
chvancooten renamed this gist
Apr 24, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
chvancooten created this gist
Apr 24, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #!/bin/bash ### 0xc4s OpenSSL bruter for HTB's 'Hawk' # Declare wordlists wordlist = '/usr/share/wordlists/rockyou.txt' # Declare array of possible ciphers (based on common ones from 'openssl help') ciphers=( -aes-256-cbc -aes-128-cbc -aes-256-ecb -aes-128-ecb ) # Loop through ciphers for cipher in "${ciphers[@]}"; do echo "TRYING CIPHER: $cipher" # Loop through wordlist while read passTry; do openssl enc -d -a $cipher -k $passTry -in drupal.txt.enc -out tmp &>/dev/null if [ $? -eq 0 ]; then echo "PASSWORD FOUND!" echo "Pass is: $passTry" echo "===DECRYPTED TEXT BELOW===" cat tmp echo "===END DECRYPTED TEXT===" # For Hawk, it gets the correct password on first try # However, a 0-exit code doesn't always mean getting the key right # As such, don't exit (spam alert!) #exit 0 fi rm tmp done < $wordlist done rm tmp