]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Lua_magic: Add types for .jar and for .apk
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2019 11:57:33 +0000 (12:57 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2019 11:57:48 +0000 (12:57 +0100)
lualib/lua_magic/heuristics.lua
lualib/lua_magic/types.lua

index 8fb83bb0d619a6a986c262112bae0ec6e359092a..70093205119dfaaba1179c579e459c6ab76b8b9c 100644 (file)
@@ -244,7 +244,8 @@ local function detect_archive_flaw(part, arch, log_obj)
     jar = 0,
     odt = 0,
     odp = 0,
-    ods = 0
+    ods = 0,
+    apk = 0,
   } -- ext + confidence pairs
 
   -- General msoffice patterns
@@ -268,6 +269,8 @@ local function detect_archive_flaw(part, arch, log_obj)
         res.pptx = res.pptx + 30
       elseif file == 'META-INF/MANIFEST.MF' then
         res.jar = res.jar + 40
+      elseif file == 'AndroidManifest.xml' then
+        res.apk = res.apk + 60
       end
     end
 
index 2b2545d872818cf92492b726affc83d4eb87424d..5626b3445faddedf8b09c2686f8d341b64da6c23 100644 (file)
@@ -39,6 +39,14 @@ local types = {
     ct = 'application/x-java-applet',
     type = 'executable',
   },
+  jar = {
+    ct = 'application/java-archive',
+    type = 'archive',
+  },
+  apk = {
+    ct = 'application/vnd.android.package-archive',
+    type = 'archive',
+  },
   -- text
   rtf = {
     ct = "application/rtf",