Skip to content

Commit bbbb917

Browse files
committed
Do style cleaning on metadata
1 parent af24e03 commit bbbb917

File tree

1 file changed

+39
-23
lines changed

1 file changed

+39
-23
lines changed

modules/exploits/linux/local/desktop_privilege_escalation.rb

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
# This module requires Metasploit: http//metasploit.com/download
2+
# This module requires Metasploit: http://metasploit.com/download
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

@@ -16,31 +16,47 @@ class Metasploit4 < Msf::Exploit::Local
1616

1717
def initialize(info={})
1818
super( update_info( info, {
19-
'Name' => 'Desktop Linux Password Stealer and Privilege Escalation',
20-
'Description' => %q{
21-
This module steals the user password of an administrative user on a desktop Linux system when it is entered for unlocking the screen or for doing administrative actions using policykit. Then it escalates to root privileges using sudo and the stolen user password.
22-
23-
It exploits the design weakness that there is no trusted channell for transferring the password from the keyboard to the actual password verificatition against the shadow file (which is running as root since /etc/shadow is only readable to the root user). Both screensavers (xscreensaver/gnome-screensaver) and policykit use a component running under the current user account to query for the password and then pass it to a setuid-root binary to do the password verification. Therefore it is possible to inject a password stealer after compromising the user account. Since sudo requires only the user password (and not the root password of the system), stealing the user password of an administrative user directly allows escalating to root privileges.
24-
25-
Please note that you have to start a handler as a background job before running this exploit since the exploit will only create a shell when the user actually enters the password (which may be hours after launching the exploit). Using exploit/multi/handler with the option ExitOnSession set to false should do the job.
19+
'Name' => 'Desktop Linux Password Stealer and Privilege Escalation',
20+
'Description' => %q{
21+
This module steals the user password of an administrative user on a desktop Linux system
22+
when it is entered for unlocking the screen or for doing administrative actions using
23+
policykit. Then it escalates to root privileges using sudo and the stolen user password.
24+
It exploits the design weakness that there is no trusted channell for transferring the
25+
password from the keyboard to the actual password verificatition against the shadow file
26+
(which is running as root since /etc/shadow is only readable to the root user). Both
27+
screensavers (xscreensaver/gnome-screensaver) and policykit use a component running under
28+
the current user account to query for the password and then pass it to a setuid-root binary
29+
to do the password verification. Therefore it is possible to inject a password stealer
30+
after compromising the user account. Since sudo requires only the user password (and not
31+
the root password of the system), stealing the user password of an administrative user
32+
directly allows escalating to root privileges. Please note that you have to start a handler
33+
as a background job before running this exploit since the exploit will only create a shell
34+
when the user actually enters the password (which may be hours after launching the exploit).
35+
Using exploit/multi/handler with the option ExitOnSession set to false should do the job.
36+
},
37+
'License' => MSF_LICENSE,
38+
'Author' => ['Jakob Lell'],
39+
'DisclosureDate' => 'Aug 7 2014',
40+
'Platform' => 'linux',
41+
'Arch' => [ARCH_X86, ARCH_X86_64],
42+
'SessionTypes' => ['shell', 'meterpreter'],
43+
'Targets' =>
44+
[
45+
['Linux x86', {'Arch' => ARCH_X86}],
46+
['Linux x86_64', {'Arch' => ARCH_X86_64}]
47+
],
48+
'DefaultOptions' =>
49+
{
50+
'PrependSetresuid' => true,
51+
'PrependFork' => true,
52+
'DisablePayloadHandler' => true
2653
},
27-
'License' => MSF_LICENSE,
28-
'Author' => [ 'Jakob Lell' ],
29-
'DisclosureDate' => 'Aug 7 2014',
30-
'Platform' => %w{ linux },
31-
'Arch' => [ ARCH_X86 ],
32-
'SessionTypes' => [ 'shell', 'meterpreter' ],
33-
'Targets' =>
34-
[
35-
[ 'Linux x86', { 'Arch' => ARCH_X86 } ],
36-
[ 'Linux x86_64', { 'Arch' => ARCH_X86_64 } ]
37-
],
38-
'DefaultOptions' => { "PrependSetresuid" => true, "PrependFork" => true , "DisablePayloadHandler" => true},
39-
'DefaultTarget' => 0,
54+
'DefaultTarget' => 0,
4055
}
41-
))
56+
))
57+
4258
register_options([
43-
OptString.new("WritableDir", [ true, "A directory for storing temporary files on the target system", "/tmp" ]),
59+
OptString.new("WritableDir", [ true, "A directory for storing temporary files on the target system", "/tmp" ]),
4460
], self.class)
4561
end
4662

0 commit comments

Comments
 (0)