<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by D on Medium]]></title>
        <description><![CDATA[Stories by D on Medium]]></description>
        <link>https://medium.com/@act1on3?source=rss-fc0c38fa90ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*AXOoOE6COv6LggWarfgpow.jpeg</url>
            <title>Stories by D on Medium</title>
            <link>https://medium.com/@act1on3?source=rss-fc0c38fa90ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:27:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@act1on3/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Offzone 2019 HackQuest writeup]]></title>
            <link>https://medium.com/@act1on3/offzone-2019-hackquest-writeup-cf450aaf043e?source=rss-fc0c38fa90ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf450aaf043e</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[D]]></dc:creator>
            <pubDate>Tue, 25 Jun 2019 08:02:59 GMT</pubDate>
            <atom:updated>2019-06-25T08:02:59.364Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*od5BLTZcYVjXW9k-IlQuKg.png" /><figcaption>Задание</figcaption></figure><p>Начинаем со сканирования портов. Находим порт 9627 с веб-приложением.<br>При входе в приложение устанавливается cookie server с четырехзначным int-значением.<br>Запускаем Burp Intruder на подбор значения этой cookie. При значении</p><pre> server=4773</pre><p>получаем ответ с телом “Under Construction”</p><p>Запускаем dirbuster с выставленным значением cookie server=4773. Находим путь</p><pre>/admin/index.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*7Dfn1rt6WHJYaKVFRnwalw.png" /><figcaption>/admin/index.php</figcaption></figure><p>Через функционал restore password можно узнать логин пользователя, который есть в системе. Перебором узнаем, что есть admin. Теперь пытаемся сбрутить пароль через Burp Intruder. <br>Оказывается креденшелы — это admin:admin. В качестве аутентификационной cookie выставляется auth=true.</p><p>Попадаем в админку и видим одну ссылку на изменение почтового шаблона.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*Eewwy2MBbdJhJhI9YP6XFA.png" /><figcaption>Единственное поле для ввода в админке</figcaption></figure><p>Видим интересный синтаксис передачи username и password. Сначала я подумал, что это формат какого-то шаблонизатора. Быстрое гугление дало понять, что я ошибаюсь. Это PHP short tags. Исходя из того, что это часть php-кода, понимаем, что тут может быть code injection.<br>Но после обновления шаблона, нам надо стриггерить код на выполнение. Приложение небольшое, так что понимаем, что этот код возможно выполнится при попытке сбросить пароль для admin.</p><p>Пробуем payload из скриншота, но вывода команды нет.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8h07J-DAgWWAsKMpG1EXg.png" /><figcaption>Ввод</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*mAeKc4DB8Qiqj7l9a8uF4A.png" /><figcaption>Вывод</figcaption></figure><p>При попытках сделать запрос к Burp Collaborator через curl, wget, nc — запросов никаких не видно.<br>После этого, я попытался перебрать возможные функции выполнения кода отсюда <a href="https://www.php.net/manual/ru/ref.exec.php">https://www.php.net/manual/ru/ref.exec.php</a><br>И случайно сделал опечатку😁. На несуществующую функцию мне прилетел другой вывод с 500 ответом. Теперь составляем payload, где будет несуществующая фунция и получаем в ответе вывод из шелла.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*n8nB4cAwjFREdK3SEiAHDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*ALiiJRHDa7bkrJJqvbpsEg.png" /></figure><p>Посмотрев исходники, понимаем, что весь наш ввод передавался в функцию eval:</p><pre><br>eval(‘ ?&gt;’.file_get_contents(‘../tpl/remind_mail.html’).’&lt;?php ‘);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf450aaf043e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting for Insecure Docker Registries]]></title>
            <link>https://medium.com/@act1on3/hunting-for-insecure-docker-registries-d87d293e6779?source=rss-fc0c38fa90ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/d87d293e6779</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[misconfiguration]]></category>
            <category><![CDATA[docker-registry]]></category>
            <dc:creator><![CDATA[D]]></dc:creator>
            <pubDate>Sun, 19 May 2019 14:01:02 GMT</pubDate>
            <atom:updated>2019-05-19T14:01:02.152Z</atom:updated>
            <content:encoded><![CDATA[<p>Developer teams love and use Docker and container’s stuff. So there are a lot of tools and projects about efficiently using it.</p><h3><strong>So, meet with Docker Registry!</strong></h3><p>If you used Docker someday, with the big possibility you used Registry. Good known Docker Registry is <a href="https://hub.docker.com/">Docker Hub</a>. It is used by many open-source projects. Why use it?</p><p><a href="https://docs.docker.com/registry/">Here</a> you can find official documentation. It says:</p><blockquote>You should use the Registry if you want to:</blockquote><blockquote>- tightly control where your images are being stored</blockquote><blockquote>- fully own your images distribution pipeline</blockquote><blockquote>- integrate image storage and distribution tightly into your in-house development workflow</blockquote><p>Therefore, it’s a storage of Docker images. If you used Docker, you know that the image contains your application. In other words — your code (first of all, I’m talking about web applications — Docker is used for PHP, Java, Python web apps). So, if you have access to images from Registry — you have access to the source code.</p><h3>What is wrong?</h3><p>Okay, someone deployed Registry for private usage and stored his images. Where is the problem?</p><p><a href="https://docs.docker.com/registry/spec/api/">Here</a> you can know what protocol is used by the registry. It’s HTTP API.</p><p><a href="https://docs.docker.com/registry/deploying/">Here</a> you can find information about deploying Registries. Do you see the topic of security deploying? First, we see something about TLS. Okay, it’s important, but what about authentication in Registry? Below is the documentation, we see a topic “Restricting access”. But this topic is almost the last😨 Do you understand my mind?</p><p>If the administrator didn’t read the documentation properly — Docker Registry will be deployed without authentication. Everyone who knows about your Registry can access your images and code. It’s a good attack vector with a good impact — disclosing source code.</p><h3>Let’s start hunting!</h3><p>I wanted to find Docker Registries on the Internet and check its authentication mechanism. But how do it?</p><p>Searching for 5000 port is not efficient. Someone deploy it on other ports. Let’s deploy our instance for searching fingerprints.</p><p>Example of connection to a local instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*Yg_0pYdJIyRo4ibLXG8MNA.png" /></figure><p>Docker Registry’s fingerprint is <em>Docker-Distribution-Api-Version</em> header. I used this fingerprint for an initial search with Shodan. I have a Developer account in Shodan and I used Shodan API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvGTTH5tvO8saH_vCn8ntQ.png" /><figcaption>Shodan results</figcaption></figure><p>The second phase is checking — does registry have authentication or not? Let’s look at the <a href="https://docs.docker.com/registry/spec/api/">documentation</a> about Docker registry API. For checking I used this path:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*wZ0mLu-BHvI9l4uioHE36A.png" /><figcaption>Registry HTTP API method description</figcaption></figure><p>Okay, it’s time to write a simple script that will do those things:</p><ol><li>Create a query to Shodan API to find header: <em>Docker-Distribution-API-Version</em></li><li>Parse results</li><li>Try to connect to hosts from the results</li><li>Try to connect to Registry API endpoint: <em>/v2/_catalog</em></li><li>Save results for each host</li></ol><h3>Finds</h3><p>I scanned hosts from the Shodan query’s result and got something. If you want some statistics (even if you don’t want😀) there is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*r-NbcsYD3GTLLCoyMBWj6A.png" /></figure><p>We found 94 open Docker Registries. The next step is researching what repositories of Registries contain.</p><p>Many of that contain not interesting for me repositories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*nqfeySpAHKhp27_FRKVKIw.png" /><figcaption>Useless finds</figcaption></figure><p>But something was interesting… 🤔</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLBo96vo1f95WhzfIiJ7Cw.png" /><figcaption>Give me more source code of apps!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3YBfiqYjDjuODThXwDaAHQ.png" /><figcaption>Give me more source code of apps!</figcaption></figure><p>Now we can download something’s images with applications and get the code:</p><blockquote><em>curl https://registry.example.com/v2/&lt;image_name&gt;/tags/list</em></blockquote><blockquote><em>docker pull https://registry.example.com:443/&lt;image_name&gt;:&lt;tag&gt;</em></blockquote><p>Now we have an image and can inspect it. Let’s run it and inspect filesystem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*EK33nZdGvDWHvNSM8hXF9w.png" /><figcaption>Manifest of one of the app</figcaption></figure><p>I have notified owners of Registries about my finds. Someone paid a bounty, others were ignoring me, but have closed the Registries without any thanks🤨</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*90zDVpYpokDqVreh3ntLEQ.png" /><figcaption>Bounty earned</figcaption></figure><p>So, Registry hunting was a good time spending😉 Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d87d293e6779" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>