wkz / ply

Light-weight Dynamic Tracer for Linux
https://wkz.github.io/ply
GNU General Public License v2.0
399 stars 152 forks source link

Add ptysnoop.ply to scripts #4

Closed AlbertVeli closed 7 years ago

AlbertVeli commented 7 years ago

Snoops asci-codes of keypresses by probing pty_write()

Example of script to extract ascii from bash below.

The trap line catches sigint and sends it on to ply without killing the script when user presses Ctrl-c.

trap "killall -SIGINT ply" INT sudo ply ptysnoop.ply > keys.txt cat keys.txt | grep bash: | awk '/bash: / { printf("%s", $2); next } 1' > hex.txt xxd -r -p hex.txt