{"id":17,"date":"2011-10-22T09:53:01","date_gmt":"2011-10-22T09:53:01","guid":{"rendered":"http:\/\/arkorobotics.com\/blog\/?p=17"},"modified":"2012-01-18T05:51:31","modified_gmt":"2012-01-18T05:51:31","slug":"iclicker-hacking-part-1","status":"publish","type":"post","link":"http:\/\/arkorobotics.com\/blog\/?p=17","title":{"rendered":"iClicker Hacking &#8211; Part 1"},"content":{"rendered":"<p>Before I start, I&#8217;d like to note that this is my first reverse engineering project.<\/p>\n<p>So the story here starts with me taking a class that required me to purchase one of these iClicker&#8217;s (\u00a0<a href=\"http:\/\/www.iclicker.com\/Products\/iclicker\/\">http:\/\/www.iclicker.com\/Products\/iclicker\/<\/a>\u00a0), otherwise I wouldn&#8217;t get &#8220;participation&#8221; points in class :\/ So I purchased one and booted it up during lecture to &#8220;participate&#8221;. It was neat to see some tech in the classroom, but the material wasn&#8217;t any more interesting, so I decided to tear this thing apart&#8230; I busted out my utilikey and tore it apart mid-lecture.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"First Teardown\" src=\"http:\/\/farm7.static.flickr.com\/6106\/6232045104_f2809a0e4b_z.jpg\" alt=\"\" width=\"478\" height=\"640\" \/><\/p>\n<p>At this point the professor noticed all the students were &#8220;participating&#8221; except me. She then walked up to my desk and noticed the iClicker completely torn apart and asked &#8220;What are you doing?&#8221; to which I\u00a0responded &#8220;Opening this thing up..&#8221; and she responded with\u00a0&#8220;This is not apart of the lecture, you shouldn&#8217;t be doing this in class. This is very important you should be paying attention.&#8221; \u00a0I figured it&#8217;s time to protect my grades so I said I would clean it up right away, and did so.. (unhappily)<\/p>\n<p>I snapped a few shots of the tear down before doing so..<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"buttons\" src=\"http:\/\/farm7.static.flickr.com\/6240\/6231514445_4eea3196b6_z.jpg\" alt=\"\" width=\"640\" height=\"478\" \/><\/p>\n<p>Here we see the Buttons &#8220;A&#8221; \u00a0&#8220;B&#8221; \u00a0&#8220;C&#8221; \u00a0&#8220;D&#8221; \u00a0&#8220;E&#8221; \u00a0and &#8220;ON\/OFF&#8221;.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"XE1203F\" src=\"http:\/\/farm7.static.flickr.com\/6212\/6232034330_7ca725b2d9_z.jpg\" alt=\"\" width=\"478\" height=\"640\" \/><\/p>\n<p>Noticed the RF hardware consisted of an XE1203F ( <a href=\"http:\/\/www.semtech.com\/images\/datasheet\/xe1203f.pdf\">http:\/\/www.semtech.com\/images\/datasheet\/xe1203f.pdf<\/a>\u00a0)\u00a0which does ISM band (iClicker is configured for 900Mhz)<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"atmel\" src=\"http:\/\/farm7.static.flickr.com\/6158\/6232034688_7e6e746db1_z.jpg\" alt=\"\" width=\"478\" height=\"640\" \/><\/p>\n<p>Discovered the microcontroller is an ATMega8A ( <a href=\"http:\/\/www.atmel.com\/dyn\/resources\/prod_documents\/doc8159.pdf\">http:\/\/www.atmel.com\/dyn\/resources\/prod_documents\/doc8159.pdf<\/a>\u00a0)\u00a0 and best of all.. the ICSP pads are broken out for you already!! At this point I was hoping that the security bit wasn&#8217;t set so I could dump the firmware and EEPROM.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"wpor\" src=\"http:\/\/farm7.static.flickr.com\/6233\/6238061367_c1d72f3616_z.jpg\" alt=\"\" width=\"640\" height=\"478\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"prog\" src=\"http:\/\/farm7.static.flickr.com\/6238\/6238063401_3877468e10_z.jpg\" alt=\"\" width=\"640\" height=\"478\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>I later got to my setup at Nullspace Labs ( <a href=\"http:\/\/032.la\/\">http:\/\/032.la\/<\/a> ) \u00a0and soldered on a 6pin header for the ICSP line. Then connected my AVR Dragon and attempted to dump the firmware and EEPROM from the ATMega8A with an external power supply connected to the power leads for the battery. As soon as I attempted the read, the iClicker reset itself. So I figured the power management must be doing some funky things, so lets by pass all that and go directly to the ATMega8A&#8217;s VCC and GND line. I soldered on some kynar\u00a0wire to pin 4 (vcc) and pin 5 (gnd) and attempted the read again..<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"success\" src=\"http:\/\/farm7.static.flickr.com\/6213\/6268774188_a9d65b246c.jpg\" alt=\"\" width=\"473\" height=\"500\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"fuse\" src=\"http:\/\/farm7.static.flickr.com\/6041\/6268247965_7bf16c90aa.jpg\" alt=\"\" width=\"469\" height=\"500\" \/><\/p>\n<p>Success!! The security bit was never set! So now that I could communicate with the chip, I decided dumped the firmware and EEPROM. (Reversing in IDA to come in Part 2)<\/p>\n<p>&nbsp;<\/p>\n<p>At this point I realized the hardware ID must be in the EEPROM, so I went exploring looking for &#8220;3300B586&#8221; which is the hardware ID written on the back of the device:<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"agae\" src=\"http:\/\/farm7.static.flickr.com\/6155\/6238581760_3f38f6b487_z.jpg\" alt=\"\" width=\"640\" height=\"478\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"ff\" src=\"http:\/\/farm7.static.flickr.com\/6040\/6268258829_abc604709f_z.jpg\" alt=\"\" width=\"640\" height=\"252\" \/><\/p>\n<p>I noticed at line 0 column A the sequence &#8220;3300B5&#8221;, huzah! \u00a0At this point I could just modify this and change the hardware ID of the iClicker!<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"fss\" src=\"http:\/\/farm7.static.flickr.com\/6032\/6268161495_fcd90eb6ed_z.jpg\" alt=\"\" width=\"640\" height=\"478\" \/><\/p>\n<p>Next I decided to listen to the communication between the ATMega8A and XE1203F by sniffing the SPI bus, following the datasheets I soldered up some wire to the SPI lines. Once the wiring was done I used my handy AnnaLogic to sniff the SPI bus.<\/p>\n<p><img loading=\"lazy\" title=\"fdwwww\" src=\"http:\/\/farm7.static.flickr.com\/6225\/6265085297_9781ee3bc8.jpg\" alt=\"\" width=\"500\" height=\"374\" \/><\/p>\n<p>AnnaLogic (16-channel logic analyzer) from Nullspace Labs (available for purchase here for $40: \u00a0<a href=\"http:\/\/www.nullspacelabs.com\/catalog\/products.php?5&amp;sid=mkkhjkoj10qo012972ufdfhka3\">http:\/\/www.nullspacelabs.com\/catalog\/products.php?5&amp;sid=mkkhjkoj10qo012972ufdfhka3<\/a>\u00a0) Totally easy to use and it fits in an egg!!<\/p>\n<p>&nbsp;<\/p>\n<p>Once I powered up the iClicker (note: it&#8217;s not connected to an instructor machine) I began the sniffing and pressed the following sequence of buttons: \u00a0A \u00a0B \u00a0C \u00a0D \u00a0E . I noticed that there was only data on the Slave Input lines, which makes sense since there is no instructor machine to send data back. Between each button I pressed only one byte was changed, and it doesn&#8217;t seem to be as\u00a0intuitive\u00a0as &#8216;A&#8217;, &#8216;B&#8217;, &#8216;C&#8217;,&#8217;D&#8217;,&#8217;E&#8217;. Instead A = 177 (0xB1) , B = 181 (0xB5), C = 189 (0xBD), D = 190 (0xBE), E = 186 (0xBA).<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"sniff\" src=\"http:\/\/farm7.static.flickr.com\/6212\/6268859244_8eb6f13777_b.jpg\" alt=\"\" width=\"1024\" height=\"324\" \/><\/p>\n<p>Next I need to capture some traffic between my iClicker and the instructor machine to see a full cycle of registering the iClicker to the instructor machine, voting and\u00a0receiving\u00a0confirmation that the vote went through.. I&#8217;ll leave that for Part 2.<\/p>\n<p>Please note that I will NOT be doing this packet capture in the classroom (it&#8217;s no place for learning anyway), I&#8217;ve decided to purchase an instructor base station to prevent any issues with my school. Plus it gives me control to test and try out things I normally wouldn&#8217;t be able to do.<\/p>\n<p>&nbsp;<\/p>\n<p>For the mean time I need the clicker for lectures so I&#8217;ve poked a hole into it.. totally looks normal \ud83d\ude42<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"ewewf\" src=\"http:\/\/farm7.static.flickr.com\/6100\/6238581614_e9beaf038a_z.jpg\" alt=\"\" width=\"478\" height=\"640\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Next up.. reverse engineering the firmware in IDA, stay tuned for Part 2:<\/p>\n<p><img loading=\"lazy\" class=\"alignnone\" title=\"ida\" src=\"http:\/\/farm7.static.flickr.com\/6160\/6268799588_489c8380e6_b.jpg\" alt=\"\" width=\"1024\" height=\"395\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>So far the only defeat has been spoofing other iClicker hardware ID&#8217;s by reprogramming the EEPROM (thankfully iClicker never set any security bits \ud83d\ude42 ) It&#8217;s not much yet, but next up is to reverse the firmware and figuring out how the packets are sent, handled and then to create a new firmware with some extra features. A few new features I&#8217;ve thought of are listening in to other iClickers, submitting and spoofing as other iClickers, and making a \u00a0general purpose ISM band radio.<\/p>\n<p>&nbsp;<\/p>\n<p>Interested in hardware hacking? \u00a0 Layerone 2012\u00a0<a href=\"http:\/\/www.layerone.org\/\">http:\/\/www.layerone.org\/<\/a>\u00a0 \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before I start, I&#8217;d like to note that this is my first reverse engineering project. So the story here starts with me taking a class that required me to purchase one of these iClicker&#8217;s (\u00a0http:\/\/www.iclicker.com\/Products\/iclicker\/\u00a0), otherwise I wouldn&#8217;t get &#8220;participation&#8221; points in class :\/ So I purchased one and booted it up during lecture to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/17"}],"collection":[{"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":13,"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":25,"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/25"}],"wp:attachment":[{"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/arkorobotics.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}