0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Metasploitable3 特権昇格

Posted at

Metasploitable3にログインして、特権昇格を行います。
Metasploitable3のIPアドレス:192.168.56.123

クレデンシャル情報の取得

Metasploitable3 exploit Drupalを使用して、Metasploitable3にログインします。
/var/www/html/payroll_app.phpを確認すると、ユーザー名、パスワードでログインして、自分の給料が表示されるシステムとなっています。
攻撃端末で、payroll_app.phpをログインせずに、全ユーザーのパスワードを表示するように修正します。
修正したアプリを、Metasploitable3 ファイルアップロードの脆弱性を使って、uploadsフォルダにアップロードします。
ブラウザから、http://192.168.56.123/uploads/payroll_app.phpにアクセスします。
スクリーンショット 2025-05-05 152738.png

ログイン

表示されたユーザー名、パスワードで、sshでログインしてみます。
ユーザー名:leia_organa
パスワード:help_me_obiwan

$ssh leia_organa@192.168.56.123
leia_organa@192.168.56.123's password: 
Welcome to Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-170-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
New release '16.04.7 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Last login: Mon May  5 03:28:39 2025 from 192.168.56.10

leia_organaの所属するグループを確認します。

leia_organa@metasploitable3-ub1404:~$ groups
users sudo

leia_organaは、sudoグループに所属しているので、sudoのリストを確認します。

leia_organa@metasploitable3-ub1404:~$ sudo -l
[sudo] password for leia_organa: 
Matching Defaults entries for leia_organa on metasploitable3-ub1404:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User leia_organa may run the following commands on metasploitable3-ub1404:
    (ALL : ALL) ALL

特権昇格

全アプリで、sudoが許可されています。
su -で、rootになります

leia_organa@metasploitable3-ub1404:~$ sudo su -
root@metasploitable3-ub1404:~# 
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?