官术网_书友最值得收藏!

Obtaining and modifying cookies

Cookies are small pieces of information sent by a web server to the client (browser) to store some information locally, related to that specific user. In modern web applications, cookies are used to store user-specific data, such as color theme configuration, object arrangement preferences, previous activity, and (more importantly for us) the session identifiers.

In this recipe, we will use the browser's tools to see the cookies' values, how they are stored, and how to modify them.

Getting ready

Our vulnerable_vm needs to be running. 192.168.56.102 will be used as the IP address for that machine and we will use OWASP-Mantra as the web browser.

How to do it...

  1. Browse to http://192.168.56.102/WackoPicko.
  2. On Mantra's menu, navigate to Tools | Application Auditing | Cookies Manager +.

    In the preceding image, we can see all the cookies stored at that time, and the sites they belong to, with this add-on. We can also modify their values, delete them, and add new ones.

  3. Select PHPSESSID from 192.168.56.102 and click on Edit.
  4. Change the Http Only value to Yes.

    The parameter we just changed (Http Only) tells the browser that this cookie is not allowed to be accessed by a client-side script.

How it works...

Cookies Manager+ is a browser add-on that allows us to view, modify, or delete existing cookies and to add new ones. As some applications rely on values stored in these cookies, an attacker can use them to inject malicious patterns that might alter the behavior of the page or to provide fake information in order to gain a higher level of privilege.

Also, in modern web applications, session cookies are commonly used and often are the only source of user identification once the login is done. This leads to the possibility of impersonating a valid user by replacing the cookie's value for the user of an already active session.

主站蜘蛛池模板: 湛江市| 叶城县| 屏山县| 德令哈市| 共和县| 西峡县| 乌兰察布市| 安丘市| 阿荣旗| 武胜县| 留坝县| 马公市| 贵溪市| 莱西市| 大邑县| 井陉县| 邵武市| 江达县| 清丰县| 潜山县| 芦山县| 若尔盖县| 隆尧县| 新密市| 九寨沟县| 重庆市| 错那县| 陇川县| 彭水| 淳安县| 五大连池市| 肥乡县| 华阴市| 娱乐| 离岛区| 阿克苏市| 左权县| 灵丘县| 根河市| 泽库县| 招远市|