<?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 Travis on Medium]]></title>
        <description><![CDATA[Stories by Travis on Medium]]></description>
        <link>https://medium.com/@sdgeek?source=rss-b5b13d891204------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oIfQj7YYngA5Tw5C-pEJKQ.png</url>
            <title>Stories by Travis on Medium</title>
            <link>https://medium.com/@sdgeek?source=rss-b5b13d891204------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:54:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sdgeek/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[Hack The Box (HTB): Blue]]></title>
            <link>https://medium.com/@sdgeek/hack-the-box-htb-blue-115b3f563125?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/115b3f563125</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Mon, 08 Oct 2018 04:38:47 GMT</pubDate>
            <atom:updated>2018-10-08T05:05:00.795Z</atom:updated>
            <content:encoded><![CDATA[<p>Sunday, October 07, 2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVlu6lX7NSouY9xY7UZ9nw.png" /></figure><p><strong>Tools Used:<br></strong><em>NMAP<br>python<br>smbclient<br>msfvenom<br>metasploit handler</em></p><p><strong>Difficulty: 2/10</strong></p><p><strong>Network Enumeration<br></strong> Let’s start with a quick NMAP scan to discover open ports.</p><pre>nmap -sS --min-rate 5000 --max-retries 1 -p- 10.10.10.40</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*n9XwGy5ZRe9_CfJUbJUZ8w.png" /><figcaption>NMAP scan results</figcaption></figure><p>The quick scan presents us with multiple ports lets perform some scans against SMB port 445 with all the “smb-vuln” NMAP scripts.</p><pre>ls /usr/share/nmap/scripts/ | grep &quot;smb-vuln&quot;</pre><pre>nmap -A -vv --script=smb-vuln-conficker,smb-vuln-cve2009-3103,smb-vuln-cve-2017-7494,smb-vuln-ms06-025,smb-vuln-ms07-029,smb-vuln-ms08-067,smb-vuln-ms10-054,smb-vuln-ms10-061,smb-vuln-ms17-010 -p445 10.10.10.40</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*Wjsv9ThQ9p6XXni52iyojg.png" /><figcaption>SMB-Vuln NMAP scripts</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*GA_JCd2CQ3eMkHmOlbON4A.png" /><figcaption>Starting NMAP scan</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*2EYblHg-XZ3AqxAoPFFNXA.png" /><figcaption>NMAP scan results</figcaption></figure><p>As we can see from the scan this machine is vulnerable to MS17–010 which is an exploit against SMBv1 (EternalBlue). Also from this scan, we will need the computer name “Haris-PC” later in the exploit.</p><p><strong>Exploit Development</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DI0YCvp7G1OPbphKutagng.png" /><figcaption>EternalBlue exploit listed on Exploit-DB.com</figcaption></figure><pre><a href="https://www.exploit-db.com/exploits/42315/">https://www.exploit-db.com/exploits/42315/</a></pre><p>While there is a Metasploit module for eternal blue, let’s do this the manual way. Searching on Exploit-DB there is a python script for this exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*A5fL4V247wn9r0XqNbHjEw.png" /><figcaption>Error running python script</figcaption></figure><p>You will get this error, download the MYSMB python script and save it in the same folder.</p><pre><a href="https://raw.githubusercontent.com/worawit/MS17-010/master/mysmb.py">https://raw.githubusercontent.com/worawit/MS17-010/master/mysmb.py</a></pre><p>Before we can perform this exploit, we need an open SMB share on this machine. First, we need to add the computer name in our host file and then scan for open SMB shares.</p><pre>vi /etc/hosts</pre><pre>smbclient -L \\10.10.10.40 -N<br>smbclient \\\\haris-pc\\Users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*1GWABoyJbqb_FxkkWliALQ.png" /><figcaption>Editing host file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*GXDb3GX3xJ1IOW0zUo7GnQ.png" /><figcaption>SMB scan</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*ZjZmgQR-G_vFqRWzXnfjhA.png" /><figcaption>SMB verification</figcaption></figure><p>We were able to find open SMB shares, and we need to verify that we have access to the shares. We can use smbclient to connect leaving the password blank.</p><p><strong>Payload Generation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Fli2M8kTH7y2U32gIpkcxw.png" /><figcaption>msfvenom payload generation</figcaption></figure><p>This python script does not have a built in reverse shell, so we need to build our payload using msfvenom and export it as an executable file.</p><p><strong>Exploit Modification</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/164/1*EgGz8sL22qDnSOzZbrBBlg.png" /><figcaption>Editing user config</figcaption></figure><p>We need to modify the python script in the username field. As we saw in a previous step we could connect as guest with no password however to do this we need to put in // for guest authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*N2qaEjdPzoK6wOg5Au-Emg.png" /><figcaption>Editing config file</figcaption></figure><p>Next, we need to modify these two lines for smb_send_file and service_exec. Uncommenting the lines (remove the #) and add the exploit file to send and the payload to execute from the client side.</p><p><strong>Handler Setup</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*BMrR3qdu9XtIXn3cZ_nsEQ.png" /><figcaption>Metasploit handler config</figcaption></figure><p>Before we execute the script, we need to start our handler for our meterpreter shell.</p><p><strong>Exploitation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*1LxfT6N32RZHbVlbObullQ.png" /><figcaption>Executing python script</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*CDPoa7Zm-BeLLDR6jpXqGw.png" /><figcaption>Python script results</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*NwGLKP0iLBhhRE4PgSUjbA.png" /><figcaption>Meterpreter connection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*EFc4KsWYItjHXhDiEfnicA.png" /><figcaption>Connected as system</figcaption></figure><p>Now it is time to execute the exploit python script. It may take a few tries but as you can see we now have a meterpreter shell as NT AUTHORITY\SYSTEM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*eHCnASWyfd5OfrlhHko4hw.png" /><figcaption>Dropping down to shell</figcaption></figure><p>We need to drop down to a shell session to continue.</p><p><strong>User.txt and Root.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*KqySPPUwo2IHeKdyUdY2WQ.png" /><figcaption>User.txt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*FOpC1niUgKuFsvgb8iCLfw.png" /><figcaption>Root.txt</figcaption></figure><p>Having our shell running as the local system, we can read both User.txt and Root.txt</p><p><strong>Bonus<br></strong>This step is optional let’s remote into this desktop. We will need to enable RDP and log in as a new user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*sYjblpsB5DA_voRIw2mkbA.png" /><figcaption>Creating new local administrator named hacker</figcaption></figure><p>I just created a new user named hacker with its password as hacker. I have also added it to the local “administrators” group.</p><pre>reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server&quot; /v fDenyTSConnections /t REG_DWORD /d 0 /f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYATkPkas8ZpJQYYJx7g4A.png" /><figcaption>Enabling RDP</figcaption></figure><p>To enable RDP we need to add this registry key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*w3sE35h0NbqbHVdVaop3yw.png" /><figcaption>RDP NMAP scan</figcaption></figure><p>We can verify that RDP port 3389 is now enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*BeDrhP9eGWvTmBOu-y5d6A.png" /><figcaption>Logging in as hacker</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*A8wFL5yGJektB7CCUL4wKA.png" /><figcaption>User verification</figcaption></figure><p>I can log into this desktop as the new user. This user is a local administrator.</p><blockquote><em>Contact:<br></em><a href="https://twitter.com/jkgeek42"><em>Twitter</em></a><em><br></em><a href="https://www.hackthebox.eu/profile/5917"><em>HackTheBox</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVlu6lX7NSouY9xY7UZ9nw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=115b3f563125" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box (HTB): Valentine]]></title>
            <link>https://medium.com/@sdgeek/hack-the-box-htb-valentine-984c28aed8a7?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/984c28aed8a7</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Sun, 07 Oct 2018 19:44:51 GMT</pubDate>
            <atom:updated>2018-10-08T01:17:33.900Z</atom:updated>
            <content:encoded><![CDATA[<p>Sunday, October 07, 2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHputdAQF726-sGe4wXIlQ.png" /></figure><p><strong>Tools Used:<br></strong><em>NMAP<br>Gobuster<br>Python</em></p><p><strong>Difficulty: 2/10</strong></p><p><strong>Network Enumeration<br></strong>Let’s start with a quick NMAP scan to discover open ports.</p><pre>nmap -sS --min-rate 5000 --max-retries 1 -p- 10.10.10.79</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*btkqb8-DHAFvuUsg4L02pw.png" /></figure><p>The quick scan presents us with three open port SSH, HTTP, and HTTPS. Due to this being a CTF machine ssh will not be vulnerable so let’s start with ports 80 and 443.</p><p>Web Enumeration<br>Let’s use Gobuster to search for directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*lGsbm1Lt-ijbJkSrJpJH_w.png" /></figure><p><strong>Enumeration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cheJ5g7aRFilv-ws-5feJQ.png" /></figure><p>Browsing port 80, we are given just an image and nothing else. Lets do some scanning for vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*u3uZrrL_JaC2NE_fCNS8qg.png" /></figure><p>If we browse the directories from the Gobuster scan, we can see a couple of files in the dev directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHjH4WqPWDtVlQRbfl3Zsw.png" /></figure><p>If we open hype_key, we see something encoded in hex.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*LiyzwOS8B3sxe8m4a4Hfuw.png" /></figure><p>We can use an online hex decoded, and it is revealed to be a private RSA key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*aIMHecsQi0b01dl-4xuWqA.png" /></figure><p>Looking at the SSL cert, it shows valentine.htb. Sometimes this can make a difference do to URL binding. Let’s add this DNS name to our host file “/etc/hosts.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*g_3P_vi_hRZtilA4kZGt6g.png" /></figure><p>In this case, browsing to <a href="http://valentine.htb/">http://valentine.htb</a> made no difference. However, this is still good practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*i2-ilSqBwUN5k46VDtImAQ.png" /></figure><p>Since we do have an SSL certificate, let’s see if there are any security vulnerabilities. We can use Nmap SSL scripts to check for any exploits. We can search for SSL scripts in the Nmap scripts directory using ls and filtering using grep.</p><pre>/usr/share/nmap/scripts/ | grep “ssl”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*ssa1MljcCLuYfbxK9wmgaw.png" /></figure><p>After going through the scripts, we can see that this server is vulnerable to SSL-heartbleed attack.</p><pre>nmap --script=ssl-heartbleed -p 443 10.10.10.79</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJt2EeqX_buFT4We1nJT_Q.png" /></figure><p>If we look back at the image in the web site, this can hint to the vulnerability.</p><p><strong>Explotation</strong><br>There is a Metasploit module for heartbleed but let’s do this exploit manually. We can download a python script from GitHub that will exploit heartbleed.</p><pre><a href="https://gist.githubusercontent.com/eelsivart/10174134/raw/8aea10b2f0f6842ccff97ee921a836cf05cd7530/heartbleed.py">https://gist.githubusercontent.com/eelsivart/10174134/raw/8aea10b2f0f6842ccff97ee921a836cf05cd7530/heartbleed.py</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*shuxQoSMCoqLTcDPFKTONA.png" /></figure><p>Running the heartbleed.py script we can see a base64 hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*DUifarTQIe98-TUbaNMymA.png" /></figure><p>I’ve decoded the base64 encoding and getting ‘heartbleedbelievethehype.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*BDlYt77qlu8glcVTRAK63Q.png" /></figure><p>Piecing everything together now lets ssh into Valentine. Using the file RSA private key “hype_key,” the passphrase “heartbleedbelievethehype,” and user hype (as in hype_key) we now have user access to Valentine.</p><p><strong>User.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*MMI2HSpBkT4dd68C2lvibw.png" /></figure><p>We can read user.txt as user hype.</p><p><strong>Privilege escalation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Lnj97WiTUm4w3CZZ3tPXLg.png" /></figure><p>Using “ps aux,” we can see that a tmux process is running as root. Incorrectly configured tmux if vulnerable for privilege escalation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*7ut6tpbJ-clUY9LdhFvp9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*VGfrJ_I56TpH35G-6VKUxA.png" /></figure><p>Connecting to the root tmux session we now have a root terminal.</p><p><strong>Root.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*fHjNLN2NXNfp-XUpzCBakQ.png" /></figure><p>Having root shell we can read root.txt</p><blockquote><em>Contact:<br></em><a href="https://twitter.com/jkgeek42"><em>Twitter</em></a><em><br></em><a href="https://www.hackthebox.eu/profile/5917"><em>HackTheBox</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHputdAQF726-sGe4wXIlQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=984c28aed8a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box (HTB): Tenten]]></title>
            <link>https://medium.com/@sdgeek/hack-the-box-htb-tenten-ddd9e6a9e22?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd9e6a9e22</guid>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Sun, 07 Oct 2018 08:46:22 GMT</pubDate>
            <atom:updated>2018-10-07T08:46:22.997Z</atom:updated>
            <content:encoded><![CDATA[<p>Saturday, October 06, 2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Huf6GSeyRAL4uafwMUnVXg.png" /></figure><p><strong>Tools Used:<br></strong><em>NMAP<br>WPScan<br>Steghide<br>John</em></p><p><strong>Difficulty: 5/10</strong></p><p><strong>Network Enumeration<br></strong>Let’s start with a simple NMAP scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*3MUMRukzq0t1r-H4f7vGaw.png" /></figure><p>We can see from the NMAP scan we can see that ports 22 (SSH) and 80 (HTTP) are open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*39D4AwwFb_eOCmjp0g7djw.png" /></figure><p>After running a more intense scan on port 80, a few things stick out. We can see Apache 2.4.18 and WordPress 4.7.3. After searching on Exploit-DB, there are no exploits for either of these applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klIKwAVecaodYFMHNTIAJw.png" /></figure><p>After browsing to port 80, we can see the WordPress site running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*GYAr7v4Ac72asD3ceOthIQ.png" /></figure><p>The first thing to do on a WordPress site is to run wpscan for any vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*viBP6-PrQGfke1O7d9qOlA.png" /></figure><p>WPScan results returned a vulnerability finding regarding the job manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peAl0T7wvhqm8RUVANKOnw.png" /></figure><p>The second reference links of the exploit findings give us a website with a PHP script for exploitation. In the script, it’s calling for two inputs website and file name. We already have the site we now need to find the file name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*Hmr13EY5qfu8VWxzemL1OQ.png" /></figure><p>If we go to the apply link on the jobs page title says Pen Tester.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*azENi261z9zkA713Rof7aA.png" /></figure><p>If we change the number, we get a different job application. Let’s see what all of the titles say. We can do this with a simple bash script.</p><blockquote>for i in $(seq 1 20); do echo -n “$i: “; curl -s <a href="http://10.10.10.10/index.php/jobs/apply/$i/">http://10.10.10.10/index.php/jobs/apply/$i/</a> | grep ‘&lt;h1 class=”entry-title”&gt;’; done</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FPO3k1sn9H8p8gDwgUYd6g.png" /></figure><p>The results look typical except for line 13 that says “HackerAccessGranted.”</p><p>We need to make a few changes to our script.</p><pre>for year in range(2017,2018):  <br>    for i in range(1,13):<br>        for extension in {&#39;php&#39;,&#39;html&#39;,&#39;pdf&#39;,&#39;png&#39;,&#39;gif&#39;,&#39;jpg&#39;,&#39;jpeg&#39;}:</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*L8Bg1AUHo_DHJiHjcvS-qQ.png" /></figure><p>After running the script, we get a file name returned. HackerAccessGranted.jpg</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwZFWWOOELM-9zK98zc-wA.png" /></figure><p>Looking at the photo, I don’t see anything unusual and being a CTF machine the first thing that comes to my mind is steganography.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*yBfbse-Z3ST2C6hV9NuljA.png" /></figure><p>Using steghide to extract the hidden content we see there is an RSA Private key. Most likely this will be used to ssh into the server, however, we need to figure out the password for the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*I2k_PCxixiT-bBY3VMudTg.png" /></figure><p>To brute force the key’s password we need sshng2john python script to get the hash in john format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*lNf8yM_j5ykmIsAfiFv_Hw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*KQ9aKdepeJs5Il7P1OU7iQ.png" /></figure><p>Running the hash through john, we find out the password is “superpassword”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*y5KfbY0nPlhJ_rzmMi_4_g.png" /></figure><p>I tried using the key to SSH into the server, and it was not working. Looking back at the WPScan I remember seeing a username discovered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*P0pRYUTopN1y8x0XfQPxcw.png" /></figure><p>Using the user “takis,” the RSA key, and the passphrase we now have user-level SSH into tenten.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*xklETMQ644h-VopA-f3PNQ.png" /><figcaption>user.txt</figcaption></figure><p>We can read user.txt.</p><p>Privilege escalation<br>Now that we user access we need to elevate our permissions to root. Let’s start with getting system information.</p><blockquote>takis@tenten:~$ cat /etc/issue<br>Ubuntu 16.04.2 LTS \n \l</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*crhOsGjHpU822hNPL4pFNw.png" /></figure><p>Escalating to root shows that we have access to a file called “/bin/fuckin.” We need to find out what in this file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*whQdWTdi2AWwLNAF1Dz81Q.png" /></figure><p>fuckin seems to be a batch script that contains arguments that we can pass on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*cq97uQWm_TQtBLOQg_OOTg.png" /></figure><p>Adding an argument after the file while running it as sudo allows us to run commands as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*YobiubxriG5EfVLVr2o6nQ.png" /></figure><p>Adding bash to the first argument gives us root shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*G5RB2nOvXYaoXtXxNL2q8Q.png" /></figure><p>As root, we can view root.txt</p><blockquote><em>Contact:<br></em><a href="https://twitter.com/jkgeek42"><em>Twitter</em></a><em><br></em><a href="https://www.hackthebox.eu/profile/5917"><em>HackTheBox</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GQOGAph9GUSGEvWxhyvgLA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddd9e6a9e22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box (HTB) : Lame]]></title>
            <link>https://medium.com/@sdgeek/hack-the-box-htb-lame-597810e98978?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/597810e98978</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Fri, 05 Oct 2018 07:22:21 GMT</pubDate>
            <atom:updated>2018-10-07T08:51:00.919Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hack The Box (HTB): Lame</h3><p>Thursday, October 04, 2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQ_Uvmfd3CRiELyi9f2bBQ.png" /></figure><p><strong>Tools Used:<br></strong><em>NMAP<br>Metasploit</em></p><p><strong>Difficulty: 0.5/10 (LAME)</strong></p><p><strong>Network Enumeration<br></strong>Let’s start with an NMAP scan of the server to see what ports are open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*QcIg6dtLJpH0OP2ojqF7wA.png" /></figure><p>The NMAP results returned 5 open ports lets do a more in-depth scan and see what services are running.</p><p>I’ve checked port 21 running vsFTPd 2.3.4, and this was not exploitable. Moving on to port 445 we see samba 3.0.20-Debian.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*v0lmDYd7Cb8pdRBWCYlBEg.png" /></figure><p>After checking on Exploit-DB, we can see 2 possible vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0HZBebL3P4igg6EEN2Ezg.png" /></figure><p>Using Metasploit exploit multi/samba/usermap_script we now have a reverse shell with root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*kWzl6d6-G5oZa28nPVU1xA.png" /></figure><p>Root.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*qdFvCp1pQq1g1qNEl0kZuA.png" /></figure><p>User.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*ih80307AahKL0iztWCj7wA.png" /></figure><blockquote><em>Contact:<br></em><a href="https://twitter.com/jkgeek42"><em>Twitter</em></a><em><br></em><a href="https://www.hackthebox.eu/profile/5917"><em>HackTheBox</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYSGCUQJdk2KQ29PuqeCGQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=597810e98978" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box (HTB) : Beep]]></title>
            <link>https://medium.com/@sdgeek/hack-the-box-htb-beep-53b8e5eda6ca?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/53b8e5eda6ca</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Fri, 05 Oct 2018 06:43:27 GMT</pubDate>
            <atom:updated>2018-10-07T08:54:30.203Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hack The Box (HTB): Beep</h3><p>Thursday, October 04, 2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MGQ_Xh2cJMhaSKEZWaIpyQ.png" /></figure><p><strong>Tools Used:<br></strong><em>NMAP</em></p><p><strong>Difficulty: 2/10</strong></p><p><strong>Network Enumeration<br></strong>Let’s start with an NMAP scan of the server to see what ports are open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*8VWDizzPJ4OBRLruW5w9Vw.png" /></figure><p>Initial scan reveals 15 open ports. I like to start with the common exploitable ports and work out from there. I know ssh typically is not the target exploit, so the first common exploit port that I see is 80 (HTTP) let’s see what is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbx2yAYzXUQKDEE-ztl7Yw.png" /></figure><p>It appears that port 80 auto redirects to port 443 (https) and it is running Elastix PBX system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qjw_TUW_GXH4Xlc5CQMig.png" /></figure><p>A quick search on Exploit-DB reveals there are multiple exploits, so let’s try Local File Inclusion (LFI) exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*con0ITIF0ancep8YMLjQfA.png" /></figure><p>LFI exploit takes us to what looks like a configuration page. We can see a lot of users and passwords so let’s see if we can build a password list out of this. I copied all the text from the config page and put it into a text file. Then I ran a bash command to read the contents of the config file and put all the individual unique words into another word list. This step is not necessary, but I like to have a clear view of any hidden usernames or passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*IgikqbN3v8fZkoYCuo-y1g.png" /></figure><p>Looking at the list created I see some lines that have “pass” in their name. Let ‘s see if any of those are subject to password reuse attack on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*U_MiXviIcqocpE7ht0simw.png" /></figure><p>After a couple of tries, I was able to ssh into this machine as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*rY0u49dhRC7YyH4WQOOBeg.png" /></figure><p>From here we can quickly grab the root.txt key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*IJXQ1NAvLH9Dymk-dV7Nkw.png" /></figure><p>Next, I was able to grab the user.txt from the user “franis” home folder.</p><p><em>Contact:<br></em><a href="https://twitter.com/jkgeek42"><em>Twitter</em></a><em><br></em><a href="https://www.hackthebox.eu/profile/5917"><em>HackTheBox</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rC6bW1hFvzFZa7Alcymm6Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53b8e5eda6ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP/Pen Testing Resources]]></title>
            <link>https://medium.com/@sdgeek/oscp-pen-testing-resources-271e9e570d45?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/271e9e570d45</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Thu, 04 Oct 2018 08:06:00 GMT</pubDate>
            <atom:updated>2018-10-04T08:06:00.154Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Collections:</strong><br><a href="https://github.com/pythonmaster41/Go-For-OSCP">Go-For-OSCP</a>-Github<br><a href="https://highon.coffee/blog/penetration-testing-tools-cheat-sheet/">HighOn.Coffee -Penetration Testing Tools Cheat Sheet</a><br><a href="https://hausec.com/pentesting-cheatsheet/#_Toc475368986">Hausec.com -Pentesting Cheatsheet</a><br><a href="http://hackingandsecurity.blogspot.com/2017/08/go-for-oscp.html">Hackingandsecurity -Go-For-OSCP</a><br><a href="https://securism.wordpress.com/oscp-notes-password-attacks/">OSCP-Password-Attacks</a><br><a href="https://github.com/gwen001/pentest-tools">Pentest-Tools</a><br><a href="https://github.com/ibr2/pwk-cheatsheet/blob/master/linux-template.md">Pwk-Cheatsheet</a>-Linux<br><a href="https://github.com/ibr2/pwk-cheatsheet/blob/master/windows-template.md">Pwk-Cheatsheet-Windows</a><br><a href="https://github.com/ibr2/pwk-cheatsheet">PWK-Cheatsheet</a><br><a href="https://www.exploit-db.com/docs/english/26000-windows-meterpreterless-post-exploitation.pdf">Windows “meterpreter” less post exploitation</a><br><a href="https://hausec.com/pentesting-cheatsheet/#_Toc475368980">Pentesting Cheatsheet</a><br><a href="https://github.com/danielklim/r00tz2017">Intro to penetration testing workshop</a></p><p><strong>Reverse Shells:</strong><br><a href="http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet">Pentestmonkey -Reverse Shell Cheat Sheet</a><br><a href="https://gist.github.com/rshipp/eee36684db07d234c1cc">PHP Reverse Shell -Shell.php</a><br><a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">PHP-Reverse-Shell.php</a></p><p><strong>Active Directory:</strong><br><a href="http://www.hackingarticles.in/penetration-testing-active-directory-using-metasploit-part-2/">Penetration testing active directory using metasploit part 2</a></p><p><strong>Windows Privilege Escalation:</strong><br><a href="http://www.fuzzysecurity.com/tutorials/16.html">Windows Privilege Escalation Fundamentals</a><br><a href="https://github.com/AlessandroZ/BeRoot">Privilege Escalation Project -Windows/Linux/Mac</a><br><a href="https://github.com/togie6/Windows-Privesc">Windows-Privesc</a><br><a href="http://www.handgrep.se/repository/cheatsheets/postexploitation/WindowsPost-Exploitation.pdf">Windows Post-Exploitation Command List</a><br><a href="http://hackingandsecurity.blogspot.com/2017/09/oscp-windows-priviledge-escalation.html?m=1">OSCP windows priviledge escalation</a><br><a href="https://pentest.blog/windows-privilege-escalation-methods-for-pentesters/">Windows Privilege escalation methods for pentesters</a></p><p><strong>Linux Privilege Escalation:<br></strong><a href="https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/">g0tmi1k.com</a></p><p><strong>Linux Privilege Escalation:</strong><br><a href="https://github.com/rebootuser/LinEnum/blob/master/LinEnum.sh">LinEnum.sh</a><br><a href="https://netsec.ws/?p=309">Linux Privilege Escalation Scripts</a><br><a href="https://github.com/AusJock/Privilege-Escalation/tree/master/Linux/Post%20Exploitation%20Scripts">Linux Privilege Escalation</a><br><a href="https://www.rebootuser.com/?p=1623">Local Linux Enumeration &amp; Privilege Escalation Cheatsheet</a></p><p><strong>Post Exploitation:</strong><br><a href="https://github.com/amonsec/post-exploitation/blob/master/linux/adduser.sh">Adduser.sh</a><br><a href="https://github.com/emilyanncr/Windows-Post-Exploitation#post-exploitation-tools">Post Exploitation Tools</a><br><a href="https://pentestlab.blog/2017/04/19/stored-credentials/">Stored Credentials</a><br><a href="https://github.com/emilyanncr/Windows-Post-Exploitation">Windows -Post-Exploitation</a><br><a href="https://github.com/mubix/post-exploitation/wiki/Linux-Post-Exploitation-Command-List#blind_files">Linux-Post-Exploitation-command-list</a><br><a href="http://hackingandsecurity.blogspot.com/2017/09/oscp-windows-post-exploitation.html">OSCP-Windows Post Exploitation</a></p><p><strong>Tools:</strong><br><a href="https://github.com/pentestmonkey/finger-user-enum/blob/master/finger-user-enum.pl">Finger -pentestmonkey</a><br><a href="https://www.offensive-security.com/metasploit-unleashed/mimikatz/">Mimikatz</a><br><a href="https://md5hashing.net/hash_type_checker/">Hash Type Checker</a><br><a href="https://github.com/codingo/OSCP-2/blob/master/BASH/PortKnocker.sh">PortKnocker</a><br><a href="https://www.binarytides.com/ping-sweep-network-nmap/">Ping Sweep </a><br><a href="http://0wlday.blogspot.com/2013/01/nmap-metasploit-exploit.html">Nmap-Vulns</a><br><a href="https://www.hackingtutorials.org/metasploit-tutorials/metasploitable-2-enumeration/">Metasploitable 2 Enumeration</a><br><a href="https://gist.github.com/sckalath/ec7af6a1786e3de6c309">wget_vbs</a><br><a href="https://github.com/wireghoul/dotdotpwn">dotdotpwn (LFI)</a><br><a href="http://security-geek.in/2016/09/07/msfvenom-cheat-sheet/">Msfvenom Cheat Sheet</a><br><a href="https://netsec.ws/?p=331">Creating Metasploit Payloads</a></p><p>Password Cracking:<br><a href="https://www.binarytides.com/crack-ftp-passwords-with-thc-hydra-tutorial/">Hydra FTP Password Cracking</a><br><a href="https://tools.kali.org/password-attacks/hydra">THC-Hydra Password Attacks</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=271e9e570d45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box (HTB) — Sunday]]></title>
            <link>https://medium.com/@sdgeek/hack-the-box-htb-sunday-3d18c54055c3?source=rss-b5b13d891204------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d18c54055c3</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <dc:creator><![CDATA[Travis]]></dc:creator>
            <pubDate>Thu, 04 Oct 2018 06:52:52 GMT</pubDate>
            <atom:updated>2018-10-07T08:56:38.484Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hack The Box (HTB): Sunday</h3><p>Wednesday, October 03, 2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*si0A_d5Hk2JHgeHNTa6jqA.png" /></figure><p><strong>Tools Used:<br></strong><em>NMAP <br>Finger<br>Perl script <br>Metasploit <br>Patator<br>Hashcat<br>Python</em></p><p><strong>Difficulty: 3/10</strong></p><p><strong>Network Enumeration</strong><br> First, we start with full port nmap scan and discover port 79 TCP Finger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*Q3q5RX9-N9KT5768g-9txA.png" /></figure><p><strong>User Discovery<br></strong>The finger service allows us to view users that are currently logged in.<br>Currently, there are no users logged in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*hkoDuOgTc1krRl9fKTRW2A.png" /></figure><p>We can enumerate users through finger using a Perl script by pentestmonkey.</p><blockquote><a href="https://github.com/pentestmonkey/finger-user-enum/blob/master/finger-user-enum.pl">https://github.com/pentestmonkey/finger-user-enum/blob/master/finger-user-enum.pl</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*xFhRL0iNcTQtg9PBvdiABA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UE0QF7pS6ZwUceZuqb3zPQ.png" /></figure><p>2 discovered users have logged in the past Sammy and Sunny they have login timestamps of April 24 from IP 10.10.14.4</p><p>Alternatively, we can run finger enumeration through Metasploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSyuK-XZwH_8-VAV7p9bvQ.png" /></figure><p>After conducting a more in-depth Nmap scan, we can see that ssh is running on port 22022.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*lRrjhAn1ltuiaa_cDBnNGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*EoVJBrii_eO2aYoHdW46Nw.png" /></figure><p><strong>SSH Brute force<br></strong> Now that we have possible usernames we need to discover their passwords. Generally for SSH brute forcing hydra can be used however due to the age of this machine a different tool is required Patator. Patator was able to brute force ssh and discovered sunny’s password as “sunday.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhA6VAdsPTZbfw4oFhP0bQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcdqRqkcUS5h0TL7J4KFpQ.png" /></figure><p>While attempting to log in through SSH, there was an error for “no matching key exchange method found” the key exchange method had to be specified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgm4tbWcfOzNvTVCqp85-g.png" /></figure><p>After looking around, I was able to locate the user.txt file in Sammy’s desktop however sunny does not have permission to access the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*GWrbq4crhBOoa3CXAVcmYw.png" /></figure><p>After searching through directories I came across a backup directory with two files one of them turned out to be a backup of the Linux shadow file with the password hashes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*7iBE7IcEczYAlZ2B2aJfgA.png" /></figure><h4>Hash Cracking</h4><p>After running both Linux password hashes through Hashcat, we are given the passwords as “sunday” and “cooldude!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*9cdQMFOKwvCnmGOjhkCO6w.png" /><figcaption>Windows version of Hashcat used for graphics card acceleration.</figcaption></figure><p>Logged in as user Sammy using password “cooldude!”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UI5JPn2ZycVzY6lFnnjKSw.png" /></figure><p>After logging in as Sammy, we can read the user.txt file and get the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*4AJ6IeQ_3vOzhPWivq79KA.png" /></figure><p><strong>PRIVILEGE ESCALATION<br></strong> If we try to elevate to root as Sunny, we can run a file /root/troll.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*HHsH3vLAnwoP_RLKqc_IUg.png" /></figure><p>If we try to elevate to root as Sammy, we can run wget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*xJw9z3HFxSeldKURovVuGw.png" /></figure><p>Since we know, we can download using wget as root, and we can execute /root/troll as root we can execute an elevated reverse shell.</p><p>We can serve the custom troll file from our local computer using python SimpleHTTPServer and then download troll as Sammy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*aAqqA5Q8q8zDnLGvcN8KWw.png" /></figure><p>In the troll file, I’ve included a python reverse shell script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*u2DxZHuEiP7oDhZx-O9yjw.png" /></figure><p>And now after running “sudo /root/troll” as Sunny, we now have a reverse shell as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*D5ww6DRFQSpycQmZcOCDGQ.png" /></figure><p>With root access, we can now view the contents of the root.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*6gzadLKxIuloEJ1d3DjmVQ.png" /></figure><blockquote>Contact:<br><a href="https://twitter.com/jkgeek42">Twitter</a><br><a href="https://www.hackthebox.eu/profile/5917">HackTheBox</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXc6BUPt4I_pJgTA1CBsIw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d18c54055c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>