The Session storage path can list security issues

Source: Internet
Author: User

Nowadays, virtual hosts are becoming more and more secure. Although they cannot directly go to the target website directory, they can read the Session
The following is a demonstration: localtest1.safe121.com and localtest2.safe121.com.

Assume that we have set baseopendir to be different at will and cannot obtain server permissions.
Three PHP
One is to create a SESSION, the other is to clear the SESSION, and the other is to display the SESSION


We create a session in website 1 (use different browsers to ensure isolation)

Create a session in website 2

In browser A, Session1 is displayed.

Show SESSION2 again

Of course, session2 cannot be displayed because it does not create a session in this browser.
We use webshell to open the SESSION directory.

Our goal is to steal the session of website 2.

Determine the SESSION of website 2 based on the file owner and file size.
Finally, modify the session value to steal the session of website 2.

Solution:
1. Specify the session save path before the website program session starts, such as creating a folder on the website, called the sEsS10n-1213213124sdkfsd permission is writable, and then before the website program SESSION starts
Session_save_path ('sess10n-1213109124sdkfsd ');
Session_start ();
Specify the session storage path.
2. develop good habits. Exit immediately after using the background. Do not close the browser directly.
3. Save the IP address in the SESSION. If the IP address is different, it is forced to exit. However, if the IP address changes when using the background, this will lead to false exit.

From: network security blog

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.