> For the complete documentation index, see [llms.txt](https://gr33namow.gitbook.io/pts-v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gr33namow.gitbook.io/pts-v2/pts-v2/3.-host-and-network-penetration-testing/social-engineering.md).

# Social Engineering

<mark style="color:red;">**Social engineering**</mark> refers to the manipulation and exploitation of human psychology and trust to deceive individuals or gain unauthorized access to systems, networks, or sensitive information.

<mark style="color:yellow;">People are easily manipulated through:</mark>

* Impersonation
* pretexting
* emotional pull
* urgency
* free stuff
* blackmail/extortion
* quid pro quo

<mark style="color:yellow;">Common tactics</mark>

* phishing
* watering hole
* baiting (leaving around USB pen drives, people are curious to check what they hold, so they plug them into their pcs)
* physical access

<mark style="color:yellow;">How to prevent these attacks?</mark>

1. **user awareness and training**
2. **security controls**, which are enabled by user awareness (if people know they can be manipulated and how, there's a higher chance they can spot these attempts and report them)
3. **defense in depth**: the right privileges granted to a user and proper defense mechanisms as firewall or proxies, can minimize the dameges.

## <mark style="color:yellow;">Phishing</mark>

The most common social engineering attack is <mark style="color:red;">**phishing**</mark>, that usually uses a malicious email as vector and aims to retrieve sensitive information from the target by asking him/her to

* reply with information
* click on links
* download and open files

Types of phishing:

* **spear phishing**: phishing targeted on a specific set of people (e.g. a company's employees)
* **whaling**: a spear phishing that targets high-value individuals
* **smishing**: phishing via SMS
* **vishing**: phishing via voice calls

Phishing techniques:

* **Pharming**: focuses on redirecting individual users to fake websites without their knowledge
* **Watering hole**: exploit a vulnerability found in a legitimate website to target a specific group of users who visit that site
* **BCE (Business Email Compromise)**: phishing attack from a legitimate email address which has been compromised
* **Impersonification/spoofing**: pretending to be someone/something you're not (e.g. a manager or a known website)

### <mark style="color:orange;">Gophish</mark> :fishing\_pole\_and\_fish:

<mark style="color:red;">**Gophish**</mark> is a tool designed to setup phishing campaigns.

1. Setup the **sending profile**

<figure><img src="https://3318581477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiKedx5CbZkxLBjkV6R9R%2Fuploads%2FjJnWdzeVfxEOq834V6w6%2Fimage.png?alt=media&amp;token=5cfbec20-be48-4c7f-afbf-fa2a4bf3bc4e" alt=""><figcaption></figcaption></figure>

After configuring the sending profile accordingly, we can test the configuration by clicking on the **Send Test Email** button as shown in the following screenshot.

<img src="https://assets.ine.com/content/ptp/AlexisAhmed/VOD-4379/LAB-3874/10.png" alt="10" width="563">

This will prompt you to specify the details of the recipient, in this case we will be sending the test email to **<victim@demo.ine.local>** whose mailbox has already been configured in Thunderbird.

<img src="https://assets.ine.com/content/ptp/AlexisAhmed/VOD-4379/LAB-3874/11.png" alt="11" width="563">

2. Setup the **landing page**

<figure><img src="https://3318581477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiKedx5CbZkxLBjkV6R9R%2Fuploads%2F6xviILarVqS39twL2rae%2Fimage.png?alt=media&amp;token=f65bce9b-9926-4add-a22f-c77a80073c3e" alt=""><figcaption></figcaption></figure>

This will be the page the victim lands on after clicking the link in the email.

You can create a html page or import one you already have (1).

You can choose to capture submitted data (2), which you wanna do if you're asking the victim for something like a password reset.

3. Create an **email template**

<figure><img src="https://3318581477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiKedx5CbZkxLBjkV6R9R%2Fuploads%2FxgZDybpICTzLggvLx970%2Fimage.png?alt=media&amp;token=28234722-0dc5-4403-8250-bcf23ddbec95" alt=""><figcaption></figcaption></figure>

4. Setup the **user** list

<figure><img src="https://3318581477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiKedx5CbZkxLBjkV6R9R%2Fuploads%2FaWcOHDdAKy2eD5S4ePsY%2Fimage.png?alt=media&amp;token=38b7c57a-2c52-446d-9c48-05f637b4e28d" alt=""><figcaption></figcaption></figure>

5. Create and launch the **campaign**

<figure><img src="https://3318581477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiKedx5CbZkxLBjkV6R9R%2Fuploads%2F08OX6O6EqRBSiNjP5WS2%2Fimage.png?alt=media&amp;token=0725a8e3-52a8-458c-8999-be995625a18b" alt=""><figcaption></figcaption></figure>

Here you need to choose the various settings you setup before, then launch the campaign.

Launching the campaign will redirect you to the campaign dashboard that will provide you with a summary of statistics pertinent to the phishing campaign.

<img src="https://assets.ine.com/content/ptp/AlexisAhmed/VOD-4379/LAB-3874/27.png" alt="27" width="563">

We can check the emails sent to the target email by opening up the Thunderbird email client.
