From d3173153ac36b559062355725d9de965e4129d41 Mon Sep 17 00:00:00 2001 From: Jake Backer Date: Sat, 2 Sep 2023 03:34:45 -0500 Subject: [PATCH] Add file-write to Git Co-authored-by: Andrea Cardaci --- _gtfobins/git.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_gtfobins/git.md b/_gtfobins/git.md index 2d23838..7624927 100644 --- a/_gtfobins/git.md +++ b/_gtfobins/git.md @@ -26,6 +26,10 @@ functions: code: | LFILE=file_to_read git diff /dev/null $LFILE + file-write: + - description: The patch can be created locally by creating the file that will be written on the target using its absolute path, then `git diff /dev/null /path/to/file >x.patch`. + code: | + git apply --unsafe-paths --directory / x.patch sudo: - code: sudo PAGER='sh -c "exec sh 0<&1"' git -p help - description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.