# Nmap 7.93 scan initiated Sun Jun 1811:16:222023as: nmap -sC -sV -oN nmap/sandworm sandworm.htb Nmap scan report for sandworm.htb (10.129.38.86) Host is up (0.24s latency). Scanned at2023-06-1811:16:23 IST for29s Not shown: 997 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: |256 b7896c0b20ed49b2c1867c2992741c1f (ECDSA) | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH2y17GUe6keBxOcBGNkWsliFwTRwUtQB3NXEhTAFLziGDfCgBV7B9Hp6GQMPGQXqMk7nnveA8vUz0D7ug5n04A= |25618cd9d08a621a8b8b6f79f8d405154fb (ED25519) |_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfXa+OM5/utlol5mJajysEsV4zb/L0BJ1lKxMPadPvR 80/tcp open http nginx 1.18.0 (Ubuntu) | http-methods: |_ Supported Methods: GET HEAD POST OPTIONS |_http-title: Did not follow redirect to https://ssa.htb/ |_http-server-header: nginx/1.18.0 (Ubuntu) 443/tcp open ssl/http nginx 1.18.0 (Ubuntu) | http-methods: |_ Supported Methods: HEAD GET OPTIONS | ssl-cert: Subject: commonName=SSA/organizationName=Secret Spy Agency/stateOrProvinceName=Classified/countryName=SA/organizationalUnitName=SSA/emailAddress=atlas@ssa.htb/localityName=Classified | Issuer: commonName=SSA/organizationName=Secret Spy Agency/stateOrProvinceName=Classified/countryName=SA/organizationalUnitName=SSA/emailAddress=atlas@ssa.htb/localityName=Classified | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption |Not valid before: 2023-05-04T18:03:25 |Not valid after: 2050-09-19T18:03:25 | MD5: b8b7487ef3e214a4999ef842014159a1 | SHA-1: 80d923678d7b43b2526d5d6100bd66e948ddc223 |-----BEGIN CERTIFICATE----- | MIIDpTCC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XKTb8/Ho/2T2fflK94JaqCbzM | owSKHx8aMbUdNp9Fuld5+Fc88u10ZzIrRl9J5RAeR5ScxQ4RNGTdBVYClk214Pzl | IiyRHacJOxJAUX6EgcMZnLBLgJ1R4u7ZvU3I3BiaENCxvV6ITi61IwusjVCazRf3 | NNn7kmk7cfgQqPCvmwtVrItRHxWEWnkNuQ== |_-----END CERTIFICATE----- |_http-server-header: nginx/1.18.0 (Ubuntu) |_http-title: Secret Spy Agency | Secret Security Service Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Read data files from: /usr/bin/../share/nmap Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . # Nmap done at Sun Jun 1811:16:522023-- 1 IP address (1 host up) scanned in 30.06 seconds
Web
We see it is powered by Flask
Playing around with PGP Key we see name was visible after verfication of Signature
Adding SSTI payload we can get command execution back
Using this SSTI we can see all the files in home directory