indicogniBuild a VMM

Lab

ANSI filter

Used in chapter 09, the tty-termios primer.

A guest can print bytes that make your terminal change its title, write your clipboard or type for you, so macvmm filters them. Type the bytes a guest prints and see three views side by side: what a terminal would do with them, what macvmm's safe policy lets through (and the rule behind every removal), and what strict writes to a log.

Runs in browser
Guest bytes through macvmm's safe filter Four inputs and what the safe policy writes. ESC [ 1 ; 3 1 m hi ESC [ 0 m passes unchanged: two SGR sequences with small numeric parameters. ESC ] 0 ; rm -rf ~ BEL ok becomes ok: the whole OSC title string is dropped, up to and including its BEL. before ESC [ 6 n after becomes before, two spaces, after: the cursor position query is dropped, so the terminal never types a reply. A lone byte 0x9B followed by 6n becomes the plain text 6n: the 8-bit CSI byte is dropped on its own, and what follows is text. guest writes safe writes \x1b[1;31mhi\x1b[0m \x1b[1;31mhi\x1b[0m kept: SGR (colour) is allowed \x1b]0;rm -rf ~\x07ok ok dropped: OSC title, whole string before \x1b[6n after before after dropped: a query (cursor position) \x9b6n 6n dropped: raw 8-bit CSI byte

All labs