From 124f07022a755bcec3c9da003c4aa5378f2d2163 Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Sat, 23 Feb 2019 11:51:27 -0600 Subject: [PATCH 1/4] Changed LXC records to more generic name (DNS zone updates required). Updated README. --- README.md | 13 +++++++++++-- tab-sorcery.sh | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f03fd0b..1044ff4 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,17 @@ 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}" From 91316205823dcbc8cacf5af53afb43ce8752185e Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Sat, 23 Feb 2019 11:54:38 -0600 Subject: [PATCH 2/4] Fixing README table --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1044ff4..56bd097 100644 --- a/README.md +++ b/README.md @@ -60,11 +60,11 @@ You'll likely want to create a DNS zone specifically for this script for better 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 | +|-----------|:----------------------------------------| +| [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*. From fc562d9ba4dea7406bf53eea2f474abaf1892368 Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Fri, 26 Apr 2019 00:32:51 -0500 Subject: [PATCH 3/4] attempted table fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56bd097..892207a 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ You'll likely want to create a DNS zone specifically for this script for better 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) | From 294fae30c6ed43eddc2422b54f90985ddda186d8 Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Fri, 26 Apr 2019 00:33:37 -0500 Subject: [PATCH 4/4] attempted table fix --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 892207a..4a29420 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ export SORC_PASS_FILE="$HOME/.some_file" 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. 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 |