BASH-HISTORY-RECOVERY(1)marcp.xyzBASH-HISTORY-RECOVERY(1)
NAME
bash-history-recovery - recover bash history via gdb
EXAMPLES
found on this blog: https://www.thanassis.space/bashheimer.html
# Find current users bash handler
$ readlink /proc/$$/fd/1
/dev/pts/13
# Test with:
$ echo "Test" >> /dev/pts/13
# Get the pid of the current shell:
$ echo $$
# Start a gdb session on this pid:
$ sudo gdb --pid 1234
# Call the write history. This maybe has to be casted as an int:
$ call write_history("/tmp/foo")
$ call (int) write_history("/tmp/foo")
# Find your result:
$ less /tmp/foo
marcp.xyz2022-03-22BASH-HISTORY-RECOVERY(1)