Recently, a third-party tool scanned the project for an Http head xss cross scripting vulnerability. To fix this vulnerability, we also studied the principle of cross-site scripting attacks, the cross-site scripting attack is basically the html version of SQL injection. The core content is to pass a specially designed script to the server and execute the html Vulnerability on the webpage through HTTP GET/PO
The following function can be used to filter the input of the user to ensure that the input is XSS-safe. Specifically how to filter, you can see inside the function, there are comments.
Copy CodeThe code is as follows:
function Removexss ($val) {
Remove all non-printable characters. CR (0a) and LF (0b) and TAB (9) are allowed
This prevents some character re-spacing such as
Note that you had to handle splits with \ n, \ r, and \ t later since they
First, scan for vulnerabilities in the target. Scanned a lot of XSS
Find a test, pop up the window, you can use
We use code transcoding to avoid filtering by browser security policies.
Copy the transcoded code and combine it with the vulnerability address to generate a URL.
The access URL automatically jumps to the attack page on my server. Www.2cto.com
Open the Server Directory and find cook
There have been articles on cross-site scripting attacks and defense on the Internet, but with the advancement of attack technology, the previous views and theories on cross-site scripting attacks cannot meet the current attack and defense needs, and due to this confusion in understanding cross-site scripting, as a result, many programs, including the current dynamic network, have the problem of loose filte
even a dedicated website can calculate the hash value for you. Update: To ensure that the browser performs the same origin policy correctly and prevents cross-site scripting attacks (XSS), the Crossorigin property of the script and the Cors (cross-origin Resource sharing) header file will generally be Sri. Sri has not yet been widely supported by browsers, but Chrome and Firefox have included them in the development plan. Because server attacks are e
presence on the page, another page that exists on the current page, and is two completely different windows.The IFRAME modifies the parent page, calling Window.parent:type= "Text/javascript"> window.parent.document.write ( ' I am a bad boy, I modified my father 'script>The parent page modifies the IFRAME sub-page, called window.frames[]:Script>window.frames['Change_by_father'].contentwindow.document.write ('modifications from the parent page')
For XSS filtering, many websites say that to filter double quotation marks, You need to filter out angle brackets to ensure security. Is it completely safe to filter double quotation marks and angle brackets? In the variables imported into Javascript, XSS has many methods. In many cases, we need to analyze them based on specific context. Instead of filtering base
in the future when anyone accesses a customer feedback site. You may also think that others will not be corrupted by JavaScript injection attacks.
Now, your first reaction to JavaScript injection attacks may be to ignore it. You might think that JavaScript injection attacks are just harmless, and unfortunately hackers can sabotage by injecting
For more information about how to read the content on the xss file page, see. Js:
The Code is as follows:
Document. body. addBehavior ("# default # Download ");Var mycars = new Array ();Mycars [0] = "l.htm ";Mycars [1] = "y.htm ";For (x in mycars){If (document. body. startDownload (mycars [x], GetData )){GetData (source );}}Function GetData (source){Txt = escape (source );GetReaded (txt );}Function getReaded (usr ){Var newimg = new Image ();Newimg.
In IE, javascript strings can be truncated by NULL characters, but only when getValue is used.Test code:Alert ('abc \ 0 def ') If this is the case, it is spoofing at most, but with IE (IE parsing bug:As mentioned in the XSS vectors I have previously shared, it is considered invalid when the parser cannot match the end definer of an attribute value in a tag, use it as text.Before 5.3.0, magic_quotes_gpc is e
XSS detects the client environment and javascript detects the client files and system environment. In future use of xss, you may need to check the client environment, such as the browser version, whether to install 360, anti-virus software, java version, and some system files ...... Javascript can be used to detect the
If the cookie is set with the HTTPONLY flag, you can avoid javascript from reading cookies when XSS occurs, which is why HttpOnly was introduced.Implementation method:Settings in PHP1. In the php.iniSession.cookie_httponly = True2. Global settings in the program:Ini_set ("Session.cookie_httponly", 1);OrSession_set_cookie_params (0, NULL, NULL, NULL, TRUE);?>The 3.Cookie operator function Setcookie function
. Although vendors initially focused primarily on AJAX auditing tools, security researchers are more concerned with continuous system boundaries to explore the truth. Due to various possible attack vectors, the Web Application Security Community has also established multiple frameworks to detect and exploit security vulnerabilities, so as to reveal various problems faced by the Web development community.
In the previous article, we introduced how to s
. This article introduces how to use AttackAPI in detail.
1. AttackAPI Overview
AttackAPI is a Web-based attack construction library that can be used in combination with PHP, JavaScript, and other client and server technologies. AttackAPI consists of dozens of modules with different functions. These modules can be used either in a browser or in a JavaScript inter
. Although vendors initially focused primarily on AJAX auditing tools, security researchers are more concerned with continuous system boundaries to explore the truth.
Due to various possible attack vectors, the Web Application Security Community has also established multiple frameworks to detect and exploit security vulnerabilities, so as to reveal various problems faced by the Web development community. This article introduces how to use AttackAPI in
Introduction to DDoS
The most common attack is a distributed denial of service (DDoS) attack on a Web site. In a typical DDoS attack, an attacker consumes service resources by sending a large amount of data to the server. To prevent access to other users.
If a hacker uses JavaScript DDoS attacks, then any computer ca
Distributed Denial-of-service Attack (DDoS) attacks are one of the oldest and most common attacks against web sites. Nick Sullivan is a system engineer at CloudFlare, a website accelerator and security Service provider. In recent days, he wrote about how attackers use malicious Web sites, server hijacking, and intermediary attacks to launch DDoS attacks, and how to use HTTPS and the upcoming "Child Resource Consistency (Subresource Integrity, referred
parse the JSON text and then generate the JavaScript object. You must enclose the text in parentheses in order to avoid syntax errors:var obj = eval ("(" + txt + ")");To use JavaScript objects in a Web page:1 2 First Name: 3 last Name: 4 56 JSON ParserTip: The eval () function compiles and executes any JavaScript code. This hides a potential security issue.Using
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.