Skip to content

Instantly share code, notes, and snippets.

@olgac
Created September 9, 2019 10:07
Show Gist options
  • Save olgac/0146febe941c2f7d145fb0b777e8ebe0 to your computer and use it in GitHub Desktop.
Save olgac/0146febe941c2f7d145fb0b777e8ebe0 to your computer and use it in GitHub Desktop.
#!/bin/bash
FILE="/tmp/telnet-scan-$(date '+%Y%m%d%H%M%S')";
IPS="10.10.10.10 10.10.10.11 10.10.10.12";
PORTS="8091 8092 8093 11207 11210 11211 18091 18092";
for ip in $IPS;
do
for port in $PORTS;
do echo "----------------------- SCANNING > " $ip $port;
echo "-----------------------" $ip $port >> $FILE;
echo -e '\x1dclose\x0d' | telnet $ip $port >> $FILE
done;
done;
echo $FILE;
cat $FILE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment