PortswiggerLab:Exploiting a mass assignment vulnerability

实验目标

To solve the lab, find and exploit a mass assignment vulnerability to buy a Lightweight l33t Leather Jacket. You can log in to your own account using the following credentials: wiener:peter.

官方WP

  1. In Burp's browser, log in to the application using the credentials wiener:peter.

  2. Click on the Lightweight "l33t" Leather Jacket product and add it to your basket.

  3. Go to your basket and click Place order. Notice that you don't have enough credit for the purchase.

  4. In Proxy > HTTP history, notice both the GET and POST API requests for /api/checkout.

  5. Notice that the response to the GET request contains the same JSON structure as the POST request. Observe that the JSON structure in the GET response includes a chosen_discount parameter, which is not present in the POST request.

  6. Right-click the POST /api/checkout request and select Send to Repeater.

  7. In Repeater, add the chosen_discount parameter to the request. The JSON should look like the following:

    {
        "chosen_discount":{
            "percentage":0
        },
        "chosen_products":[
            {
                "product_id":"1",
                "quantity":1
            }
        ]
    }
  8. Send the request. Notice that adding the chosen_discount parameter doesn't cause an error.

  9. Change the chosen_discount value to the string "x", then send the request. Observe that this results in an error message as the parameter value isn't a number. This may indicate that the user input is being processed.

  10. Change the chosen_discount percentage to 100, then send the request to solve the lab.


实验步骤

  • 进入实验室首页

  • 点击右上角的`My account`进入登录页面

  • 使用实验室提供的凭据成功登录 

  • 回到商品展示页找到目标商品

  • 将该商品添加进购物车中

在购物车页面中进行刷新可见一接口

  • 使用OPTIONS方式向该接口发送请求,查看该接口允许接收什么类型的请求

由响应头可见,该接口仅允许接收`GET`、`POST`方式请求

  • 使用GET方式向该接口发送请求

  • 将请求方式修改为POST
  • 将发送GET请求时响应体复制到POST请求体中
  • 将折扣从0修改为100

  • 发包后成功将商品价格修改为0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

x0da6h

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值