From 6f9d02501efa547409526e89116122c4a594825f Mon Sep 17 00:00:00 2001 From: LinuxSploit <68427058+LinuxSploit@users.noreply.github.com> Date: Mon, 3 May 2021 00:23:14 -0400 Subject: [PATCH] add file-write --- _gtfobins/strace.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/_gtfobins/strace.md b/_gtfobins/strace.md index 81c6f49..0cf116e 100644 --- a/_gtfobins/strace.md +++ b/_gtfobins/strace.md @@ -1,5 +1,29 @@ --- functions: + file-write: + - description: write DATA to $WFILE + code: | + LFILE=$(mktemp --suffix=.s) + WFILE=file-to-write + elf=$(mktemp -u) + vi $LFILE + ;#####CODE START##### + .global _start + _start: + .intel_syntax noprefix + mov rax,2 + lea rdi,[rip+DATA] + mov rsi, 0 + syscall + mov rax,60 + mov rdi,0 + syscall + DATA: + .string "THIS IS THE DATA NEED TO BE WRITTEN USING STRACE" + ;#####CODE END##### + :wq + gcc -nostdlib --static $LFILE -o $elf + strace -o $WFILE $elf shell: - code: strace -o /dev/null /bin/sh suid: