From 1246bbc17fd45d7f0f16d1babb89154bc7193fd2 Mon Sep 17 00:00:00 2001 From: Roman Mueller Date: Sat, 1 Sep 2018 12:01:15 +0200 Subject: [PATCH] Add history --- _gtfobins/history.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 _gtfobins/history.md diff --git a/_gtfobins/history.md b/_gtfobins/history.md new file mode 100644 index 0000000..578526e --- /dev/null +++ b/_gtfobins/history.md @@ -0,0 +1,23 @@ +--- +functions: + file-write: + - description: | + Resulting file will contain additional timestamp lines in the format of `#1535795174` for each data line. + - code: | + LFILE=file_to_write + HISTCONTROL=ignorespace + history -c + DATA + history -w $LFILE + file-read: + - description: The file content will be surrounded by your current bash history session content. + - code: | + LFILE=file_to_read + HISTTIMEFORMAT=$'\r\e[K' + history -r $LFILE + history + sudo-enabled: + - code: | + LFILE=file_to_read + sudo bash -c "HISTTIMEFORMAT=$'\r\e[K' && history -r $LFILE && history" +---