V4NSH4J / discord-mass-DM-GO

The most powerful Discord selfbot written in GO allowing users to automate their campaigns & send low-cost mass messages to Discord users!
https://t.me/tosviolators
GNU Affero General Public License v3.0
2.17k stars 636 forks source link

Captcha Solution #758

Open Wade6060 opened 2 years ago

Wade6060 commented 2 years ago

I am writing my python bot to send DM messages. But I ran into the problem that if I write to a person for the first time, I get a captcha in the request: {'captcha_key': ['captcha-required'], 'captcha_sitekey': 'DELL', 'captcha_service': 'hcaptcha', 'captcha_rqdata': 'DELL', 'captcha_rqtoken': 'DELL'}. (Deleted the data from the response) With the help of your bot, there is no such problem and the message is sent calmly, I would like to know how you got around it, thank you for the answer.

V4NSH4J commented 2 years ago

Hey,

If while sending messages you're detected in anyway (Flagged browser information, bad TLS config Usually HTTPX works best without messing with TLS, Modules like requests are "patched" because of this unless you change the TLS config, Incomplete Header information, etc) Sometimes the token is captcha'd, but if you can send messages manually, you should be able to with automation as well.

I recommend checking out Discord.py-self which is a fork for discord.py but for selfbots.

I believe they have everything properly implemented, you can use the library or also use their code.

Let me know if you have any other questions.

Wade6060 commented 2 years ago

Hey,

If while sending messages you're detected in anyway (Flagged browser information, bad TLS config Usually HTTPX works best without messing with TLS, Modules like requests are "patched" because of this unless you change the TLS config, Incomplete Header information, etc) Sometimes the token is captcha'd, but if you can send messages manually, you should be able to with automation as well.

I recommend checking out Discord.py-self which is a fork for discord.py but for selfbots.

I believe they have everything properly implemented, you can use the library or also use their code.

Let me know if you have any other questions.

I don't use Discord libraries. I am sending the usual message sending requests:

u = 'https://discord.com/api/v9/users/@me/channels
d = {
"recipients": [f"{user_id}"]
}
payload = {
"content": f"You <@{user_id}>"
 }
 header = {
"authorization": token
}
r =requests.post(url=u, json=d, headers=header)
jss = json.loads(r.text)
url = f'https://discord.com/api/v9/channels/{jss["id"]}/messages'
r = requests.post(url,data=payload,headers=header)
jss = json.loads(r.text)

If I had a dialogue with a person before, then the message is sent without any problems. If I write messages to a person for the first time, then I immediately get a captcha.

itschasa commented 2 years ago

Your headers aren't sufficient enough for discord to believe it. You are missing the usual headers like user-agent, etc. But also the custom ones discord uses, like x-context-properties and x-super-properties. To get the headers, use the network tab on chrome devtools. Make the request on discord.com, see what headers its using, and copy them. Sometimes you may need to slightly modify them, so keep that in mind.

You are (by the looks of it) using the requests library, which is what Vanshaj could be causing flags as well, from TLS.

Modules like requests are "patched" because of this unless you change the TLS config

I'm using httpx no problems, so I recommend trying that out. It should be just as simple as replacing import requests and requests.post with import httpx and httpx.post.