This is Tiny SHell rewritten in Go programming language.
This program is only for helping research or educational purpose,
DON'T use for illegal purpose or in any unauthorized environment.
I like tsh and I use it a lot in my daily research work. It's especially handy when researching devices that don't have built-in sshd or are network limited.
However, sometimes these devices use special systems or architectures that can make cross-compiling tsh painful. So I decided to rewrite tsh in go, and thanks to go's powerful cross-platform compilation capabilities, I can use tsh more easily on more systems and architectures.
For example, I successfully compiled to the following platforms:
- aix
- darwin
- dragonfly
- freebsd
- illumos
- netbsd
- openbsd
- solaris
- windows
$ make
Please specify one of these targets:
make linux
make windows
It can be compiled to other unix-like platforms supported by go compiler:
GOOS=freebsd GOARCH=386 make unix
Get more with:
go tool dist list
$ make linux
env GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o ./build/tshd_linux_amd64 cmd/tshd.go
env GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o ./build/tsh_linux_amd64 cmd/tsh.go
$ ./build/tshd_linux_amd64 -h
Usage of tshd_linux_amd64:
-c string
connect back host
-d int
connect back delay (default 5)
-daemon
(internal used) is in daemon
-p int
port (default 1234)
-s string
secret (default "1234")
$ ./build/tshd_linux_amd64
$ ./build/tshd_linux_amd64 -c <client hostname>
$ ./build/tsh_linux_amd64 -h
Usage: ./tsh_linux_amd64 [-s secret] [-p port] <action>
action:
<hostname|cb> [command]
<hostname|cb> get <source-file> <dest-dir>
<hostname|cb> put <source-file> <dest-dir>
-p int
port (default 1234)
-s string
secret (default "1234")
$ ./build/tsh_linux_amd64 <server hostname>
$ ./build/tsh_linux_amd64 <server hostname> 'uname -a'
$ ./build/tsh_linux_amd64 <server hostname> get /etc/passwd .
$ ./build/tsh_linux_amd64 <server hostname> put myfile /tmp
$ ./build/tsh_linux_amd64 cb
$ ./build/tsh_linux_amd64 cb get /etc/passwd .
$ ./build/tsh_linux_amd64 cb put myfile /tmp