Javascript injection tips by kostis90gr
Translation: Ghost [S.S. T]
This article has been published in the June publication of the black line of defense. The copyright belongs to the black line of defense and the Script Security Team. repost it to ensure the integrity of the Article. Thank you :)
This guide is only for report purposes. I am not responsible for anyone who uses it for illegal purposes.
By using javascript injection, you can change the content of the website without shutting down the website or saving the page on his PC. This is done by the address bar of his browser.
The command syntax looks like this:
Copy code
Javascrit: alert (# command #)
For example, if you want to see a warning box in the website http://www.example.com, first enter the URL (www.example.com) in the address bar. After the page is loaded, clear the URL and enter the warning crit: alert ("Hello World") as a new URL. in this case, a warning box is displayed, showing Hello World. however, some people will use this technique to change almost any content on the page. for example, an image. let's imagine a website logo image. by viewing the page source code (you can use "view source code" in the browser), we found an HTML code:
Copy code
Get information: There is an image named hi, and the source file is hello.gif.we want to change to bye.jpeg and store it on our site http://www.mysite.com. So the complete URL of our image is http://www.mysite.com/bye.jpeg to use javascript injection, We need to input in the address bar:
You will see a prompt box saying http://www.mysite.com/bye.#, and after that, the image will be changed. Although the changes are only temporary! If you refresh the page or enter the page again, your changes will be lost, because you are not changing the site on the server, but on your PC.
Using the same method, we can view or change the variable value. For example, we find such source code on the website:
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