I’ve recently been spending time creating a static executable that can replace
python3 -c 'import pty;pty.spawn("/bin/bash")' for platforms which lack python, inspired by a FreeBSD box I was attacking on HackTheBox.
makepty, a little Rust program that simply creates a PTY and connects it with stdin and stdout. Click on the video above to see it in use.
I’ve tested it for Linux and FreeBSD and wrote extensive instructions on the Github page.