How it technically works
- A terminal escape sequence is a special sequence of characters that is printed (like any other text).
- If the terminal understands the sequence, it won’t display the character-sequence, but will perform some action.
- As you can see, our beloved ‘cat’ cheated on us.
- Instead of displaying the character-sequence, the escape sequence \033[XA (being X the number of times) performed some action.
- And this action moves the cursor up X times, overwriting what is above it X lines.
- But this doesn’t affect only
cat
, it affects everything that interprets escape sequences.
- But if we pipe it into a shell
diff
also interprets escape sequences and so do the resulting patches
Reference
http://www.openwall.com/lists/oss-security/2015/09/17/5 http://www.openwall.com/lists/oss-security/2015/08/11/8 http://turbochaos.blogspot.ca/2014/08/journalctl-terminal-escape-injection.html
Post Navigation
How to Block Facebook Realtime Log Monitoring in Your Browser