Skip to content

Commit

Permalink
Added netflix.com sign-in page Recaptcha bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
billgates007 committed Dec 29, 2020
1 parent 7fba385 commit 35dbfe8
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Captcha Bypass Examples
This repository demonstrates weakness of filtering human users with CAPTCHAs. Created for educational use only.

##Requirements:
__Requirements:__
- NodeJS
- npm packages puppeteer and @antiadmin/anticaptchaofficial

##List of solutions:
- Bypass geo.captcha-delivery.com protection by [Data Dome](http://datadome.co) :
- geo.captcha.delivery.com.js (bypass Recaptcha V2 and Geetest)
__List of solutions:__
- Bypass geo.captcha-delivery.com protection by Data Dome:
- [geo.captcha.delivery.com.js](https://github.com/MoterHaker/bypass-captcha-examples/blob/main/geo.captcha.delivery.com.js) (bypass Recaptcha V2 and Geetest)
- geo.captcha.delivery.com.png (scheme)
- Bypass store.steam-powered.com/join captcha.
- [Bypass](https://github.com/MoterHaker/bypass-captcha-examples/blob/main/store.steam-powered.com.js) store.steam-powered.com/join Recaptcha Enterprise V2.
- [Bypass](https://github.com/MoterHaker/bypass-captcha-examples/blob/main/netflix.js) netflix.com Enterprise Recaptcha V3 at sign-in page.

__Requests__

##Requests
Post your captcha bypass requests in issues section
13 changes: 13 additions & 0 deletions _netflix.js

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions netflix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
//npm install puppeteer fs @antiadmin/anticaptchaofficial

//IMPORTANT:
//1. Netflix utilizes Enterprise Recaptcha V3
//2. We use their obfuscated script located at https://codex.nflxext.com/*** CDN.
// We modify it a little to add a function "getMyToken" at the place where they use token from Google.
// In case of script modifcations, you may add this function yourself.
// This function simply returns V3 Enterprise token which we substitute after solving it in Anti Captcha.
//3. Netflix login and password are required to test this script.
//4. Several attempts (about 10 times) should be made to sign in successfully.

const anticaptcha = require("@antiadmin/anticaptchaofficial");
const pup = require("puppeteer");
const fs = require('fs');


//API key for anti-captcha.com
const anticaptchaAPIKey = 'API_KEY_HERE';

//access data
const url = 'https://www.netflix.com/login';
const login = 'cartrelly@gmail.com';
const password = 'MD034dkfldklfdm!ds';

let browser = null;
let tab = null;
let token = null;



(async () => {

anticaptcha.setAPIKey(anticaptchaAPIKey);
const balance = await anticaptcha.getBalance();
if (balance <= 0) {
console.log('Buy your anticaptcha balance!');
return;
} else {
console.log('API key balance is '+balance+', continuing');
// anticaptcha.shutUp(); //uncomment for silent captcha recognition
}

try {
console.log('opening browser ..');


let options = {
headless: false,
ignoreHTTPSErrors: true,
devtools: true
};
console.log(options);
browser = await pup.launch(options);


console.log('creating new page ..');
page = await browser.newPage();
} catch (e) {
failCallback("could not open browser: "+e);
return false;
}


await page.setRequestInterception(true);
page.on('request', (request) => {
if (request.url().indexOf('none') !== -1 && request.url().indexOf('js') !== -1 && request.url().indexOf('components') !== -1) {
console.log('aborting '+request.url());
request.abort();
} else {
request.continue();
}
});
page.on('response', (response) => {
if (response.url().indexOf('login') !== -1 && response.request().method() === 'POST') {
console.log("\n\n==== captcha check response ====\n\n");
console.log('status: '+response.status());
if (response.status() !== 302) {
failCallback("captcha result not accepted");
} else {
successCallback("successfully passed test");
}
}
});

console.log('solving captcha');

try {
token = await anticaptcha.solveRecaptchaV3Enterprise(url,'6Lf8hrcUAAAAAIpQAFW2VFjtiYnThOjZOA5xvLyR',0.9,'');
} catch (e) {
failCallback("could not solve captcha");
return;
}

console.log('token is ready: '+token);


try {
await page.goto(url, {
waitUntil: "domcontentloaded"
});
} catch (e) {
console.log('err while loading the page: '+e);
}

// await delay(5000);


console.log('adding modifed script');
try {

const path = require('path');
let file = fs.readFileSync(path.resolve('.', '_netflix.js'), 'utf8');
file = file.replace('RECAPTCHA_TOKEN', token);
await page.addScriptTag({ content: file });
} catch (e) {
console.log('failed to insert script: '+e);
}

await delay(3000);

console.log('filling form ..');

const loginInput= await page.$(`#id_userLoginId`)
await loginInput.focus();
await page.type(`#id_userLoginId`,login)

await delay(1000);

const passwordInput= await page.$(`#id_password`)
await passwordInput.focus();
await page.type(`#id_password`,password)


await delay(1000);

console.log('clicking the button');

await Promise.all([
page.click("#appMountPoint > div > div.login-body > div > div > div.hybrid-login-form-main > form > button"),
page.waitForNavigation({ waitUntil: 'networkidle0' }),
]);



})();



function delay(time) {
return new Promise(function(resolve) {
setTimeout(resolve, time)
});
}



function successCallback() {
console.log('Successfully passed: ');
// console.log('closing browser .. ');
// browser.close();
}

function failCallback(code) {
console.log('Failed to pass: '+code);
// console.log('closing browser .. ');
// browser.close();
}

0 comments on commit 35dbfe8

Please sign in to comment.