このページにはプロモーションが含まれています。
はじめに
『ハッキング・ラボのつくりかた 完全版』(IPUSIRON・著)の
練習問題に挑戦しました。
そのときのメモを残し、ラボ仲間の実験のお役に立てればと思い、記事にしました。
参考になればうれしいです。
練習問題 #01
問題01-1
ここからは、練習問題に取り組む際に行った作業についてお話しします。
#01はPotatoマシンのハッキングでした。
PotatoマシンにwebadminユーザーでSSHアクセスして設問に答えます。
SSHアクセスするためにいくつか調べます。
まず、ParrotOSのIPアドレスを調べます。

IPアドレスは、192.168.56.101でした。
PotatoマシンのIPアドレスを特定します。
sudo netdiscover -i enp0s3 -r 192.168.56.0/24

PotatoマシンのIPアドレスは、192.168.56.116でした。
IPアドレスを環境変数に設定します。設定したらPingします。

IPアドレスの疎通確認ができたのでSSHアクセスします。
認証情報は取得済みの前提で進めます。

問題01ー1
(1)

(2)

(3)
net-toolsの情報を表示して、インストールされていないことを確認しました。

(4)

(5)

問題01ー2
ルートシェルを奪取します。

(1)
コマンドの意味として考えたこと
/からファイル名に「password」が含まれるファイルを探す。

(2)
コマンドの意味として考えたこと
標準エラー出力を捨てて、/からファイル名に「password」が含まれるファイルを探す。

(3)
テキスト形式のファイルに絞って検索するコマンドとして次のようにして実行しました。

巻末付録の「ヒントと解答」のコマンドを実行したものと
上記のコマンドの結果を比べてみました。
一致して検索できたもの

一致しない7つのファイルを含んで検索されました。

おわりに
以上、ハッキング・ラボ練習問題#01のメモでした。
お読みいただきありがとうございました!

コメント