nitesh@gupta
Proving Grounds Linux

SCRUTINY

Full walkthrough — enumeration, foothold and privilege escalation.

Nmap output

Nmap scan report for 192.168.217.91
Host is up (0.058s latency).
Not shown: 65531 filtered tcp ports (no-response), 1 closed tcp port (conn-refused)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 62:36:1a:5c:d3:e3:7b:e1:70:f8:a3:b3:1c:4c:24:38 (RSA)
|   256 ee:25:fc:23:66:05:c0:c1:ec:47:c6:bb:00:c7:4f:53 (ECDSA)
|_  256 83:5c:51:ac:32:e5:3a:21:7c:f6:c2:cd:93:68:58:d8 (ED25519)
25/tcp open  smtp    Postfix smtpd
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: onlyrands.com, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING
| ssl-cert: Subject: commonName=onlyrands.com
| Subject Alternative Name: DNS:onlyrands.com
| Issuer: commonName=onlyrands.com
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2024-06-07T09:33:24
| Not valid after:  2034-06-05T09:33:24
| MD5:   c8cd:3971:35a3:7fc5:3769:ef5a:f9bc:57cb
|_SHA-1: b41d:66cb:a6a2:b31a:2c73:6e42:c04e:17e5:003c:da69
80/tcp open  http    nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-title: OnlyRands
Service Info: Host:  onlyrands.com; OS: Linux; CPE: cpe:/o:linux:linux_kernel

We see a domain name in smtp certificate which indicates that IP is mapped to server. So added domain name in /etc/hosts file & ran ffuf to enumerate vhost

SCRUTINY walkthrough, Got root, screenshot 1
SCRUTINY, step 1

We have Teamcity running on teams.onlyrands.com which is vulnerable to https://github.com/yoryio/CVE-2024-27198

SCRUTINY walkthrough, Got root, screenshot 2
SCRUTINY, step 2

Created new user using exploit

SCRUTINY walkthrough, Got root, screenshot 3
SCRUTINY, step 3

Got access using new creds

SCRUTINY walkthrough, Got root, screenshot 4
SCRUTINY, step 4

We got id_rsa in marcot changelog

SCRUTINY walkthrough, Got root, screenshot 5
SCRUTINY, step 5

Got ssh access using id_rsa

SCRUTINY walkthrough, Got root, screenshot 6
SCRUTINY, step 6

We got paasword using ssh2john & cracking the has to get pass

SCRUTINY walkthrough, Got root, screenshot 7
SCRUTINY, step 7

Using pass to ssh into machine

SCRUTINY walkthrough, Got root, screenshot 8
SCRUTINY, step 8

We got password for matthewa in /var/mail/marcot

SCRUTINY walkthrough, Got root, screenshot 9
SCRUTINY, step 9

Got access as matthewa

SCRUTINY walkthrough, Got root, screenshot 10
SCRUTINY, step 10

We got password from .~

SCRUTINY walkthrough, Got root, screenshot 11
SCRUTINY, step 11

Tried password on all user and it worked on briand

SCRUTINY walkthrough, Got root, screenshot 12
SCRUTINY, step 12

We have sudo access on systemctl

SCRUTINY walkthrough, Got root, screenshot 13
SCRUTINY, step 13

Got root

SCRUTINY walkthrough, Got root, screenshot 14
SCRUTINY, step 14

Got local.txt (c252ff1809321eccb4dbfe69f39cfd06)

SCRUTINY walkthrough, Got root, screenshot 15
SCRUTINY, step 15

Got proof.txt (9856a1e4d359e813fdfc68ac6869ca06)

SCRUTINY walkthrough, Got root, screenshot 16
SCRUTINY, step 16

More walkthroughs