Created
July 29, 2025 17:42
-
-
Save gadgetmies/09ebeea4918655c0040ffbea814be316 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 | |
| echo "Scanning network for devices..." | |
| ips=$(arp -a | awk '{print $2}' | tr -d '()') | |
| echo "Testing for SSH (port 22)..." | |
| for ip in $ips; do | |
| timeout 1s nmblookup -A ${ip} | |
| python3 -c " | |
| import socket | |
| s = socket.socket() | |
| s.settimeout(1) | |
| try: | |
| s.connect(('${ip}', 22)) | |
| print('SSH open: ${ip}') | |
| except: | |
| pass | |
| s.close() | |
| " | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment