Lesson 7 of 10
Social Engineering in Penetration Testing
Social engineering tests the human element of security - the most exploited attack vector. An organization that has excellent technical controls can still be completely compromised if an employee can be convinced to click a link, reveal a password, or open a door.
Social Engineering Attack Types in Pentesting
- Phishing simulation: Send realistic phishing emails to employees, track who clicks, who enters credentials. Use GoPhish (open source). Results show training effectiveness and identify users requiring additional awareness training
- Spear phishing: Targeted attack using OSINT about specific individuals - reference recent events, their manager's name, their position. Far higher success rate than generic phishing
- Vishing (phone calls): Call the help desk impersonating an executive or a vendor - request a password reset, access to a system, or sensitive information. Tests whether call center follows verification procedures
- Physical security: Attempt to enter premises as a repair person, delivery driver, or new employee. Test whether badge access is enforced and whether tailgating occurs
- USB drops: Leave infected USB drives in the parking lot or lobby - test whether employees plug in unknown USB drives. USB attacks can deploy payloads when the drive is plugged in
GoPhish - Phishing Campaign Setup
# GoPhish - Open source phishing simulation platform
# Download from getgophish.com; must have client authorization in scope
# GoPhish components:
# Sending Profile: SMTP configuration for sending emails
# Email Template: The phishing email (impersonate IT, HR, cloud provider)
# Landing Page: Credential capture or payload delivery page
# User Group: List of target email addresses
# Sample phishing email template (IT password reset):
Subject: [ACTION REQUIRED] Your account will be suspended in 24 hours
From: IT Security <it-security@company-it-support.com>
Dear {{.FirstName}},
Our systems have detected unusual login activity on your account.
To secure your account, please verify your credentials immediately:
→ Click here to verify: {{.URL}}
If you do not verify within 24 hours, your account will be suspended.
IT Security Team
# GoPhish captures:
# - Who opened the email (tracking pixel)
# - Who clicked the link
# - Who submitted credentials
# What to report:
# Click rate: % who clicked (industry average ~15-25%)
# Credential submission rate: % who entered credentials
# Reporting rate: % who reported the email to security team
# Time-to-click: How quickly do employees click?Defending Against Social Engineering
- Security awareness training: Regular training (minimum quarterly), simulated phishing campaigns, clear reporting channel
- Verification procedures: Help desk must verify caller identity through pre-shared PIN or callback to known-good number - never reset passwords for unverified callers
- Email authentication (SPF, DKIM, DMARC): Makes spoofing your domain much harder; DMARC reject policy prevents unauthorized senders from impersonating your domain
- Phishing-resistant MFA: FIDO2/hardware keys prevent credential submission phishing from being useful - even with captured credentials, attacker cannot authenticate without the physical key
- Physical security: Clear badge policy, tailgating education, visitor check-in with escort requirements
Common Mistakes
- Running phishing campaigns without HR and legal approval - employees react poorly to being 'caught'; ensure proper internal communication and approval process
- Shaming employees who fail simulations - counterproductive; focus on training and building a blame-free reporting culture
- Only doing annual phishing training - threatscape changes continuously; quarterly training with monthly simulations is more effective
Tip
Tip
Practice Social Engineering in Penetration Testing in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.
The foundational security model: Confidentiality (privacy), Integrity (trust), and Availability (uptime).
Practice Task
Note
Practice Task - (1) Write a working example of Social Engineering in Penetration Testing from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.
Quick Quiz
Common Mistake
Warning
A common mistake with Social Engineering in Penetration Testing is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready cybersecurity code.
Key Takeaways
- Social engineering tests the human element of security - the most exploited attack vector.
- Phishing simulation: Send realistic phishing emails to employees, track who clicks, who enters credentials. Use GoPhish (open source). Results show training effectiveness and identify users requiring additional awareness training
- Spear phishing: Targeted attack using OSINT about specific individuals - reference recent events, their manager's name, their position. Far higher success rate than generic phishing
- Vishing (phone calls): Call the help desk impersonating an executive or a vendor - request a password reset, access to a system, or sensitive information. Tests whether call center follows verification procedures
Finished this lesson?