Basic functionality added. (SSH only, non-configurable username)

pull/1/head
Aaron Johnson 7 years ago
parent 7a4acbf707
commit bb22d64da3

@ -0,0 +1,12 @@
# Tab Sorcery
This is still under development and will eventually cover more variables and connection types.
## To use:
Add the script as a source file in your shell prompt, such as a line similar to this:
```. $HOME/git/tab-sorcery/tab-sorcery.sh example.com 127.0.0.1```
The arguments in the example show the domain to scan for hostnames, and the IP address of the name server providing them.
Once done, all hostnames in the DNS zone should be available for SSH by a tab-completable alias of just the hostname.

@ -0,0 +1,15 @@
#!/usr/bin/env sh
# ARGUMENTS:
# $1 == Domain to scan
# $2 == Nameserver to do the zone transfer from
scan_domain=$1
scan_ns=$2
dig skyfall.gear @$scan_ns AXFR | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$5}' > /tmp/.tab-sorcery
for i in `awk -F. '{print $1}' /tmp/.tab-sorcery`; do alias $i="ssh `grep $i /tmp/.tab-sorcery | awk '{print $2}'`"; done
\rm -f /tmp/.tab-sorcery
return 0
Loading…
Cancel
Save