From b1a33432e98bcebc9b8af3a910d01eb2aa444431 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Tue, 13 Jul 2021 08:50:51 +0200 Subject: [PATCH] Simplify cmp --- _gtfobins/cmp.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/_gtfobins/cmp.md b/_gtfobins/cmp.md index 15b86ec..97414c0 100644 --- a/_gtfobins/cmp.md +++ b/_gtfobins/cmp.md @@ -1,21 +1,16 @@ --- +description: Dump the bytes of the input file that are different from the NUL byte in a tabular format, hence this may not be suitable to read arbitrary binary files. functions: file-read: - code: | - LFILE=file-to-read - TEMP=$(mktemp) - printf 'A%.0s' {1..999} > $TEMP - cmp $LFILE $TEMP -b -n 999 -l + LFILE=file_to_read + cmp $LFILE /dev/zero -b -l suid: - code: | - LFILE=file-to-read - TEMP=$(mktemp) - printf 'a%.0s' {1..999} > $TEMP - cmp $LFILE $TEMP -b -n 999 -l + LFILE=file_to_read + ./cmp $LFILE /dev/zero -b -l sudo: - code: | - LFILE=file-to-read - TEMP=$(mktemp) - printf 'a%.0s' {1..999} > $TEMP - sudo cmp $LFILE $TEMP -b -n 999 -l + LFILE=file_to_read + sudo cmp $LFILE /dev/zero -b -l ---