zerobyte-id

SSH MassChecker

Aug 29th, 2020 (edited)
429
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # SSH MassChecker
  3. # requirements sshpass
  4. # @Author : ZeroByte.ID
  5. # @Github : https://github.com/zerobyte-id
  6.  
  7. function ngecek() {
  8.     h=$(echo "$eLIST" | cut -d '|' -f 1)
  9.     u=$(echo "$eLIST" | cut -d '|' -f 2)
  10.     p=$(echo "$eLIST" | cut -d '|' -f 3)
  11.  
  12.     sshpass -p ${p} ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 ${u}@${h} exit &>/dev/null; cekssh="$?"
  13.     if [[ "$cekssh" == 0 ]]; then
  14.             echo "[OK] $h|$u|$p"
  15.             echo "$h|$u|$p" >> hasil-ssh.txt  
  16.     else
  17.             echo "[BAD] $h|$u|$p"
  18.     fi
  19.     sleep 1s
  20. }
  21.  
  22. read -p "[?] List: " LIST
  23. for eLIST in $(cat $LIST)
  24. do
  25.     ngecek $eList
  26. done
RAW Paste Data