Created
February 3, 2023 17:54
-
-
Save osmanmakal/84703c810b89f716d6ae98b5407ab461 to your computer and use it in GitHub Desktop.
esxi-scan.sh
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 | |
| # KULLANIM | |
| # bash esxi-scan.sh 195.175.33.0/24 | |
| # | |
| input=$1 | |
| net=$(echo $input | cut -d '/' -f 1) | |
| prefix=$(echo $input | cut -d '/' -f 2) | |
| if (($prefix != 24)) | |
| then | |
| echo "sadece /24" | |
| exit 1 | |
| fi | |
| cut=$(echo $net | cut -d. -f1,2,3). | |
| for i in $(seq 255); do | |
| echo | timeout 0.2 unbuffer nc -nvw1 $cut$i 902 | if grep -iq "VMware" | |
| then | |
| echo "$cut$i ESXi VAR KONTROL ET" | |
| else | |
| echo "$cut$i esxi yok" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Eğer 18 ve 19. satırları kaldırırsanız gereksiz printleri, output kirliliğini ve dolayısı ile oluşacak geciklmeyi önleyebilirsiniz.