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.

The result: 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.

You can get more information on the makepty Github and you can download it from the static builds release.

I’ve tested it for Linux and FreeBSD and wrote extensive instructions on the Github page.