Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Recaptch v3 to send webhook
- // @description Refacture recaptch v3
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @author Rayjay
- // @match https://www.nike.com.br/atendimento*
- // @grant none
- // ==/UserScript==
- /* globals jQuery, $, waitForKeyElements */
- //---- send data func ----//
- async function sendData(a1,a2,a3,a4,a5,extLogger,stopHndl){
- const start = new Date();
- let delCount = 0;
- let failCount = 0;
- const msToHMS = s => `${s / 3.6e6 | 0}h ${(s % 3.6e6) / 6e4 | 0}m ${(s % 6e4) / 1000 | 0}s`;
- console.log("Sending data...")
- console.log(a1,a2,a3,a4,a5)
- const log = {
- warn() { extLogger ? extLogger('warn', arguments) : console.warn.apply(console, arguments); },
- error() { extLogger ? extLogger('error', arguments) : console.error.apply(console, arguments); },
- success() { extLogger ? extLogger('success', arguments) : console.info.apply(console, arguments); },
- };
- const end = () => {
- log.error(`Ended at ${new Date().toLocaleString()}! Total time: ${msToHMS(Date.now() - start.getTime())}`);
- log.warn(`Foi enviado ${delCount} tokens, ${failCount} failharam.\n`);
- }
- async function sendy() {
- grecaptcha.execute(a4, {action: a3}).then(
- function(e) {
- log.warn("Token Gerado = "+e);
- url = a2+e
- const URL_TO_FETCH = url;
- fetch(URL_TO_FETCH, {
- method: 'get', // opcional
- mode: 'no-cors'
- }).then(function(response) {
- delCount++;
- return log.success("Token enviado com sucesso");
- }).catch(function(err) {
- failCount++;
- return log.error("Erro na conexão");});
- }
- )
- }
- function getCookie(name) {
- const value = `; ${document.cookie}`;
- const parts = value.split(`; ${name}=`);
- if (parts.length === 2) return parts.pop().split(';').shift();
- }
- log.success(`\nStarted at ${start.toLocaleString()}`);
- function delay(message){
- return new Promise((resolve) => setTimeout(function(){
- console.log(message);
- resolve();
- }, a1))
- }
- (async () => {
- var ii = true
- while (ii){
- console.log("Start")
- console.log(stopHndl())
- await delay("No")
- await sendy()
- if (stopHndl && stopHndl() === false) return ii = false , end(log.error('Stopped by you!'));
- //if (stopHndl && stopHndl() === false)
- }
- })();
- return await sendy();
- }
- //---- User interface ----//
- function initUI() {
- const insertCss = (css) => {
- const style = document.createElement('style');
- style.appendChild(document.createTextNode(css));
- document.head.appendChild(style);
- return style;
- }
- const createElm = (html) => {
- const temp = document.createElement('div');
- temp.innerHTML = html;
- return temp.removeChild(temp.firstElementChild);
- }
- insertCss(`
- #undiscord { font-family: ui-monospace;color:#fff;z-index:99;margin-left: auto;margin-right: auto;left: 0;right: 0;}
- #undiscord{position:fixed;top:0px;text-align: center;background-color:var(--dark);width: 600px;padding:1rem;border-radius:0.5rem}
- #undiscord .header{border-radius: 10px;padding:12px 16px;background-color:#f1f1f1;}
- #undiscord p,#undiscord .btn{color:#fff;border:0;border-radius:4px;font-size:14px}
- #undiscord input{width: 70%}
- #undiscord #inputuser{display: grid;background: #7289da94;margin: 0.5rem;}
- #undiscord .logarea{overflow:auto;font-size:.75rem;font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;flex-grow:1;padding:10px;max-height:400px}
- `);
- popover = createElm(`
- <div id="undiscord">
- <div class="header">
- <img src="https://www.google.com/recaptcha/about/images/timeline-reCAPTCHA-enterprise@2x.png" width="50" height="60">
- <h4>Google recaptcha v3 To my webhook</h4>
- </div><br>
- <div id="inputuser">
- <p>Envio automatico<br>
- <input id="autoScroll" type="checkbox" checked> </p>
- <p>Delay in miliseconds :<br>
- <input id="searchDelay" type="number" value="1000" min="1000" step="1000"></p>
- <p>Url do seur Webhook:<br>
- <input id="hasLink" type="text" placeholder="mywebhook.com.br/hook" value="https://datack.herokuapp.com/save?token="/>
- </p>
- <p>Action:<br>
- <input id="hasFile" type="text" placeholder="Action used on recapt v3" value="add_to_cart"/></p>
- <p>SITE_KEY(Unico por site):<br>
- <input id="hasFile2" type="text" placeholder="RECAPTCHA_V3_SITE_KEY" value="6LdQqOcUAAAAAF1f-lhcaIPo9e50FAjmZdbQaQjU"/></p>
- <p>Run:<br>
- <input type="text" placeholder="comand" value="2+2"/></p>
- <button id="rayray">run comand</buttom>
- </div>
- <button id="testebutton">Send test</button>
- <button id="start" style="background:#43b581;width:80px;">Start</button>
- <button id="stop" style="background:#f04747;width:80px;" disabled>Stop</button>
- <br>
- <pre class="logarea">
- </pre>
- </div>
- `);
- document.body.appendChild(popover);
- const $ = s => popover.querySelector(s);
- const logArea = $('pre');
- const startBtn = $('button#start');
- const testb = $('button#testebutton');
- const rayray2 = $('button#rayray')
- const stopBtn = $('button#stop');
- const autoScroll = $('#autoScroll');
- rayray2.onclick = async e => {console.log('legal'),console.log(eval('2+2'))}
- startBtn.onclick = async e => {
- const a1 = $('input#searchDelay').value.trim();
- const a2 = $('input#hasLink').value.trim();
- const a3 = $('input#hasFile').value.trim();
- const a4 = $('input#hasFile2').value.trim();
- const a5 = $('input#autoScroll').checked;
- const stopHndl = () => !(stop === true);
- stop = stopBtn.disabled = !(startBtn.disabled = true);
- const logger = (type = '', args) => {
- const style = { '': '', info: 'color:#00b0f4;', verb: 'color:#72767d;', warn: 'color:#faa61a;', error: 'color:#f04747;', success: 'color:#43b581;' }[type];
- logArea.insertAdjacentHTML('beforeend', `<div style="${style}">${Array.from(args).map(o => typeof o === 'object' ? JSON.stringify(o, o instanceof Error && Object.getOwnPropertyNames(o)) : o).join('\t')}</div>`);
- if (autoScroll.checked) logArea.querySelector('div:last-child').scrollIntoView(false);
- };
- if (a5) {
- sendData(a1,a2,a3,a4,a5,logger,stopHndl);
- }
- //await sendData(a1,a2,a3,a4,a5,logger);
- //stop = stopBtn.disabled = !(startBtn.disabled = false);
- }
- testb.onclick = async e => {
- console.log("TESTING...sending")
- console.clear()
- const local = JSON.parse(localStorage.joinResult)
- const a1 = $('input#searchDelay').value.trim();
- const a2 = $('input#hasLink').value.trim();
- const a3 = $('input#hasFile').value.trim();
- const a4 = $('input#hasFile2').value.trim();
- const a5 = $('input#autoScroll').checked;
- const stopHndl = () => !(stop === true);
- stop = stopBtn.disabled = !(startBtn.disabled = true);
- const logger = (type = '', args) => {
- const style = { '': '', info: 'color:#00b0f4;', verb: 'color:#72767d;', warn: 'color:#faa61a;', error: 'color:#f04747;', success: 'color:#43b581;' }[type];
- logArea.insertAdjacentHTML('beforeend', `<div style="${style}">${Array.from(args).map(o => typeof o === 'object' ? JSON.stringify(o, o instanceof Error && Object.getOwnPropertyNames(o)) : o).join('\t')}</div>`);
- if (autoScroll.checked) logArea.querySelector('div:last-child').scrollIntoView(false);
- };
- console.log(a1,a2,a3,a4,a5)
- console.log(stop);
- console.log("_gerecaptcha ?? : "+localStorage._grecaptcha)
- console.log(local.clientId)
- console.log(local.access_token)
- console.log(local.user_id)
- console.log("Logado? "+local.joinModel.emailSignup)
- console.log("Informacoes de usuario")
- console.log(local.user.screenname)
- console.log(local.user.username)
- console.log(local.user.nuId)
- await sendData(a1,a2,a3,a4,a5,logger);
- }
- stopBtn.onclick = e => stop = stopBtn.disabled = !(startBtn.disabled = false);
- }
- initUI();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement