当前位置:网站首页>Record several interesting XSS vulnerability discoveries

Record several interesting XSS vulnerability discoveries

2022-06-13 10:18:00 Bright moon and clear wind~~

Link to the original text :https://www.freebuf.com/articles/web/331671.html

Write down a few interesting XSS Vulnerability discovery

shit xiong 2022-04-29 08:41:48

35185

Remember several problems encountered in the process of digging a hole XSS Loophole , Three storage types XSS And a reflex type XSS, Mainly share ideas . Input controllable , And is output , Can be measured XSS.

*0x00 Login details +IP+XFF*

Log in and enter 【 Personal center 】, Find out 【 Login details 】 The function of , The login time is recorded IP These things .1651128315_626a37fb9cbfa84d16e53.png!small?1651128358389

Grab the login request package , structure X-Forwarded-For Head replay , Why , Simple splicing , Have the opportunity to .

1651128348_626a381ca3d6421c9e9a1.png!small?1651128391536

Many applications have the option of logging in when users log in IP, you 're right , The first thought is to construct xff measuring sql Inject . Here we don't do anything about sql Injected analysis , Mainly dishes xiong Repeated tests have not been detected ( It doesn't matter to meditate ).

Okay , Back to the point , Login details will be constructed by us xff Value echo , This must not be attempted xss. We cannot delete the record of login details , Avoid causing unnecessary trouble , There is no need to pop up windows here payload 了 , We use console.log(‘test’), The trigger effect is the console output log test.

1651128369_626a383139dd2da0887af.png!small?1651128412069

The manufacturer fixed this vulnerability soon after it was submitted , It's really fast . The analysis found that the repair was done twice HTML escape , One incoming and one outgoing . In addition, the test screenshot before the repair can not be found , Here we can only use the repaired screenshot to analyze .

Before repair , The angle brackets have not been escaped to “ useless ” The characters of , Can trigger console log output .

Here's what was implanted before the repair payload, But the screenshot is fixed . The manufacturer repaired the input / output escape twice , But because of the following payload It was implanted before repair , There is no way to escape when entering , You can only escape the output .

1651128482_626a38a246798e64912e9.png!small?1651128524945

1651128484_626a38a4df69cbf7371d2.png!small?1651128527641

1651128522_626a38cabc2e42c3c3ce4.png!small?1651128565459

The following is the implant after repair , The input and output are escaped twice , So what is displayed to users is like this .

1651128530_626a38d22d34f8414f526.png!small?1651128572884

1651128650_626a394a5867b82a54115.png!small?1651128693048

Login success and failure are recorded , Then it proves that it is not self-xss.

*0x01 Chat box +img label + Picture address *

Find the input box , Input text test<>“” send out , Angle brackets double quotes are escaped , Try to bypass the fruitless .

1651129029_626a3ac5016d0d9beef01.png!small?1651129071688

Sending pictures , Find out content Parameter controllable picture address , Insert... In the address test<>"" A simple test , Found that angle brackets and double quotes in the picture address were not escaped , Construct the... Under the event xss Payload.

1651129052_626a3adc3d916d4f4919d.png!small?1651129095202

Successfully triggered , Ha ha ha . Actually here gif Emoticons can also trigger .

1651129122_626a3b22a1effdfc8aeb5.png!small?1651129165421

View the source code , Find out payload It has been successfully implanted .

1651129131_626a3b2b0f4ccdf268dd5.png!small?1651129173760

payload Sent to the target , The target chat window also returns , Prove not to be self-xss.

*0x02 dynamic + Simple filtering + It is released in two times *

Can publish dynamic , direct , The press conference is directly replaced with empty .

1651129197_626a3b6d1f37976d25fa5.png!small?1651129239812

In fact, this is just a front-end test , I believe all the masters can easily bypass , But here's another idea for me .

Try to publish in two times ,

Input and publish for the first time :*/sole.log(1111);

1651129372_626a3c1c45ee44b93ca9f.png!small?1651129415011

The second input is published :

1651129403_626a3c3b201d8aac50230.png!small?1651129445806

Through here / notes / Annotate part of the page contents , Form an effective closure . However, this method is easy to make the page split , Use with caution , It is best not to use this method if it is not necessary . If the masters are sure to make notes and close , And there are ways to delete , You can still play , If it is not closed properly , Can't delete , It would be gg 了 .

1651129267_626a3bb33a0a62a91bb48.png!small?1651129310031

xss Trigger successful .

1651129261_626a3bad285c1ab15e644.png!small?1651129303905

*0x03 Search for +input label +hidden attribute *

This is a edu reflective xss, Use conditions are harsh , But it can be used to learn .

1651129765_626a3da537dc7845c629d.png!small?1651129807860

Search box , Input 1111<>“”, Return as follows , Review the source code again , Can't use .

1651129567_626a3cdfea3e290d1c9d8.png!small?1651129610647

Search for test<>“”‘’, Return as follows . Compare the , Search for existing and nonexistent , There is a big difference in return .

1651129526_626a3cb6593380b1ca106.png!small?1651129569278

Review source code , It is found that the attribute value is closed by single quotation marks , And the single quotation mark is not escaped .

1651129788_626a3dbcc31f4ab9d2b2f.png!small?1651129831485

It must have been discovered by the masters ,input Sticky notes +hidden attribute .

First explore , autofocus Auto trigger event failed ,hidden Nor can it cover .

Let's take a look at what the online Master said , Reference link :https://www.anquanke.com/post/id/148357

1651129806_626a3dce5cc42ea480efc.png!small?1651129849074

Search for ’ accesskey=‘X’ οnclick='alert(1) , firefox Alt+SHIFT+X Key Popup . So , Use conditions are harsh ......

1651129813_626a3dd5d70f8f540a92a.png!small?1651129856882

Welcome to correct me , Or teach more experience .

The author of this article : shit xiong, Please quote from FreeBuf.COM

原网站

版权声明
本文为[Bright moon and clear wind~~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206131008112984.html