Phishing Prevention
Learn how to defend against phishing emails.
Some actions a defender can take to protect users from malicious emails:
Email Security (SPF, DKIM, DMARC)
SPAM Filters (flags or blocks incoming emails based on reputation)
Email Labels (alert users that an incoming email is from an outside source)
Email Address/Domain/URL Blocking (based on reputation or explicit denylist)
Attachment Blocking (based on the extension of the attachment)
Attachment Sandboxing (detonating email attachments in a sandbox environment to detect malicious activity)
Security Awareness Training (internal phishing campaigns)
Per MITRE ATT&CK Framework, Phishing is classified as Technique ID 1598 (T1598); the Mitigation section under Software Configuration:
What is the MITRE ID for Software Configuration?
M1054
SPF (Sender Policy Framework)
Sender Policy Framework is used to authenticate the sender of an email. ISPs (Internet service providers) can verify if a mail server is authorized to send email for a specific domain. An SPF record is a type of DNS TXT record containing a list of IP addresses allowed to send email via the domain.
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FkJA9YIU1LP3KNpNcVcIE%252Fimage.png%3Falt%3Dmedia%26token%3Dc16ef076-5dfd-470a-bd12-403d43f7b46d&width=768&dpr=4&quality=100&sign=79056a8a&sv=1)
How does a basic SPF record look like?
v=spf1 ip4:127.0.0.1 include:_spf.google.com -all
An explanation for the above record:
v=spf1
-> This is the start of the SPF recordip4:127.0.0.1
-> This specifies which IP (in this case version IP4 & not IP6) can send mailinclude:_spf.google.com
-> This specifies which domain can send mail-all
-> non-authorized emails will be rejected
Refer to the SPF Record Syntax on dmarcian here and here.
Refer to this resource on dmarcian on how to create your own SPF records.
What is the SPF rule to use if you wish to ensure an operator rejects emails without potentially discarding a legitimate email?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FBm5u5x06vZwWOKsrtRVP%252Fimage.png%3Falt%3Dmedia%26token%3Dbff19363-f429-447b-af9d-043f742ec0eb&width=768&dpr=4&quality=100&sign=f211e172&sv=1)
What is the meaning of the -all tag?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FA3GVuzBU3L4YB64voaNv%252Fimage.png%3Falt%3Dmedia%26token%3D5bf2a14e-6904-4cd1-8e88-8e1c0b7143f9&width=768&dpr=4&quality=100&sign=76af9542&sv=1)
DKIM (DomainKeys Identified Mail)
DKIM (DomainKeys Identified Mail) is used for authentication of an email being sent. DKIM is open standard for email authentication used for DMARC alignment. DKIM record exists in DNS with the advantage that is can survive forwarding, making it superior to SPF when securing email.
How does a DKIM record look like?
v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxTQIC7vZAHHZ7WVv/5x/qH1RAgMQI+y6Xtsn73rWOgeBQjHKbmIEIlgrebyWWFCXjmzIP0NYJrGehenmPWK5bF/TRDstbM8uVQCUWpoRAHzuhIxPSYW6k/w2+HdCECF2gnGmmw1cT6nHjfCyKGsM0On0HDvxP8I5YQIIlzNigP32n1hVnQP+UuInj0wLIdOBIWkHdnFewzGK2+qjF2wmEjx+vqHDnxdUTay5DfTGaqgA9AKjgXNjLEbKlEWvy0tj7UzQRHd24a5+2x/R4Pc7PF/y6OxAwYBZnEPO0sJwio4uqL9CYZcvaHGCLOIMwQmNTPMKGC9nt3PSjujfHUBX3wIDAQAB
An explanation of the above record:
v=DKIM1
-> This is the version of the DKIM record. This is optional.k=rsa
-> This is the key type. The default value is RSA. RSA is an encryption algorithm (cryptosystem).p=
-> This is the public key that will be matched to the private key, which was created during the DKIM setup process.
Refer to the DKIM resource here and here for additional information.
Which email header shows the status of whether DKIM passed or failed?
Authentication-Results
DMARC (Domain-Based Message Authentication, Reporting, and Conformance)
DMARC (Domain-Based Message Authentication, Reporting, and Conformance) uses alignment to tie the result of two other open source standards, SPF and DKIM, to the content of an email. Putting a DMARC record into place for a domain will give feedback allowing for troubleshooting SPF and DKIM configurations if needed.
How does a basic DMARC record look like?
v=DMARC1; p=quarantine; rua=mailto:postmaster@website.com
An explanation of the above record:
v=DMARC1
-> Must be in all caps, and it's not optionalp=quarantine
-> If a check fails, then an email will be sent to the spam folder (DMARC Policy)rua=mailto:postmaster@website.com
-> Aggregate reports will be sent to this email address
Refer to the DMARC resources here and here for additional information on DMARC tags. Review the following resource about DMARC Alignment.
Using the Domain Health Checker from dmarcian.com, check the DMARC status of microsoft.com.
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FkV0em0RedSdroqE9VDpQ%252Fimage.png%3Falt%3Dmedia%26token%3D16e8a8fe-3b93-4eec-930f-d30da2d21ec6&width=768&dpr=4&quality=100&sign=cfaff125&sv=1)
All emails that fail the DMARC check will be rejected.
Which DMARC policy would be used to not accept an email if the message fails the DMARC check?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252F1niFfnhXHuHIT4Nqyhrl%252Fimage.png%3Falt%3Dmedia%26token%3D3f5cd96b-ebd5-4de2-b218-56cc6c4b793f&width=768&dpr=4&quality=100&sign=8078df8d&sv=1)
S/MIME (Secure/Multipurpose Internet Mail Extensions)
S/MIME (Secure/Multipurpose internet Mail Extensions) is a protocol for sending digitally signed and encrypted messages.
Using Public Key Cryptography, S/MIME guarantees data integrity and nonrepudiation.
If Bob wishes to use S/MIME, then he'll need a digital certificate. This digital certificate will contain his public key.
With this digital certificate, Bob can "sign" the email message with his private key.
Mary can then decrypt Bob's message with Bob's public key.
Mary will do the same (send her certificate to Bob) when she replies to his email, and Bob complete the same process on his end.
Both will now have each other's certificates for future correspondence.
Refer to this Microsoft documentation here for more information on S/MIME and steps on how to configure Office 365 to send/receive S/MIME emails.
What is nonrepudiation?
The uniqueness of a signature prevents the owner of the signature from disowning the signature.
SMTP Status Codes
Examining the PCAP file with SMTP traffic, focusing on SMTP codes:
What Wireshark filter can you use to narrow down the packet output using SMTP status codes?
smtp.response.code
Per the network traffic, what was the message for status code 220? (Do not include the status code (220) in the answer)
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252F9hUB2utka16QDihvwFMV%252Fimage.png%3Falt%3Dmedia%26token%3D1149c7db-b411-4e34-8e54-95e719a8aaf5&width=768&dpr=4&quality=100&sign=e91147f3&sv=1)
One packet shows a response that an email was blocked using spamhaus.org. What were the packet number and status code? (no spaces in your answer)
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FEc1r2u9hDServnQVc7fw%252Fimage.png%3Falt%3Dmedia%26token%3Db8380520-8eab-4e39-af65-8d5a6787eb8c&width=768&dpr=4&quality=100&sign=de9a860&sv=1)
Based on the packet from the previous question, what was the message regarding the mailbox?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FA8eTYrdFbY2ksSG4sQE0%252Fimage.png%3Falt%3Dmedia%26token%3Dd6cf5ad3-be4f-44e4-b602-e5c74fd7c3c0&width=768&dpr=4&quality=100&sign=4ba2ed31&sv=1)
What is the status code that will typically precede a SMTP DATA command?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FIQGbUM9Y2kY4Wa8rmM6T%252Fimage.png%3Falt%3Dmedia%26token%3D94c64c71-a8b0-4d19-b547-28f4c86a9f8d&width=768&dpr=4&quality=100&sign=3f7d2bf8&sv=1)
SMTP Traffic Analysis
Analyze trivial SMTP traffic.
What port is the SMTP traffic using?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252F0EyxLJRUpsdjNWJQSjNi%252Fimage.png%3Falt%3Dmedia%26token%3D2908f034-6853-4917-a70f-36e8c0dcf063&width=768&dpr=4&quality=100&sign=627ea9a&sv=1)
How many packets are specifically SMTP?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FlOMJshebNmJY5Kyi34DU%252Fimage.png%3Falt%3Dmedia%26token%3Da854602a-ba86-4fd5-bc23-886ac2186542&width=768&dpr=4&quality=100&sign=68e23aad&sv=1)
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FcmCwkBwG2ZLmJ4kPgaev%252Fimage.png%3Falt%3Dmedia%26token%3D07828555-c464-43dc-82d6-661eaef94f9d&width=768&dpr=4&quality=100&sign=387de9c3&sv=1)
What is the source IP address for all the SMTP traffic?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FTUDHEiGpSmG4181NcOqx%252Fimage.png%3Falt%3Dmedia%26token%3D2f71913c-ca96-47db-9530-e84bfd2c2570&width=768&dpr=4&quality=100&sign=2b2849d1&sv=1)
What is the filename of the third file attachment?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FO1ggCTLYJPHzVn286Ux1%252Fimage.png%3Falt%3Dmedia%26token%3Ded3e6cd0-b107-4364-a1eb-5add50ea8b39&width=768&dpr=4&quality=100&sign=a27df7fb&sv=1)
How about the last file attachment?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FuuyHOrztYQSjBMFazuqx%252Fimage.png%3Falt%3Dmedia%26token%3D1535b3ec-3abb-434c-8655-6a767a424247&width=768&dpr=4&quality=100&sign=dafbedad&sv=1)
SMTP and C&C Communication
SMTP has been abused by adversaries for C2 (Command and Control) communications.
MITRE ATT&CK:
Technique 1071 > Sub-Technique 3: https://attack.mitre.org/techniques/T1071/003/
Per MITRE, "Adversaries may communicate using application layer protocols associated with electronic mail delivery to avoid detection/network filtering by blending in with existing traffic. Commands to the remote system, and often the results of those commands, will be embedded within the protocol traffic between the client and server."
Several notable groups, such as APT 28, APT 32, and Turla, to name a few, have used this technique.
Recommended mitigation (per MITRE):
"Network intrusion detection and prevention systems that use network signatures to identify traffic for specific adversary malware can be used to mitigate activity at the network level."
Detection opportunity (per MITRE):
"Analyze packet contents to detect application layer protocols that do not follow the expected protocol standards regarding syntax, structure, or any other variable adversaries could leverage to conceal data."
Per MITRE ATT&CK, which software is associated with using SMTP and POP3 for C2 communications?
![](https://jacob-taylor.gitbook.io/~gitbook/image?url=https%3A%2F%2F309112325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdUCUPJ7E8b7n8AB8j3ms%252Fuploads%252FKXL5WC2RAG6iYcO9IKM8%252Fimage.png%3Falt%3Dmedia%26token%3Df014f523-b90a-44a8-ad6d-3b7cf3b8269c&width=768&dpr=4&quality=100&sign=b2f8f983&sv=1)
Conclusion
Phishing incident response playbook is a defined process that should be followed in a specific phishing incident.
Phishing IR Playbook:
Per the playbook, what framework was used for the IR process?
NIST
Last updated