]> source.dussan.org Git - rspamd.git/commitdiff
[Project] Lua_magic: Add more types
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Sep 2019 12:07:50 +0000 (13:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Sep 2019 12:07:50 +0000 (13:07 +0100)
lualib/lua_magic/heuristics.lua
lualib/lua_magic/patterns.lua
lualib/lua_magic/types.lua

index 60ff57224a8ba23b8d48a28c3fa2b7fe6f44d4fb..8469fa9f8e7964af44b53afee1f13488f9d0ba3b 100644 (file)
@@ -51,6 +51,7 @@ local zip_patterns = {
          [[mimetypeapplication/vnd\.oasis\.opendocument.formula]],
          [[mimetypeapplication/vnd\.oasis\.opendocument\.chart]]},
   odp = {[[mimetypeapplication/vnd\.oasis\.opendocument\.presentation]]},
+  epub = {[[epub\+zip]]}
 }
 
 -- Used to match pattern index and extension
@@ -236,6 +237,8 @@ local function detect_archive_flaw(part, arch, log_obj)
         res.docx = res.docx + 30
       elseif file:sub(1, 4) == 'ppt/' then
         res.pptx = res.pptx + 30
+      elseif file == 'META-INF/MANIFEST.MF' then
+        res.jar = res.jar + 40
       end
     end
 
index 87ed3c0e9c1a7df09f5b07c146324ad58da25c1c..630f287cefac9280aff11bf81cbfa54d8961e4dd 100644 (file)
@@ -224,6 +224,15 @@ local patterns = {
       },
     }
   },
+  xar = {
+    matches = {
+      {
+        string = [[xar!]],
+        relative_position = 0,
+        weight = 60,
+      },
+    }
+  },
   iso = {
     matches = {
       {
index e8e4e45e2e362726c4c240297e677caeb8fecd48..3ecd0575a4d429799da8da23ee44f2a4e97e07df 100644 (file)
@@ -105,6 +105,14 @@ local types = {
     ct = 'application/x-zoo',
     type = 'archive',
   },
+  xar = {
+    ct = 'application/x-xar',
+    type = 'archive',
+  },
+  epub = {
+    ct = 'application/x-epub',
+    type = 'archive'
+  },
   szdd = { -- in fact, their MSDOS extension is like FOO.TX_ or FOO.TX$
     ct = 'application/x-compressed',
     type = 'archive',