--- This was supposed to be a very easy starting point machine but I tried to do it without the guided mode, and the foot hold was actually quite difficult for me. Did a bunch of enumeration not shown here, but really was just difficult for me because I have never done `xxe` before. --- # nmap ```sh PORT STATE SERVICE REASON VERSION 22/tcp open ssh syn-ack OpenSSH for_Windows_8.1 (protocol 2.0) 80/tcp open http syn-ack Apache httpd 2.4.41 ((Win64) OpenSSL/1.1.1c PHP/7.2.28) |_http-server-header: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.28 | http-methods: |_ Supported Methods: GET HEAD POST OPTIONS |_http-title: MegaShopping | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set 443/tcp open ssl/http syn-ack Apache httpd 2.4.41 ((Win64) OpenSSL/1.1.1c PHP/7.2.28) |_http-server-header: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.28 | ssl-cert: Subject: commonName=localhost | Issuer: commonName=localhost | Public Key type: rsa | Public Key bits: 1024 | Signature Algorithm: sha1WithRSAEncryption | Not valid before: 2009-11-10T23:48:47 | Not valid after: 2019-11-08T23:48:47 | MD5: a0a4:4cc9:9e84:b26f:9e63:9f9e:d229:dee0 | SHA-1: b023:8c54:7a90:5bfa:119c:4e8b:acca:eacf:3649:1ff6 | http-methods: |_ Supported Methods: GET HEAD POST OPTIONS |_http-title: MegaShopping | tls-alpn: |_ http/1.1 |_ssl-date: TLS randomness does not represent time | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set ``` # tcp/80 http Credentials were weak and got in ![[Pasted image 20261108060820.png]] ## xxe process.php ![[Pasted image 20261108143329.png]] Reference : https://hacktricks.wiki/en/pentesting-web/xxe-xee-xml-external-entity.html#directory-listing - Recovered private key Daniel's private key ```sh tr '[:space:]' '\n' < daniel.key ``` This fixes our key by converting the white spaces into newlines - Will still have to fix `BEGIN` and `END` key lines manually - `chmod 400` the key ```sh ssh -i daniel.key daniel@$target ``` ### User Flag ![[Pasted image 20261108145556.png]] # Access as Daniel ![[Pasted image 20261108150628.png]] From `privesccheck.ps1` we found autologon credentials We ssh in as `administrator` ![[Pasted image 20261108151248.png]]