Privilege escalation






A diagram describing privilege escalation. The arrow represents a rootkit gaining access to the kernel, and the little gate represents normal privilege elevation, where the user has to enter an Administrator username and password.


Privilege escalation is the act of exploiting a bug, design flaw or configuration oversight in an operating system or software application to gain elevated access to resources that are normally protected from an application or user. The result is that an application with more privileges than intended by the application developer or system administrator can perform unauthorized actions.




Contents






  • 1 Background


  • 2 Vertical


    • 2.1 Examples


    • 2.2 Jailbreaking


    • 2.3 Mitigation strategies




  • 3 Horizontal


    • 3.1 Examples




  • 4 See also


  • 5 References





Background


Most computer systems are designed for use with multiple user accounts, each of which has abilities known as privileges. Common privileges include viewing and editing files, or modifying system files.


Privilege escalation means a user receives privileges they are not entitled to. These privileges can be used to delete files, view private information, or install unwanted programs such as viruses. It usually occurs when a system has a bug that allows security to be bypassed or, alternatively, has flawed design assumptions about how it will be used. Privilege escalation occurs in two forms:




  • Vertical privilege escalation, also known as privilege elevation, where a lower privilege user or application accesses functions or content reserved for higher privilege users or applications (e.g. Internet Banking users can access site administrative functions or the password for a smartphone can be bypassed.)


  • Horizontal privilege escalation, where a normal user accesses functions or content reserved for other normal users (e.g. Internet Banking User A accesses the Internet bank account of User B)



Vertical




Privilege rings for the x86 available in protected mode


This type of privilege escalation occurs when the user or process is able to obtain a higher level of access than an administrator or system developer intended, possibly by performing kernel-level operations.



Examples


In some cases, a high-privilege application assumes that it would only be provided with input matching its interface specification, thus doesn't validate this input.
Then, an attacker may be able to exploit this assumption, in order to run unauthorized code with the application's privileges:



  • Some Windows services are configured to run under the Local System user account. A vulnerability such as a buffer overflow may be used to execute arbitrary code with privilege elevated to Local System. Alternatively, a system service that is impersonating a lesser user can elevate that user's privileges if errors are not handled correctly while the user is being impersonated (e.g. if the user has introduced a malicious error handler)

  • Under some legacy versions of the Microsoft Windows operating system, the All Users screensaver runs under the Local System account – any account that can replace the current screensaver binary in the file system or Registry can therefore elevate privileges.

  • In certain versions of the Linux kernel it was possible to write a program that would set its current directory to /etc/cron.d, request that a core dump be performed in case it crashes and then have itself killed by another process. The core dump file would have been placed at the program's current directory, that is, /etc/cron.d, and cron would have treated it as a text file instructing it to run programs on schedule. Because the contents of the file would be under attacker’s control, the attacker would be able to execute any program with root privileges.


  • Cross Zone Scripting is a type of privilege escalation attack in which a website subverts the security model of web browsers, thus allowing it to run malicious code on client computers.

  • There are also situations where an application can use other high privilege services and has incorrect assumptions about how a client could manipulate its use of these services. An application that can execute Command line or shell commands could have a Shell Injection vulnerability if it uses unvalidated input as part of an executed command. An attacker would then be able to run system commands using the application's privileges.


  • Texas Instruments calculators (particularly the TI-85 and TI-82) were originally designed to use only interpreted programs written in dialects of TI-BASIC; however, after users discovered bugs that could be exploited to allow native Z-80 code to run on the calculator hardware, TI released programming data to support third-party development. (This did not carry on to the ARM-based TI-Nspire, for which jailbreaks using Ndless have been found but are still actively fought against by Texas Instruments.)

  • Some versions of the iPhone allow an unauthorised user to access the phone while it is locked.[1]



Jailbreaking


A jailbreak is the act or tool used to perform the act of breaking out of a chroot or jail in UNIX-like operating systems[2] or bypassing digital rights management (DRM). In the former case, it allows the user to see files outside of the filesystem that the administrator intends to make available to the application or user in question. In the context of DRM, this allows the user to run arbitrarily defined code on devices with DRM as well as break out of chroot-like restrictions. The term originated with the iPhone/iOS jailbreaking community and has also been used as a term for PlayStation Portable hacking; these devices have repeatedly been subject to jailbreaks, allowing the execution of arbitrary code, and sometimes have had those jailbreaks disabled by vendor updates.


iOS systems including the iPhone, iPad, and iPod touch have been subject to iOS jailbreaking efforts since they were released, and continuing with each firmware update.[3][4] iOS jailbreaking tools include the option to install Cydia, a third-party alternative to the App Store, as a way to find and install system tweaks and binaries. To prevent iOS jailbreaking, Apple has made the device boot ROM execute checks for SHSH blobs in order to disallow uploads of custom kernels and prevent software downgrades to earlier, jailbreakable firmware. In an "untethered" jailbreak, the iBoot environment is changed to execute a boot ROM exploit and allow submission of a patched low level bootloader or hack the kernel to submit the jailbroken kernel after the SHSH check.


A similar method of jailbreaking exists for S60 Platform smartphones, where utilities such HelloOX allow the execution of unsigned code and full access to system files.[5][6] or edited firmware (similar to the M33 hacked firmware used for the PlayStation Portable)[7] to circumvent restrictions on unsigned code. Nokia has since issued updates to curb unauthorised jailbreaking, in a manner similar to Apple.


A similar method of jailbreaking in a Android device is calling rooting.


In the case of gaming consoles, jailbreaking is often used to execute homebrew games. In 2011, Sony, with assistance from law firm Kilpatrick Stockton, sued 21-year-old George Hotz and associates of the group fail0verflow for jailbreaking the PlayStation 3 (see Sony Computer Entertainment America v. George Hotz and PlayStation Jailbreak).



Mitigation strategies


Operating systems and users can use the following strategies to reduce the risk of privilege escalation:



  • Data Execution Prevention


  • Address space layout randomization (to make it harder for buffer overruns to execute privileged instructions at known addresses in memory)

  • Running applications with least privilege (for example by running Internet Explorer with the Administrator SID disabled in the process token) in order to reduce the ability of buffer overrun exploits to abuse the privileges of an elevated user.

  • Requiring kernel mode code to be digitally signed.

  • Patching

  • Use of compilers that trap buffer overruns[8]

  • Encryption of software and/or firmware components.

  • Use of an operating system with Mandatory Access Controls (MAC) such as SE Linux[9]



Horizontal


Horizontal privilege escalation occurs when an application allows the attacker to gain access to resources which normally would have been protected from an application or user. The result is that the application performs actions with the same but different security context than intended by the application developer or system administrator; this is effectively a limited form of privilege escalation (specifically, the unauthorized assumption of the capability of impersonating other users).



Examples


This problem often occurs in web applications. Consider the following example:



  • User A has access to their own bank account in an Internet Banking application.

  • User B has access to their own bank account in the same Internet Banking application.

  • The vulnerability occurs when User A is able to access User B's bank account by performing some sort of malicious activity.


This malicious activity may be possible due to common web application weaknesses or vulnerabilities.


Potential web application vulnerabilities or situations that may lead to this condition include:



  • Predictable session ID's in the user's HTTP cookie

  • Session fixation

  • Cross-site scripting

  • Easily guessable passwords

  • Theft or hijacking of session cookies

  • Keystroke logging



See also



  • Defensive programming

  • Hacking of consumer electronics

  • Illegal number

  • Principle of least privilege

  • Privilege revocation (computing)

  • Privilege separation

  • Rooting (Android OS)

  • Row hammer



References





  1. ^ Taimur Asad (October 27, 2010). "Apple Acknowledges iOS 4.1 Security Flaw. Will Fix it in November with iOS 4.2". RedmondPie..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output q{quotes:"""""""'""'"}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-limited a,.mw-parser-output .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}


  2. ^ Peikar, Cyrus (2004-01-12). Security Warrior. O'Reilly Media. p. 304. ISBN 9780596552398. Retrieved 2014-08-19.


  3. ^ James Quintana Pearce (2007-09-27), Apple's Disagreement With Orange, IPhone Hackers, paidContent.org, archived from the original on 2012-07-29, retrieved 2011-11-25


  4. ^ Reports: Next iPhone update will break third-party apps, bust unlocks ComputerWorld on v1.1.3


  5. ^ Phat^Trance (Feb 16, 2010). "Announcement: Forum down for maintaining". dailymobile.se. Archived from the original on March 3, 2009. Retrieved August 30, 2016. Just wanted to let you guys know that the forum is down for maintaining. It will be back online in a day or so (i kinda messed up the config files and need to restore one day old backup, so i thought why not update the entire server platform)


  6. ^ HelloOX 1.03: one step hack for Symbian S60 3rd ed. phones, and for Nokia 5800 XpressMusic too


  7. ^ Bypass Symbian Signed & Install UnSigned SISX/J2ME Midlets on Nokia S60 v3 with Full System Permissions


  8. ^ "Microsoft Minimizes Threat of Buffer Overruns, Builds Trustworthy Applications". Microsoft. September 2005. Retrieved 2008-08-04.
    [dead link]



  9. ^ Smalley, Stephen. "Laying a Secure Foundation for Mobile Devices" (PDF). Retrieved 7 March 2014.









Comments

Popular posts from this blog

Information security

Lambak Kiri

章鱼与海女图