Attachment: Encrypted PDF with credential theft body

Attached PDF is encrypted, and email body contains credential theft language. Seen in-the-wild impersonating e-fax services.

Sublime rule (View on GitHub)

  1name: "Attachment: Encrypted PDF with credential theft body"
  2description: "Attached PDF is encrypted, and email body contains credential theft language. Seen in-the-wild impersonating e-fax services."
  3type: "rule"
  4severity: "medium"
  5source: |
  6  type.inbound
  7  and any(filter(attachments, .file_type == "pdf"),
  8          any(file.explode(.),
  9              any(.scan.exiftool.fields, .key == "Encryption")
 10              or (
 11                .scan.entropy.entropy > 7
 12                and any(.scan.strings.strings, strings.icontains(., "/Encrypt"))
 13              )
 14          )
 15          and (
 16            // Encrypted PDFs do not have child nodes with any data
 17            all(filter(file.explode(.), .depth > 0), .size == 0)
 18            // if we cracked the password, it will have child objects
 19            or (
 20              any(file.explode(.), 'pdf_encryption_dict' in .flavors.yara)
 21              and any(file.explode(.),
 22                      .scan.encrypted_pdf.cracked_password is not null
 23              )
 24            )
 25          )
 26  )
 27  and (
 28    any(ml.nlu_classifier(body.current_thread.text).intents,
 29        .name == "cred_theft" and .confidence in ("medium", "high")
 30    )
 31    or any(ml.nlu_classifier(beta.ocr(file.message_screenshot()).text).intents,
 32           .name == "cred_theft" and .confidence in ("medium", "high")
 33    )
 34    or regex.icontains(body.current_thread.text,
 35                       'PDF\s*(?:Access|Preview|Unlock|Decrypt|pass(?:code|word))',
 36                       '(Access|Preview|Unlock|Decrypt|Pass)\s*(?:word|code)\s*(?:\S+\s+){0,3}PDF\s*is?\s*:',
 37                       'Th(?:is|e)\s+(?:file|document|pdf)\s+is\s+(?:pin|password)[-\s]?\s*protected[[:punct:]]\s*The\s+p(?:in|assword)\s+is\s*:?',
 38                       '(?:Access|Preview|Unlock|Decrypt)\s+(?:\S+\s+){0,3}(?:PDF|statement)(?:\S+\s+){0,3}(?:pass(?:word|code)|\s*with\s+\S+)',
 39                       'The\s+(?:file|document|pdf|attachment)\s+(?:pass(?:code|word)|access\s*code)\s+is\s*'
 40    )
 41    or (
 42      (
 43        length(body.current_thread.text) <= 10
 44        or (body.current_thread.text is null)
 45      )
 46      and any(body.previous_threads,
 47              regex.icontains(.text,
 48                              'PDF\s*(?:Access|Preview|Unlock|Decrypt|pass(?:code|word))',
 49                              '(Access|Preview|Unlock|Decrypt|Pass)\s*(?:word|code)\s*(?:\S+\s+){0,3}PDF\s*is?\s*:',
 50                              'Th(?:is|e)\s+(?:file|document|pdf)\s+is\s+(?:pin|password)[-\s]?\s*protected[[:punct:]]\s*The\s+p(?:in|assword)\s+is\s*:?',
 51                              '(?:Access|Preview|Unlock|Decrypt)\s+(?:\S+\s+){0,3}(?:PDF|statement)(?:\S+\s+){0,3}(?:pass(?:word|code)|\s*with\s+\S+)',
 52                              'The\s+(?:file|document|pdf|attachment)\s+(?:pass(?:code|word)|access\s*code)\s+is\s*'
 53              )
 54      )
 55    )
 56  )
 57  // not forwards/replies
 58  and not (
 59    (length(headers.references) > 0 or headers.in_reply_to is not null)
 60    and (subject.is_forward or subject.is_reply)
 61    and length(body.previous_threads) >= 1
 62  )
 63  and (
 64    (
 65      profile.by_sender_email().prevalence in ("new", "outlier")
 66      and not profile.by_sender_email().solicited
 67    )
 68    or (
 69      profile.by_sender_email().any_messages_malicious_or_spam
 70      and not profile.by_sender_email().any_messages_benign
 71    )
 72    or (
 73      length(recipients.to) == 0
 74      or all(recipients.to,
 75             strings.ilike(.display_name, "undisclosed?recipients")
 76      )
 77    )
 78    or (
 79      length(recipients.to) == 1
 80      and any(recipients.to, .email.email == sender.email.email)
 81    )
 82  )
 83  // negate highly trusted sender domains unless they fail DMARC authentication
 84  and (
 85    (
 86      sender.email.domain.root_domain in $high_trust_sender_root_domains
 87      and not headers.auth_summary.dmarc.pass
 88    )
 89    or sender.email.domain.root_domain not in $high_trust_sender_root_domains
 90  )  
 91attack_types:
 92  - "Credential Phishing"
 93tactics_and_techniques:
 94  - "Encryption"
 95  - "Evasion"
 96  - "PDF"
 97  - "Social engineering"
 98detection_methods:
 99  - "Content analysis"
100  - "Exif analysis"
101  - "File analysis"
102  - "Natural Language Understanding"
103  - "Sender analysis"
104id: "c9596c9a-0465-5364-8523-542e6d25a8f7"
to-top