Skip to content

Commit

Permalink
documentation: fix mixup from 'stty -raw echo' to 'stty raw -echo'
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed May 11, 2020
1 parent 4ae360f commit d805c25
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,20 +560,29 @@ misc arguments:
When connected with a reverse or bind shell you'll notice that no interactive commands will work and
hitting <kbd>Ctrl</kbd>+<kbd>c</kbd> will terminate your session.
To fix this, you'll need to attach it to a TTY. Here's how:
To fix this, you'll need to attach it to a TTY (make it interactive). Here's how:
```bash
python3 -c 'import pty; pty.spawn("/bin/bash")'
```
<kbd>Ctrl</kbd>+<kbd>z</kbd>
```bash
# get your current terminal size (rows and columns)
stty size
stty echo -raw

# for bash/sh (enter raw mode and disable echo'ing)
stty raw -echo
fg

# for zsh (enter raw mode and disable echo'ing)
stty raw -echo; fg

reset
export SHELL=bash
export TERM=xterm
stty rows <num> columns <num> # values found above by 'stty size'
stty rows <num> columns <cols> # <num> and <cols> values found above by 'stty size'
```
> <sup>[1] [Reverse Shell Cheatsheet](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#spawn-tty-shell)</sup>
<!--
</details>
-->
Expand Down

0 comments on commit d805c25

Please sign in to comment.