{"id":696,"date":"2020-08-18T23:48:06","date_gmt":"2020-08-18T22:48:06","guid":{"rendered":"https:\/\/cybercop-training.ch\/?p=696"},"modified":"2020-09-07T21:25:54","modified_gmt":"2020-09-07T20:25:54","slug":"analyzing-router-firmware-p3","status":"publish","type":"post","link":"https:\/\/cybercop-training.ch\/?p=696","title":{"rendered":"Analyzing Router Firmware P3"},"content":{"rendered":"<p><strong>Challenge 3 &#8211; hidden backdoor<\/strong><\/p>\n<blockquote><p>A massive breach was detected at an insurance company. Their admin suspects that their Wi-Fi routers were compromised and have backdoors installed in them. Unfortunately, they have no clue how to go about uncovering it. Your colleague goes onsite and recovers the firmware by dumping the flash of the device.<\/p>\n<p><b>Your mission is to uncover the backdoor and find the hidden user + password on the system.\u00a0<\/b><\/p><\/blockquote>\n<p>Like in the previous challenges the first step I&#8217;ll do is to extract the content of the firmware image<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-697\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk11.png\" alt=\"\" width=\"594\" height=\"264\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk11.png 594w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk11-300x133.png 300w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><\/a><\/p>\n<p>After the firmware extraction is complete I&#8217;ll browse in the squashfs-root\/etc directory. From there I&#8217;ll check the rc.local file<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk12.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-698 alignnone\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk12.png\" alt=\"\" width=\"572\" height=\"601\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk12.png 572w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk12-286x300.png 286w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a><\/p>\n<p>This looks like commandinjection to setup a hidden useraccount on startup<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-699\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk13-1024x157.png\" alt=\"\" width=\"1024\" height=\"157\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk13-1024x157.png 1024w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk13-300x46.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk13-768x118.png 768w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/binwalk13.png 1049w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>To crack the password I&#8217;ll use again hashcat and <strong>prepare<\/strong> the rc.local file for cracking<\/p>\n<p><code>ssl:$6$2jX357gX$atKiUd8KtjITKXF.osCPbU8sUt2hVcxHjVvhm96gyrFzLU17wDXNRTPsycLUTNzm6WdOg2TjCbLzeEXn9nzB0\/:17799:0:99999:7:::<\/code><\/p>\n<p><strong><code>hashcat -m 1800 -a 0 rc.local 1000000-password-seclist.txt<\/code><\/strong><\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-701\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat3.png\" alt=\"\" width=\"607\" height=\"509\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat3.png 607w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat3-300x252.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/a><\/p>\n<p>After a while the hash is cracked:<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-702\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat4.png\" alt=\"\" width=\"771\" height=\"332\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat4.png 771w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat4-300x129.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/08\/hashcat4-768x331.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/a><\/p>\n<p>username: ssl<\/p>\n<p>password: gandalf \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Challenge 3 &#8211; hidden backdoor A massive breach was detected at an insurance company. Their admin suspects that their Wi-Fi routers were compromised and have <a class=\"mh-excerpt-more\" href=\"https:\/\/cybercop-training.ch\/?p=696\" title=\"Analyzing Router Firmware P3\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":2,"featured_media":664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4,17,16],"tags":[],"class_list":["post-696","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-forensic","category-hacking","category-iot-stuff","category-linux"],"_links":{"self":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts\/696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=696"}],"version-history":[{"count":2,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts\/696\/revisions"}],"predecessor-version":[{"id":703,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts\/696\/revisions\/703"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/media\/664"}],"wp:attachment":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}