diff --git a/README.md b/README.md index f03fd0b..4a29420 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,18 @@ export SORC_PASS_FILE="$HOME/.some_file" ## DNS Setup You'll likely want to create a DNS zone specifically for this script for better control over the hosts included. I would recommend using a TLD not normally available, to be sure you don't have any overlap with existing DNS names. This domain doesn't need to be publicly queried, and actually it's probably in interest of security if it isn't. -The best way to explain the zone set up is by example. Let's assume you create the zone "**not-a-real.lan**" and you have 5 hosts, known as *host1.not-a-real.lan* through *host5.not-a-real.lan*. -If you create the following entries (BIND format shown): +There are 4 types of hosts supported right now, which are identified by accompanying TXT records. The default (no TXT record) is to use SSH with your normal configured username. The other 3 types require a TXT record to match the A record of the host, and have the following properties: + +| TXT value | Effect | +|-----------|-----------------------------------------| +| [none] | Log in as configured user over SSH | +| logroot | Log in as 'root' user over SSH | +| windows | Log in over RDP (rdesktop) | +| cisco | Log in with a generic telnet connection | + + +As an example, let's assume you create the zone "**not-a-real.lan**" and you have 5 hosts, known as *host1.not-a-real.lan* through *host5.not-a-real.lan*. +Let's assume you create the following entries (BIND format shown): ``` $ORIGIN not-a-real.lan. diff --git a/tab-sorcery.sh b/tab-sorcery.sh index 8545007..10c21d4 100644 --- a/tab-sorcery.sh +++ b/tab-sorcery.sh @@ -9,7 +9,7 @@ scan_domain=$1 scan_ns=$2 # Static Configuration (Do not edit) -dns_time=5 +dns_time=4 dns_tries=1 #icmp_fail_text="$(tput bold)Tab Sorcery: $(tput setaf 1)ICMP connection to ${scan_ns} failed!$(tput sgr0)" dns_fail_text="$(tput bold)Tab Sorcery: $(tput setaf 1)DNS connection to ${scan_ns} failed!$(tput sgr0)" @@ -45,7 +45,7 @@ while read host <&3; do connect_cmd="ssh -t" host_short=`echo ${host} | awk -F. '{print $1}'` if echo $zone_xfer | grep $host | grep TXT; then - if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"lxc"' ]; then + if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"logroot"' ]; then user_name="root" get_hostip ${host} alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}"