LetsDefend-Linux内存取证

LetsDefend-Linux内存取证

Ghazy 是网络开发新手,他创建了自己的网站,但该网站似乎存在漏洞,其中一名攻击者获得了 root 访问权限。你能帮我们检查一下这个内存转储吗?

文件位置:/root/Desktop/ChallengeFile/MyW3B.7z

  • Volatility2 命令:vol.py
  • Volatility3 命令:vol

题目链接

https://app.letsdefend.io/challenge/linux-memory-forensics

内存转储的 Linux 内核版本是什么?

提取内存转储中内核的信息不用vol,直接strings命令匹配BOOT_IMAGE关键字即可。

strings MyW3B.vmem | grep BOOT_IMAGE

是使用什么命令来运行他的网站?

先获取当前支持系统profile,通过linux_bash获取内存中的历史命令记录。

root@ip-172-31-0-166:~/Desktop/ChallengeFile# vol.py --info | grep Linux
Volatility Foundation Volatility Framework 2.6.1
LinuxUbuntu_5_4_0-150-generic_profilex64 - A Profile for Linux Ubuntu_5.4.0-150-generic_profile x64
LinuxAMD64PagedMemory          - Linux-specific AMD 64-bit address space.
linux_aslr_shift           - Automatically detect the Linux ASLR shift
linux_banner               - Prints the Linux banner information
linux_yarascan             - A shell in the Linux memory image
root@ip-172-31-0-166:~/Desktop/ChallengeFile# 
root@ip-172-31-0-166:~/Desktop/ChallengeFile# vol.py -f MyW3B.vmem --profile=LinuxUbuntu_5_4_0-150-generic_profilex64 linux_bash

获取webshell的iNode地址

这里的思路可以使用 linux_enumerate_files – 列出文件系统缓存引用的文件。

vol.py -f MyW3B.vmem --profile=LinuxUbuntu_5_4_0-150-generic_profilex64 linux_enumerate_files >file-inode.txt

将所有的文件iNode信息导出到文件中,再匹配可疑的php文件。

攻击者的ip和端口?

已经获取到webshell的iNode地址后,使用linux_find_file将偏移地址的文件内容导出到文件中。

vol.py -f MyW3B.vmem --profile=LinuxUbuntu_5_4_0-150-generic_profilex64 linux_find_file -i 0xffff9c4fdee03448 -O shell.php

UID 值为 1000 的用户名是什么?

和上面一样提取passwd的iNode地址导出即可,如果不确定可以把几个passwd地址的文件内容都导出到文件。

root@ip-172-31-10-214:~/Desktop/ChallengeFile# cat file-inode.txt | grep /etc/passwd
0x0 ------------------------- /var/lib/docker/overlay2/41da0bf7cfafbbe7d17c2852606e74f3206d12a283c35e149b5dbb549d9dc200-init/diff/etc/passwd
0xffff9c5034652328                   1083428 /var/lib/docker/overlay2/f72a488c286cedf99de30dd6ee7974dc0505f7a4862bd9fc72c3527721f7b737/diff/etc/passwd
0xffff9c500abd7480                    136565 /etc/passwd
0xffff9c500abdee50                   1083428 /var/lib/docker/overlay2/41da0bf7cfafbbe7d17c2852606e74f3206d12a283c35e149b5dbb549d9dc200/merged/etc/passwd
root@ip-172-31-10-214:~/Desktop/ChallengeFile# 
root@ip-172-31-10-214:~/Desktop/ChallengeFile# vol.py -f MyW3B.vmem --profile=LinuxUbuntu_5_4_0-150-generic_profilex64 linux_find_file -i 0xffff9c500abd7480  -O passwd

受害者的ip?

vol.py -f MyW3B.vmem --profile=LinuxUbuntu_5_4_0-150-generic_profilex64 linux_ifconfig
赞赏

微信赞赏支付宝赞赏

Zgao

愿有一日,安全圈的师傅们都能用上Zgao写的工具。

发表评论