Last active
October 4, 2023 21:23
-
-
Save ptrsimon/5bb857bc3e4d960a7a25184b1bd83a7a to your computer and use it in GitHub Desktop.
Read not-yet-flushed history from a running shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bpid=$(ps -o pid,comm xwwwf | grep -A1 screen| tail -1 | awk '{print $1}'); \ | |
| gcore $bpid; strings core.$bpid | grep '@' | grep root | |
| # no gdb? no problem! dd to the rescue | |
| bpid=$(ps -o pid,comm xwwwf | grep -A1 screen| tail -1 | awk '{print $1}'); \ | |
| offset=$(grep heap /proc/$bpid/maps|cut -d '-' -f 1); \ | |
| end=$(grep heap /proc/$bpid/maps|cut -d '-' -f 2|awk '{print $1}'); \ | |
| dd if=/proc/$bpid/mem iflag=skip_bytes,count_bytes bs=$(getconf PAGESIZE) skip=$((0x$offset)) count=$((0x$end - 0x$offset)) status=none \ | |
| | strings | grep root@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment