· last year · Feb 25, 2024, 03:00 AM
1//npm install puppeteer fs @antiadmin/anticaptchaofficial
2// update your login credentials
3// run with command: "node adobe.js"
4
5//IMPORTANT:
6//1. Adobe utilizes Recaptcha Enterprise V3 tokens for sign-in procedure.
7//Their JS transmits token in modified header. We replace their obfuscated script with our version,
8//where headers object is passed to our function "formatMyHeaders".
9//When token is solved by Anti Captcha, the header is modified accordingly by adding the v3 token,
10//and we manage to successfully sign in.
11//2. Several attempts (about 10 times) should be made to sign in successfully.
12
13const anticaptcha = require("@antiadmin/anticaptchaofficial");
14const pup = require("puppeteer");
15const fs = require('fs');
16
17
18//API key for anti-captcha.com
19const anticaptchaAPIKey = 'API_KEY_HERE';
20
21//your login in Adobe
22const login = 'some@email.com';
23
24
25const url = 'https://auth.services.adobe.com/en_US/index.html?callback=https%3A%2F%2Fims-na1.adobelogin.com%2Fims%2Fadobeid%2FAdobeStockContributor1%2FAdobeID%2Ftoken%3Fredirect_uri%3Dhttps%253A%252F%252Fcontributor.stock.adobe.com%252F%2523from_ims%253Dtrue%2526old_hash%253D%2526api%253Dauthorize%26code_challenge_method%3Dplain%26use_ms_for_expiry%3Dtrue&client_id=AdobeStockContributor1&scope=AdobeID%2Copenid%2Ccreative_cloud%2Ccreative_sdk%2Ccc_private%2Cgnav%2Csao.stock%2Cadditional_info.address.mail_to%2Cadditional_info.dob%2Cread_organizations%2Cread_pc.stock%2Csao.cce_private%2Cportfolio.sdk.import&denied_callback=https%3A%2F%2Fims-na1.adobelogin.com%2Fims%2Fdenied%2FAdobeStockContributor1%3Fredirect_uri%3Dhttps%253A%252F%252Fcontributor.stock.adobe.com%252F%2523from_ims%253Dtrue%2526old_hash%253D%2526api%253Dauthorize%26response_type%3Dtoken&relay=58a9aa05-a15c-4582-b0fa-28c82758e27a&locale=en_US&flow_type=token&ctx_id=contributor_login&idp_flow_type=login#/';
26let browser = null;
27let page = null;
28let token = null;
29
30(async () => {
31
32 anticaptcha.setAPIKey(anticaptchaAPIKey);
33 const balance = await anticaptcha.getBalance();
34 if (balance <= 0) {
35 console.log('Buy your anticaptcha balance!');
36 return;
37 } else {
38 console.log('API key balance is '+balance+', continuing');
39 // anticaptcha.shutUp(); //uncomment for silent captcha recognition
40 }
41
42 try {
43 console.log('opening browser ..');
44
45
46 let options = {
47 headless: false,
48 ignoreHTTPSErrors: true,
49 devtools: true
50 };
51 console.log(options);
52 browser = await pup.launch(options);
53
54
55 console.log('creating new page ..');
56 page = await browser.newPage();
57 } catch (e) {
58 failCallback("could not open browser: "+e);
59 return false;
60 }
61
62
63 await page.setRequestInterception(true);
64 page.on('request', (request) => {
65 if (request.url().indexOf('scripts.js') !== -1) {
66 console.log('aborting '+request.url());
67 request.abort();
68 } else {
69 request.continue();
70 }
71 });
72
73 console.log('solving captcha');
74
75 try {
76 token = await anticaptcha.solveRecaptchaV3Enterprise(url,'6LcGE-4ZAAAAAG2tFdbr7QqpimWAPqhLjI8_O_69',0.9,'');
77 } catch (e) {
78 failCallback("could not solve captcha: "+e);
79 return;
80 }
81
82 console.log('token is ready: '+token);
83
84
85 await page.goto(url, {
86 waitUntil: "domcontentloaded"
87 });
88
89 console.log('adding script');
90 try {
91
92 const path = require('path');
93 let file = fs.readFileSync(path.resolve('.', '_adobe.js'), 'utf8');
94 //replacing 'RECAPTCHA_TOKEN' placeholder with V3 token
95 file = file.replace('RECAPTCHA_TOKEN', token);
96 await page.addScriptTag({ content: file });
97 } catch (e) {
98 console.log('failed to insert script: '+e);
99 }
100
101 await delay(3000);
102
103 console.log('filling form ..');
104
105 const input= await page.$(`#EmailPage-EmailField`)
106 await input.focus();
107 await page.type(`#EmailPage-EmailField`,login)
108
109
110 await delay(1000);
111
112
113 console.log('clicking the button');
114 await page.click("#EmailForm > section.EmailPage__submit.mod-submit > div.ta-right > button");
115
116 console.log("waiting 10 sec for backend");
117 await delay(10000);
118
119
120 let htmlContent = await page.$eval('*', el => el.innerText);
121
122 if (htmlContent.indexOf('Confirm your phone number') !== -1 || htmlContent.indexOf('Verify your identity') !== -1) {
123 successCallback();
124 } else {
125 failCallback('control string not found');
126 }
127
128})();
129
130
131
132function delay(time) {
133 return new Promise(function(resolve) {
134 setTimeout(resolve, time)
135 });
136}
137
138
139function successCallback() {
140 console.log('Successfully passed test');
141 // console.log('closing browser .. ');
142 // browser.close();
143}
144
145function failCallback(code) {
146 console.log('Failed to pass: '+code);
147 // console.log('closing browser .. ');
148 // browser.close();
149}