Mail Agent
Analyze email messages for security threats including phishing, malware, and social engineering.
Overview
Agent Name: MailAgent
Scan Type: mail
Credit Cost: 1 credit
Target Types: Email files (.eml, .msg), email headers, attachments
Capabilities
- Phishing detection
- Malicious attachment analysis
- Email header analysis
- SPF/DKIM/DMARC validation
- Link safety checking
- Sender reputation analysis
- Social engineering detection
- Spoofing identification
Usage
# Analyze email file
alprina scan ./suspicious-email.eml --type mail
# Scan multiple emails
alprina scan ./inbox/*.eml --type mail
# API usage
curl -X POST https://api.alprina.com/v1/scan/email-report \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"target": "./email.eml",
"options": {
"check_links": true,
"check_attachments": true,
"check_headers": true
}
}'What It Analyzes
Email Headers
- SPF (Sender Policy Framework)
- DKIM (DomainKeys Identified Mail)
- DMARC (Domain-based Message Authentication)
- Reply-To mismatches
- Received headers
- Authentication results
Content Analysis
- Phishing indicators
- Urgency tactics
- Social engineering techniques
- Impersonation attempts
- Grammar/spelling anomalies
- Brand impersonation
Links & Attachments
- URL reputation
- Shortened link expansion
- Attachment file types
- Macro detection
- Malware signatures
Example Output
{
"scan_id": "scan_mail909",
"findings": [
{
"severity": "critical",
"category": "phishing",
"title": "Phishing Email Detected",
"description": "Email impersonates legitimate sender with malicious link",
"indicators": {
"sender_mismatch": true,
"suspicious_link": "http://evil-site.com/fake-login",
"urgency_language": "Account will be closed in 24 hours",
"spf_fail": true
},
"recommendation": "Block sender, delete email, report to security team"
},
{
"severity": "high",
"category": "malicious_attachment",
"title": "Suspicious Macro-Enabled Document",
"description": "Excel file contains obfuscated VBA macros",
"attachment": "invoice.xlsm",
"recommendation": "Do not open attachment. Macros may contain malware"
}
],
"email_analysis": {
"from": "admin@examp1e.com",
"subject": "Urgent: Verify Your Account",
"spf": "fail",
"dkim": "fail",
"dmarc": "fail",
"suspicious_score": 95
}
}Phishing Indicators
Common Red Flags
-
Sender Spoofing
Display: "Microsoft Security <security@microsoft.com>" Actual: "attacker@evil.com" -
Urgency Tactics
- “Act now or account will be closed”
- “Verify within 24 hours”
- “Immediate action required”
-
Suspicious Links
Display text: "https://paypal.com/verify" Actual link: "http://paypa1.com/phishing" -
Authentication Failures
- SPF: fail
- DKIM: fail
- DMARC: fail
-
Grammar & Spelling
- Poor grammar
- Unusual phrasing
- Spelling errors in official emails
Link Analysis
URL Safety Checks
{
"url": "https://bit.ly/abc123",
"expanded_url": "http://malicious-site.com/phishing",
"reputation": "malicious",
"categories": ["phishing", "malware"],
"safety": "unsafe"
}Link Patterns
Safe:
https://accounts.google.com/signin
https://www.paypal.com/us/signinSuspicious:
http://g00gle.com/signin (homoglyph attack)
https://paypal-security.com (typosquatting)
https://192.168.1.1/phishing (IP address)Attachment Analysis
Risky File Types
- Executables: .exe, .scr, .com, .bat
- Scripts: .vbs, .js, .ps1, .sh
- Office Macros: .docm, .xlsm, .pptm
- Archives: .zip, .rar (may contain malware)
- Shortcuts: .lnk, .url
Safe Handling
# Never open suspicious attachments directly
# Use sandbox environment or Alprina analysis first
alprina scan ./attachment.docm --type mailAuthentication Validation
SPF Check
Pass:
Received-SPF: pass (google.com: domain of sender@example.com designates 1.2.3.4 as permitted sender)Fail:
Received-SPF: fail (google.com: domain of sender@example.com does not designate 5.6.7.8 as permitted sender)DKIM Check
Pass:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com...
Authentication-Results: dkim=passDMARC Check
Policy:
DMARC: p=reject; pct=100; rua=mailto:dmarc@example.comBest Practices
1. Email Security Training
Teach users to:
- Verify sender before clicking links
- Check for authentication failures
- Report suspicious emails
- Never share credentials via email
2. Automated Scanning
# Scan all incoming emails
for email in inbox:
result = alprina.scan(email, type="mail")
if result.suspicious_score > 80:
quarantine(email)
alert_security_team(result)3. Response Procedures
When phishing detected:
- Quarantine email
- Alert affected users
- Block sender domain
- Report to authorities
- Update email filters
Integration Examples
Email Gateway Integration
# Integrate with email gateway
def scan_incoming_email(email):
result = alprina.scan(email, type="mail")
if result.severity in ["critical", "high"]:
return "reject"
elif result.suspicious_score > 70:
return "quarantine"
else:
return "deliver"SOC Alert Integration
# Send high-risk emails to SOC
if result.severity == "critical":
siem.create_alert({
"type": "phishing_detected",
"subject": email.subject,
"from": email.from_address,
"indicators": result.indicators
})Compliance
Helps meet:
- DMARC Compliance - Email authentication
- Anti-Phishing Training - SOC 2, ISO 27001
- Incident Response - Email threat detection
Related
Last updated on