mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 14:30:07 +01:00
Simplify strace file-read
This commit is contained in:
parent
6f9d02501e
commit
254db17d9c
@ -1,29 +1,10 @@
|
|||||||
---
|
---
|
||||||
functions:
|
functions:
|
||||||
file-write:
|
file-write:
|
||||||
- description: write DATA to $WFILE
|
- description: The data to be written appears amid the syscall log, quoted and with special characters escaped in octal notation. The string representation will be truncated, pick a value big enough. More generally, any binary that executes whatever syscall passing arbitrary data can be used in place of `strace - DATA`.
|
||||||
code: |
|
code: |
|
||||||
LFILE=$(mktemp --suffix=.s)
|
LFILE=file_to_write
|
||||||
WFILE=file-to-write
|
strace -s 999 -o $LFILE strace - DATA
|
||||||
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:
|
shell:
|
||||||
- code: strace -o /dev/null /bin/sh
|
- code: strace -o /dev/null /bin/sh
|
||||||
suid:
|
suid:
|
||||||
|
Loading…
Reference in New Issue
Block a user