api.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:HBCTF 作者: osteth 项目源码 文件源码
def STS():
    '''Accepts players score submitions and passes its info over to ServiceScore funtion to validate the token and then update the teams score when its valid.
    json data should be in format {"TeamID": "Highlander","Token": "therecanbeonlyone"}
    Example: 
    curl -H "Content-Type: application/json" -X POST -d '{"TeamID": "Highlander","Token": "therecanbeonlyone"}' http://localhost:5001/ScoreTokentSubmit/
    '''
    try:
        sts_resp = request.data
        Token = sts_resp.get('Token')
        TeamID  = sts_resp.get('TeamID')
        if Token and TeamID is not None:
            print('Team ' + TeamID + 'has scored service points!')
            ServiceScore(TeamID, Token)
            return {'request data': request.data}
        else:
            return {'Invalid': 'request'}
    except:
        return {'Invalid': 'request'}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号