You can skip the security of the Apple OS X Yosemite operating system and gain administrative rights by using a few lines of code that fit into a tweet.
The functional Yosemite, also known as 10.10, is the latest stable version of Apple's operating system, so many will have problems with this vulnerability.
The bug that can be exploited by malicious software and hackers to gain full control of the computer, documented by well-known researcher Stefan Esser.
Everything is possible thanks to an environment variable called DYLD_PRINT_TO_FILE added to Yosemite by Apple. It specifies that within the file system an element of the operating system called dynamic linker can record error logs.
If the variable is changed with a privileged program, an attacker can arbitrarily modify files belonging to the root account, files whose change is allowed only with administrator privileges.
[tweet_embed id = 623727538234368000]These shell commands run the whoami για την ανεύρεση του ονόματος χρήστη (για παράδειγμα iguru) και, στη συνέχεια, υπάρχει το "ALL=(ALL) NOPASSWD:ALL" . Έτσι έχουμε:
ALL = (ALL) NOPASSWD: ALL
Then, the Results via DYLD_PRINT_TO_FILE are recorded and contain the list of users who can gain root-level privileges: /etc/sudoers.
This line tells OS X that your user account has the ability to get root permissions without a password.
A privileged program (owned by root) runs the set-uid newgrp - to access root level in the sudoers file.
Finally, with a sudo -s opens an interactive command-line shell, which has root privileges for the user's account thanks to the updated sudoers file.
From there you can do whatever you want, modify documents, install malware, create new users or whatever else you think of.
The vulnerability exists in the latest version of Yosemite, OS X 10.10.4, as well as the beta version 10.10.5. If you do upgrade in El Capitan beta (OS X 10.11), you will be safe as the vulnerability does not exist.
For a temporary solution to affected systems, download and install it SUIDGuard of Esser.