File size: 4,922 Bytes
15f7aec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
const { connect } = require('puppeteer-real-browser');

async function createAutzAccountWithGmail() {
    console.log('Launching browser...');
    
    const { browser, page } = await connect({
        headless: 'auto',
        args: ['--no-sandbox', '--disable-setuid-sandbox'],
        turnstile: true
    });

    const testEmail = 'benneu40@gmail.com';

    try {
        console.log('\n=== STEP 1: Navigate to Autz.org ===');
        await page.goto('https://autz.org/onboarding/qinw2ix?callback_url=https%3A%2F%2Fmy.zone.id%2F', {
            waitUntil: 'networkidle2',
            timeout: 60000
        });
        
        console.log('Page loaded, waiting for content...');
        await new Promise(resolve => setTimeout(resolve, 3000));

        await page.screenshot({ path: 'gmail-step1.png', fullPage: true });
        console.log('Screenshot saved: gmail-step1.png');

        console.log('\n=== STEP 2: Enter Gmail address ===');
        const emailField = await page.$('input[type="email"]');
        if (emailField) {
            console.log(`Entering email: ${testEmail}`);
            await emailField.click();
            await new Promise(resolve => setTimeout(resolve, 500));
            await emailField.evaluate(el => el.value = '');
            await emailField.type(testEmail, { delay: 100 });
            await new Promise(resolve => setTimeout(resolve, 500));
            
            const enteredValue = await emailField.evaluate(el => el.value);
            console.log('Email field value:', enteredValue);
        }

        console.log('\n=== STEP 3: Wait for Turnstile captcha ===');
        console.log('Waiting for captcha to auto-solve...');
        
        let captchaSolved = false;
        for (let i = 0; i < 30; i++) {
            await new Promise(resolve => setTimeout(resolve, 1000));
            const html = await page.content();
            
            if (html.includes('Success') || html.includes('success')) {
                console.log('Captcha solved!');
                captchaSolved = true;
                await new Promise(resolve => setTimeout(resolve, 2000));
                break;
            }
            
            if (i % 5 === 0) {
                console.log(`Waiting for captcha... ${i + 1}/30`);
            }
        }

        await page.screenshot({ path: 'gmail-step2.png', fullPage: true });
        console.log('Screenshot saved: gmail-step2.png');

        console.log('\n=== STEP 4: Click Continue button ===');
        const allBtns = await page.$$('button');
        for (const btn of allBtns) {
            const text = await page.evaluate(el => el.textContent, btn);
            if (text && text.includes('Continue') && !text.includes('Google')) {
                console.log('Clicking Continue button...');
                
                await btn.focus();
                await new Promise(resolve => setTimeout(resolve, 300));
                await btn.click();
                console.log('Clicked via .click()');
                
                await new Promise(resolve => setTimeout(resolve, 1000));
                
                await page.keyboard.press('Enter');
                console.log('Pressed Enter key');
                break;
            }
        }

        console.log('Waiting for page to change...');
        for (let i = 0; i < 15; i++) {
            await new Promise(resolve => setTimeout(resolve, 1000));
            const text = await page.evaluate(() => document.body.innerText);
            if (text.includes('Password') || text.includes('password') || text.includes('code') || text.includes('verify')) {
                console.log('Page changed! New content detected.');
                break;
            }
            console.log(`Waiting... ${i + 1}/15`);
        }

        await page.screenshot({ path: 'gmail-step3.png', fullPage: true });
        console.log('Screenshot saved: gmail-step3.png');

        const pageText = await page.evaluate(() => document.body.innerText);
        console.log('\n--- Current page content ---');
        console.log(pageText.substring(0, 1500));

        console.log('\nCurrent URL:', page.url());

        if (pageText.includes('Password') && pageText.includes('Name')) {
            console.log('\n=== SUCCESS: Registration form detected! ===');
            console.log('The Gmail address worked - temp email domains were likely being blocked.');
        } else if (pageText.includes('code') || pageText.includes('verify')) {
            console.log('\n=== Verification step detected ===');
        } else {
            console.log('\n=== Page did not advance ===');
        }

    } catch (error) {
        console.error('Error:', error.message);
        await page.screenshot({ path: 'gmail-error.png', fullPage: true });
    } finally {
        await browser.close();
        console.log('\nBrowser closed.');
    }
}

createAutzAccountWithGmail();