# Integration of two Puppeteer + Evilginx

**Installing Puppeteer**\
**Install Node.js:**

*<mark style="color:red;">Go to the official Node website.js and download the installer for your operating system. Install it by following the instructions.</mark>*

**Creating a new project:**

*Open a terminal or command prompt and run the following commands:*

```
mkdir my-puppeteer-project
cd my-puppeteer-project
npm init -y
```

**Installing Puppeteer:**\
\&#xNAN;*Install Puppeteer using npm:*

```
npm install puppeteer
```

<mark style="color:red;">**The main functions of Puppeteer**</mark>\
\&#xNAN;*Here are some basic features that you can use with Puppeteer:*

* Launching the browser:

```
const browser = await puppeteer.launch({ headless: false }); 
```

* Creating a new page:

```
const page = await browser.newPage();
```

* Navigation to the page:

```
await page.goto('https://example.com');
```

* Screenshots

```
await page.screenshot({ path: 'screenshot.png' });
```

* Data extraction:

```
const title = await page.title();
console.log(title);
```

* Filling out forms:

```
await page.type('#username', 'your-username');
await page.type('#password', 'your-password');
await page.click('#submit-button');
```

* Waiting for the elements:

```
await page.waitForSelector('#element-id');
```

* Closing the browser:

```
await browser.close();
```

<mark style="color:red;">**Example of a script that automates logging in to the site and takes a screenshot of the page after logging in:**</mark>

```
const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({ headless: false });
    const page = await browser.newPage();
    await page.goto('https://example.com/login');
    await page.type('#username', 'your-username');
    await page.type('#password', 'your-password');
    await page.click('#submit-button');
    await page.waitForNavigation();
    await page.screenshot({ path: 'after-login.png' });
    await browser.close();
})();
```

<mark style="color:red;">This will allow you to automate actions in the browser. Your script can interact with Evilginx by sending requests through its proxy.</mark>

```
const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({
        headless: false, 
        args: ['--proxy-server=http://localhost:8080'] ## Your addrees proxy Evilginx
    });

    const page = await browser.newPage();

    ## Your phishing link Evilginx
    await page.goto('http://your-evilginx-domain.com');

 ## Add additional actions here
## For example: filling out a form, clicking on links, etc.

    await browser.close();
})();
```

**Writing a script should be tailored to your configurations, this is just an example.**

<figure><img src="https://camo.githubusercontent.com/b49a6205609db1a4eb586408a337381aae5a64b07238882c2a08569b1573bd1f/68747470733a2f2f692e737374617469632e6e65742f56703263452e706e67" alt=""><figcaption></figcaption></figure>

<mark style="color:red;">**Testing**</mark>

Run the script and check if it interacts with Evilginx correctly and performs the actions you set.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rproxylab.gitbook.io/evilginx-lab-by-cfs0x/integration-of-two-puppeteer-+-evilginx.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
