Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False Positives - PDF Trailer Rule (invalid_trailer_structure) #431

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions maldocs/Maldoc_PDF.yar
Original file line number Diff line number Diff line change
Expand Up @@ -285,20 +285,20 @@ rule invalid_XObject_js : PDF raw
rule invalid_trailer_structure : PDF raw
{
meta:
author = "Glenn Edwards (@hiddenillusion)"
version = "0.1"
author = "Glenn Edwards (@hiddenillusion), @malvidin"
version = "0.2"
weight = 1

strings:
$magic = { 25 50 44 46 }
// Required for a valid PDF
$reg0 = /trailer\r?\n?.*\/Size.*\r?\n?\.*/
$reg1 = /\/Root.*\r?\n?.*startxref\r?\n?.*\r?\n?%%EOF/

condition:
$magic in (0..1024) and not $reg0 and not $reg1
strings:
$magic = "%PDF" // Required for a valid PDF
$reg0 = /trailer[ \r\n]*<<.{0,1000}\/Size\b/s
$reg1 = /\/Root\b.{0,1000}[ \r\n]*.{0,500}startxref[ \r\n]*.{0,500}[ \r\n]*%%EOF/s

condition:
$magic in (0..1024) and not ($reg0 or $reg1)
}


rule multiple_versions : PDF raw
{
meta:
Expand Down