当前位置:网站首页>Manually mining XSS vulnerabilities
Manually mining XSS vulnerabilities
2022-06-22 09:01:00 【Ape dung】
Xss Injection idea :
1、 Find the input point on the target site , For example, query interface , Message board, etc ;
2、 Enter a set of “ Special characters + Unique identification character ” Click Submit , View the returned source code , Whether corresponding processing has been done ;
3、 Locate unique characters by searching , Combine the syntax before and after the unique character to confirm whether it can construct and execute js Conditions ( The structure is closed );
4、 Submit the constructed script code ( And various bypass positions ), See if you can successfully execute , If it is executed successfully, it indicates that XSS Loophole ;
TIPS( skill ):
1. General query interface 、 The user login 、 Search for 、 Order submission is prone to reflection XSS, Message board 、 Comment on 、 The user nickname 、 User information and other places where data can be submitted and stored and displayed by the server may have storage type, and storage type is easy to occur across stations XSS;
2. Because there may be filtering measures in the background , Tectonic script May be filtered out , And can't take effect , Or the environment limits the execution ( browser );
3. By changing different script, Try to bypass the background filtering mechanism ;
Depending on the output position , Attack methods are also different
- The output is outside the label ( Outside angle brackets )

step :
One 、 Determine the output position

Two 、 Enter special characters ("'<>script alert onclick), If the output is normal , If the output is normal , Normal labels can be constructed

Judge according to the filtered output , Filtered the angle brackets , But no single or double quotation marks , Can do pop-up output
View the source code :

<script>alert(1)</script>

- Output in tag
Two cases :1、 Inside the quotation marks 2、 Outside the quotation marks


step :
One 、 Determine the output position

Two 、 Enter special characters ("'<>script alert onclick)
View the source code

The input is in quotation marks , So try closing quotation marks to construct new attributes or tags
'οnclick='alert(1), Enter a statement to close quotation marks to view the source code

Click the page output position

The second case : Cannot close quotation marks
Determine the output position

Enter special characters ("'<>script alert onclick)

View the source code

There are no single or double quotation marks entered , So we can construct javascript Code or in onload Position write alert

View the source code :

Output outside quotation marks : See if you can construct new attributes

Look at the source code and see that the entered value is outside the quotation marks , So you can construct new attributes to execute js Code
Enter special characters to see if they are filtered ("'<>script alert onclick)

View the source code

Not filtered , Construct properties

Click on

- Output in JavaScript In the code <script> Output location </script>

Determine the output position

So close the quotation marks , And annotate the following quotation marks
First, determine whether special characters have been filtered

No filtering , So you can make a pop-up window ";alert('aa');//


Enter a value to view the source code to see if it can be closed


Try closing


The entered quotation marks and semicolons are filtered , Therefore, closing is not allowed , So we should use other methods to test
According to the code , Will output the content to the page or parse the tag , So we can construct img label
<img src=1 οnclick=alert(1)>


Click on the image


Outside the quotation marks , You can input js Code
Determine the output position


The entered value appears in script In the label , So this situation can be input directly js Code


XSS To guard against
XSS The power of depends mainly on JavaScript The extent to which it can be achieved ,XSS The reason for the formation of cross site scripts is that there is no strict filtering of input and output , Results in execution of... On the page JavaScript Wait for client code , So just filter sensitive characters , You can fix XSS Cross site loopholes .
Repair and prevention methods :
• Three types of XSS Vulnerabilities can be fixed by filtering or coding .
• reflective XSS And storage XSS You can filter and encode the contents of user input and output at the server , Filter keywords , Key symbols are encoded , If all on event ,script Wait for keywords to filter , Will all <,>,”,’,= And other special symbols can be repaired by materializing coding or percentage coding .
• DOM type XSS If so, interact with the server , You can also refer to the above method for repair , If there is no interaction with the server , It can be used on the client JavaScript And other client scripting languages for coding and filtering .
• summary : Input for filtering , Output as escape ( code )
边栏推荐
- yolov5 export Gpu推理模型导出
- Flask blog practice - realize article management
- How did the Delphi labs, the master of economic models behind axie and Luna, come into being?
- Data and data type conversion in MATLAB
- Golang 开发 常用的第三方库 没有最全只有更全
- Summary of microexpression data set (full)
- 【目标检测】|检测错误机制 Why Object Detectors Fail: Investigating the Influence of the Dataset
- How to write high performance SQL statements?
- STM32 crashes when upgrading bootloader to jump app Online
- What is defi and what mode is defi?
猜你喜欢
随机推荐
我的第一个Go程序
[conda]conda切换为中科大源
Bit group sort
【node】脚手架搭建服务器,完成token验证
面试突击59:一个表中可以有多个自增列吗?
12 yuan sharing mode
CF1267G Game Relics
Guide to quick withdrawal and withdrawal of us and Hong Kong stocks
Deep learning - (1) RESNET implementation
版本问题导致“无法定位程序输入点OPENSSL_sk_new_reserve于动态链接库C:\Users...\libssl-1_1-x64.dll”
Flask blog practice - user management
Luogu p4292 [wc2010] reconstruction plan
Solid from entry to practice (end)
[detailed explanation] point multiplication and cross multiplication of neural network matrix (pytorch version)
How much do you know about the required encryption industry terms in 2022?
09 组合模式
Flask blog practice - realize the classified management of blogs
Synchronized
07 adapter mode
Flask博客实战 - 实现用户管理








