Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

Mobile api: CAPTCHA error

Open Arctic-beaver opened this issue 1 year ago • 12 comments

The bug appears even in example! (See video below.)

Using new functionality with captcha i'm trying to register wa mobile, after request I get "code_checkpoint fail". Then I request and get captcha and send request with solved captcha, but receive code_checkpoint fail error again. I get into a vicious circle: captcha request - code_checkpoint-fail - captcha request...

Baileys version 6.4.1

To reproduce:

  1. Run example with --mobile from 6.4.1
  2. Try request registration code
  3. Get captcha
  4. Send request with captcha
  5. Get code_checkpoint fail again

https://github.com/WhiskeySockets/Baileys/assets/73189948/e947cd3c-1703-4bad-a294-1b03bdc63b3c

The bug reproduces both on WA mobile version from repository and on WA mobile version 2.23.18.8.

Arctic-beaver avatar Sep 04 '23 08:09 Arctic-beaver

Try set method as captcha

lyfe00011 avatar Sep 04 '23 09:09 lyfe00011

i have encountered the same issue! Pls help

ultraza4 avatar Sep 05 '23 10:09 ultraza4

Try set method as captcha

Already tried, not helping:( Getting 200 as response but still don't getting code. Another request after this 200 requires another code_checkpoint

Arctic-beaver avatar Sep 07 '23 09:09 Arctic-beaver

same problem...

ngsaeed avatar Oct 01 '23 07:10 ngsaeed

any solution? any activity? is there a hope to be fixed?

ngsaeed avatar Oct 14 '23 11:10 ngsaeed

you get code_checkpoint

then you send the same request to the same address, but in the method you specify method=captcha - you get the following response:

{ "audio_blob": "", "image_blob": "", "login": "18034566252", "status": "sent" }

audio_blob and image_blob will have base64. this image_blob solve captcha

end the solution to https://v.whatsapp.net/v2/captcha_verify

enc in POST data format

lc=US&audio_button_tap_count=0&in=8034566252&time_until_first_key_tap=40633&backup_token=%B7%C4%28X6%EDu%9E%90%1D%DB%C8%AE%96%CC%16%A5y%CD%9C&lg=en&e_regid=VmJDAg&id= %AD% 8C%09%95%AC%C8%2F%1C9%E9%CDo%A9%92%DF%3D%DD%DD%91C&authkey=7dywZkDaGX6SUZ1ymWiQVKHQWvpaOOGvrPnR83LwFzo&e_skey_sig=O-j5SIWoBn7S2KzlRJtV2GZFy OP4QUKWnvdI0qdsniXorDI9jSQ5esHdYD_dVHm6XtP5Bibn7oSiZG2kgle1AA&expid=w2ban9tdTM6lTuQcW_Hzag&e_ident=5DctlFETS1eMRhT6n1ARFQjvFAhvHE0KM3KBm5WzEAk&rc=0&simnum=0&fra ud_checkpoint_code=326&cc=1&e_skey_id= AAAA&fdid=ee9373a2-f7b8-4174-acaa-778447fe0cb2&e_skey_val=qLXwsWdic5PlMujP4DrtmEPLLdzCTX9BpzbqOU-C0xw&hasinrc=1&network_radio_type=1&refresh_button_tap_count=0&e_keytype=B Q&pid=10918&time_until_code_submit=47208

&fraud_checkpoint_code=405 - this is the captcha solution code

server response { "email_otp_eligible": 0, "flash_type": 0, "login": "18034566252", "sms_length": 6, "sms_wait": 0, "status": "verified", "voice_length": 6, "voice_wait": 0, "wa_old_eligible": 0 }

after verified, send a regular request to /code

salykingleb avatar Oct 15 '23 23:10 salykingleb

Thanks @salykingleb you're the savior of my night.

RobLinux avatar Nov 02 '23 03:11 RobLinux

@Auties00 you might want to look at this

RobLinux avatar Nov 02 '23 04:11 RobLinux

you get code_checkpoint

then you send the same request to the same address, but in the method you specify method=captcha - you get the following response:

{ "audio_blob": "", "image_blob": "", "login": "18034566252", "status": "sent" }

audio_blob and image_blob will have base64. this image_blob solve captcha

end the solution to https://v.whatsapp.net/v2/captcha_verify

enc in POST data format

lc=US&audio_button_tap_count=0&in=8034566252&time_until_first_key_tap=40633&backup_token=%B7%C4%28X6%EDu%9E%90%1D%DB%C8%AE%96%CC%16%A5y%CD%9C&lg=en&e_regid=VmJDAg&id= %AD% 8C%09%95%AC%C8%2F%1C9%E9%CDo%A9%92%DF%3D%DD%DD%91C&authkey=7dywZkDaGX6SUZ1ymWiQVKHQWvpaOOGvrPnR83LwFzo&e_skey_sig=O-j5SIWoBn7S2KzlRJtV2GZFy OP4QUKWnvdI0qdsniXorDI9jSQ5esHdYD_dVHm6XtP5Bibn7oSiZG2kgle1AA&expid=w2ban9tdTM6lTuQcW_Hzag&e_ident=5DctlFETS1eMRhT6n1ARFQjvFAhvHE0KM3KBm5WzEAk&rc=0&simnum=0&fra ud_checkpoint_code=326&cc=1&e_skey_id= AAAA&fdid=ee9373a2-f7b8-4174-acaa-778447fe0cb2&e_skey_val=qLXwsWdic5PlMujP4DrtmEPLLdzCTX9BpzbqOU-C0xw&hasinrc=1&network_radio_type=1&refresh_button_tap_count=0&e_keytype=B Q&pid=10918&time_until_code_submit=47208

&fraud_checkpoint_code=405 - this is the captcha solution code

server response { "email_otp_eligible": 0, "flash_type": 0, "login": "18034566252", "sms_length": 6, "sms_wait": 0, "status": "verified", "voice_length": 6, "voice_wait": 0, "wa_old_eligible": 0 }

after verified, send a regular request to /code

Hello,

I'm having problems registering, I receive the captcha code, with 3 numbers, but when trying to register the error.

./yowsup-cli registration -R 149 --config-phone 5547999999999 --config-cc 55 --config-mcc 724 --config-mnc 05 -d -E android ... ... I 2023-11-03 14:36:05,347 yowsup.common.http.warequest - b'{"reason":"missing","status":"fail","login":"554799999999"}\n' { "version": 1, "cc": "55", "client_static_keypair": "8ORmXNsy6udKrraIUTwD/PmyChURE3qFPgZ7nJFCrm9pWb5M/sheAt6Qlhv/z5H+CJhC+BbySUwKnSGLUOk2Yg==", "expid": "vzEBd/nfSju0czUA6e63tg==", "fdid": "5f7e64ef-30cf-4b4d-964f-fe3b66a0e911", "id": "OV99uH3Yj12Xw9LvnCPrXPe610k=", "lc": "GB", "lg": "en", "login": "554799999999", "mcc": "724", "mnc": "05", "phone": "554799999999", "sim_mcc": "000", "sim_mnc": "000" } status: b'fail' login: b'554799999999' root@fw01:~/yowsup#

Is it necessary to change something else in the code, as it is registered via captcha?

heliopoffo avatar Nov 04 '23 13:11 heliopoffo

Thanks @salykingleb you're the savior of my night.

Did you manage to solve the part of the captcha_verify API, to receive the registration code? I couldn't do that part :(

heliopoffo avatar Nov 06 '23 23:11 heliopoffo

Спасибо @salykingleb, ты спас мою ночь.

Удалось ли вам решить часть API captcha_verify для получения регистрационного кода? Я не смог выполнить эту часть:(

Thanks @salykingleb you're the savior of my night.

Did you manage to solve the part of the captcha_verify API, to receive the registration code? I couldn't do that part :(

Baileys already has almost everything for this, you just need to add a block and work with it to send a captcha solution.

function mobileRegisterCapha(params, fetchOptions) { console.log('Inside mobileRegisterCapha'); // Лог для отслеживания выполнения функции //console.log('params:', params); // Вывод параметров console.log('fetchOptions:', fetchOptions); // Вывод опций запроса return mobileRegisterFetch('/captcha_verify', { params: { ...registrationParams(params), mcc: ${params.phoneNumberMobileCountryCode}.padStart(3, '0'), mnc: ${params.phoneNumberMobileNetworkCode || '001'}.padStart(3, '0'), sim_mcc: '000', sim_mnc: '000', method: (params === null || params === void 0 ? void 0 : params.method) || 'sms', reason: '', hasav: '1', fraud_checkpoint_code: params.captcha, }, ...fetchOptions, }); }

salykingleb avatar Nov 13 '23 14:11 salykingleb

你得到 code_checkpoint 然后您将相同的请求发送到相同的地址,但在您指定 method=captcha 的方法中 - 您会得到以下响应: { "audio_blob": "", "image_blob": "", "登录": "18034566252", "状态": "已发送" } audio_blob 和 image_blob 将具有 base64。这个 image_blob 解决了验证码问题 结束解决方案https://v.whatsapp.net/v2/captcha_verify POST 数据格式的 enc lc=US&audio_button_tap_count=0&in=8034566252&time_until_first_key_tap=40633&backup_token=%B7%C4%28X6%EDu%9E%90%1D%DB%C8%AE%96%CC%16%A5y%CD%9C&lg=en&e_regid=VmJDAg&id= %AD% 8C%09%95%AC%C8%2F%1C9%E9%CDo%A9%92%DF%3D%DD%DD%91C&authkey=7dywZkDaGX6SUZ1ymWiQVKHQWvpaOOGvrPnR83LwFzo&e_skey_sig=O-j5SIWoBn7S2KzlRJtV2GZFy OP4QUKW nvdI0qdsniXorDI9jSQ5esHdYD_dVHm6XtP5Bibn7oSiZG2kgle1AA&expid=w2ban9tdTM6lTuQcW_Hzag&e_ident=5DctlFETS1eMRhT6n1ARFQjvFAhvHE0KM3KBm5WzEAk&rc=0&simnum=0&fra ud_checkpoint_code=326 &抄送= 1&e_skey_id= AAAA&fdid=ee9373a2-f7b8-4174-acaa-778447fe0cb2&e_skey_val=qLXwsWdic5PlMujP4DrtmEPLLdzCTX9BpzbqOU-C0xw&hasinrc=1&network_radio_type=1&refresh_button_tap_count=0&e_key类型=B Q&pid=10918&time_until_code_submit=47208 &fraud_checkpoint_code=405 - 这是验证码解决方案代码 服务器响应 { "email_otp_eligible": 0, "flash_type": 0, "login": "18034566252", "sms_length": 6, "sms_wait": 0, "status": "已验证", "voice_length": 6, " voice_wait": 0, "wa_old_eligible": 0 } 验证通过后,发送常规请求到/code

你好,

我在注册时遇到问题,收到带有 3 个数字的验证码,但在尝试注册时出现错误。

./yowsup-cli注册-R 149 --config-phone 5547999999999 --config-cc 55 --config-mcc 724 --config-mnc 05 -d -E android ... ... I 2023-11-03 14:36:05,347 yowsup.common.http.warequest - b'{"reason":"missing","status":"fail","login":"554799999999"}\n' { " version " : 1, “cc”:“55”, “client_static_keypair”:“8ORmXNsy6udKrraIUTwD / PmyChURE3qFPgZ7nJFCrm9pWb5M / sheAt6Qlhv / z5H + CJhC + BbySUwKnSGLUOk2Yg==”,“ expid”:“vzEBd / nfSju0czUA6e63tg==”, “fdid”:“ 5f7e64ef-30cf-4b4d -964f-fe3b66a0e911", "id": "OV99uH3​​Yj12Xw9LvnCPrXPe610k=", "lc": "GB", "lg": "en", "登录": "554799999999", "mcc": "724", "mnc" : "05", "电话": "554799999999", "sim_mcc": "000", "sim_mnc": "000" } 状态: b'失败' 登录: b'554799999999' root@fw01:~/yowsup#

由于是通过验证码注册的,是否需要更改代码中的其他内容?

  1. code

  2. captcha_verify

  3. code Is this a step, bro, but I never received the verification code on my old device?

  4. captcha_verify: {"status":"verified","sms_wait":46774,"voice_wait":94,"login":"60175259750","email_otp_eligible":0,"wa_old_eligible":0,"sms_length":6,"voice_length":6,"flash_type":0}

  5. code: {"status":"sent","length":6,"retry_after":46805,"method":"sms","sms_wait":46805,"voice_wait":125,"login":"60175259750","flash_type":0,"wa_old_wait":65,"email_otp_wait":65,"notify_after":86400}

Observed that this package is returned on the old device But there is no verification code attached <pre_registration> </pre_registration>

musir88 avatar Mar 06 '24 08:03 musir88