Cross-Origin Ajax problems

Source: Internet
Author: User
: This article mainly introduces cross-origin Ajax issues. if you are interested in the PHP Tutorial, you can refer to it. Ajax can only Access (submit forms, etc.) files in the same domain as asp and php files on the server. this is because the http header returned by the server usually does not contain the Access-Control-Allow-Origin field. Therefore, in the process of penetration, to allow the inserted JS to access our own server, you need to add this field to the http header. When using ettercap, add the following to the filter:

If (ip. proto = TCP & tcp. src = 80 ){

If (search (DATA. data, "Content-Type ")){

# Msg ("access control ");

Replace ("Content-Type", "Access-Control-Allow-Origin: * \ r \ nContent-Type ");

}

}

Access-Control-Allow-Origin: * indicates that cross-Origin requests from all webpages can be accepted.

Or Access-Control-Allow-Origin: www.baidu.com

The above section introduces the cross-origin issue of Ajax, including related content, and hopes to help those who are interested in the PHP Tutorial.

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.