How to fix the BUG

Source: Internet
Author: User
Fix the BUG. how can I fix this bug with two php files: 1.php& lt ;? Php & nbsp; echo & nbsp; '1 ';? & Gt; 2.php& lt ;? Php & nbsp; echo & nbsp; '2 ';? & Gt; enter http: // localhost/1.php/ in the browser to fix the BUG. how can I fix the bug?
There are 2 php files

1. php
Echo '1 ';
?>

2. php
Echo '2 ';
?>
Input in the browser
Http: // localhost/1.php/ 2.php

Output 1

In order to save trouble, I want to directly prompt that the browser address is invalid. what should I do?
Share To: 2.php Enter http: // localhost/1.php/ 2. ph... 'data-pics = ''>
------ Solution --------------------
However, http: // localhost/1.php/ 2.php is not illegal. why is it illegal?
The/2.php file is saved in the $ _ SERVER ['path _ info'] variable.
------ Solution --------------------
As mentioned above, it is not illegal. However, it is quite easy to implement. get the input url, intercept the file name, and make a simple judgment.

$ Url = "http: // localhost/1.php/ 2.php ";
$ Filename = basename ($ url );
If ($ filename! = "1.php "){
Echo "script" alert ('invalid address '); script ";
}

------ Solution --------------------
It is not clear what is used. it is recommended to create an anti-hop wall, with a single portal

PS: Close, score too low
------ Solution --------------------
How to verify if website is vulnerable?

If, for example, you use http://www.example.com/admin/ URL to access store admin, try to open http://www.example.com/admin/orders.php/login.php. If you will not see login screen you are in danger!
How can I verify that a website is vulnerable?

If, for example, you use. If you do not see the logon screen, you are in danger!

What I see is:

Am I in danger?
Joke!

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.