1 Intermediate program includeinc & lt ;? Include_once & amp; 39; includeBasephp & amp; 39; $ path & amp; 39; & amp; 39; $ urlisBase :: decrypt (urlDecode ($ _ SERVER [& amp; 39; QUERY _
1. Intermediate program include. inc
-
- Include_once 'include/Base. php ';
- $ Path = '';
- $ Url = isBase: decrypt (urlDecode ($ _ SERVER ['query _ string']);
- Parse_str ($ url); // GET the variable passed through the url address GET
- If (! Emptyempty ($ _ POST ['path']) {// Get the variable passed by POST
- $ Path = $ _ POST ['path'];
- $ Path = isBase: decrypt (urlDecode ($ path ));
- }
- // Parse the actual path
- If (emptyempty ($ path )){
- // Header ("Location: login. php ");
- Exit;
- }
- If (! Preg_match ("/(^ http:/) | ([? | & | =])/", $ Path )){
- // Jump to the path of the actual execution file
- Chdir (dirname ($ path ));
- Include_once basename ($ path );
- Exit;
- }
- ?>
Index. php and include. inc are in the same directory
-
- Include. inc;
- ?>
2. modify the link in the program ()
- "Index. php? ". Encrypt (" path =/test. php & test = 123 & test2 = 4321 ")
3. modify the POST form in the program
All forms are submitted to index. php, and a hidden Form is added in the middle.
4. modify the path of the front-end Html page: baseref =/test
5. the encryption and decryption functions are provided by you.
Summary:This method is cumbersome and can only hide the background script path. The frontend script path can still be seen in the source file (baseref). The address displayed in the address bar is index. php? Xxxxxxxx.