From 35967d519848ccd080abff028790279717dee78c Mon Sep 17 00:00:00 2001 From: Anonymous ethc4 Date: Wed, 27 Aug 2025 06:35:45 -0400 Subject: [PATCH 1/3] Create shred.md --- _gtfobins/shred.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 _gtfobins/shred.md diff --git a/_gtfobins/shred.md b/_gtfobins/shred.md new file mode 100644 index 00000000..06316535 --- /dev/null +++ b/_gtfobins/shred.md @@ -0,0 +1,19 @@ +--- +description: Utility to Secure Delete a File in Unix +functions: + - name: Execute arbitrary commands as root + platform: unix + exploit: + - "If shred is run as root, you can abuse it to execute arbitrary commands by deleting files or scripts:" + - "`shred -u /path/to/important/file`" + - "For example, if you control the file `/tmp/myscript.sh`, you could shred it to trigger deletion and combine it with other root permissions to escalate." + - name: Delete arbitrary files + platform: unix + exploit: + - "`shred -u /path/to/file` deletes the specified file securely." + - "When run as root, any file on the system can be securely deleted using this command." +notes: + - "Requires the shred binary to be run with elevated privileges (root)." + - "Abuse potential depends on system configuration and file permissions." + - "This is primarily a file deletion vector, not arbitrary code execution, unless combined with other exploits." +--- From 6432c476ecaee31735d3cced89ea0931b15a2f15 Mon Sep 17 00:00:00 2001 From: Anonymous ethc4 Date: Wed, 27 Aug 2025 06:39:31 -0400 Subject: [PATCH 2/3] Update shred.md Fixed Syntax --- _gtfobins/shred.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/_gtfobins/shred.md b/_gtfobins/shred.md index 06316535..8a688bea 100644 --- a/_gtfobins/shred.md +++ b/_gtfobins/shred.md @@ -1,19 +1,12 @@ --- -description: Utility to Secure Delete a File in Unix +description: Utility to Secure Delete A File in Unix functions: - - name: Execute arbitrary commands as root - platform: unix - exploit: - - "If shred is run as root, you can abuse it to execute arbitrary commands by deleting files or scripts:" - - "`shred -u /path/to/important/file`" - - "For example, if you control the file `/tmp/myscript.sh`, you could shred it to trigger deletion and combine it with other root permissions to escalate." - - name: Delete arbitrary files - platform: unix - exploit: - - "`shred -u /path/to/file` deletes the specified file securely." - - "When run as root, any file on the system can be securely deleted using this command." -notes: - - "Requires the shred binary to be run with elevated privileges (root)." - - "Abuse potential depends on system configuration and file permissions." - - "This is primarily a file deletion vector, not arbitrary code execution, unless combined with other exploits." + file-delete: + - code: | + LFILE=file_to_delete + shred -u $LFILE + sudo: + - code: | + LFILE=file_to_delete + sudo shred -u $LFILE --- From 7f66d4e7fbe64d2cf60380c0599785e4c87a1620 Mon Sep 17 00:00:00 2001 From: Anonymous ethc4 Date: Wed, 27 Aug 2025 06:42:37 -0400 Subject: [PATCH 3/3] Update shred.md --- _gtfobins/shred.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_gtfobins/shred.md b/_gtfobins/shred.md index 8a688bea..b3139e11 100644 --- a/_gtfobins/shred.md +++ b/_gtfobins/shred.md @@ -1,7 +1,7 @@ --- description: Utility to Secure Delete A File in Unix functions: - file-delete: + file-write: - code: | LFILE=file_to_delete shred -u $LFILE