AOC2 - Day 13 - TryHackMe

 

Room Link

Advent Of CyberSecurity 2

Task 18 : [Day 13] Special by John Hammond Coal for Christmas

Let’s start by a nmap scan

/assets/images/posts/aoc213/Untitled.png

What old, deprecated protocol and service is running?

telnet

if it is not already intalled you can install it by using sudo apt install telnet

/assets/images/posts/aoc213/Untitled%201.png

What credential was left for you?

clauschristmas

What distribution of Linux and version number is this server running?

ubuntu 12.04

/assets/images/posts/aoc213/Untitled%202.png

Who got here first?

grinch

/assets/images/posts/aoc213/Untitled%203.png

As found using the uname command , our linux kerner version is 3.2.0-23-generic so we find Dirty Cow exploit according to that

/assets/images/posts/aoc213/Untitled%204.png

download this exploit, place it in a directory and start a python http server, you can visit the server at http://:port

/assets/images/posts/aoc213/Untitled%205.png

/assets/images/posts/aoc213/Untitled%206.png

Now you can get the exploit on the target machine using wget

/assets/images/posts/aoc213/Untitled%207.png

What is the verbatim syntax you can use to compile, taken from the real C source code comments?

gcc -pthread dirty.c -o dirty -lcrypt

use this to compile and execute the binary giving new password as argument. Then use the same password to elevate your privilege

/assets/images/posts/aoc213/Untitled%208.png

What “new” username was created, with the default operations of the real C source code?

firefart

What is the MD5 hash output?

/assets/images/posts/aoc213/Untitled%209.png