|
15 | 15 | { :format => "exe-only", :arch => "x86", :file_fp => /PE32 / },
|
16 | 16 | { :format => "exe-only", :arch => "x64", :file_fp => /PE32\+ / },
|
17 | 17 | { :format => "exe-only", :arch => "x86_64", :file_fp => /PE32\+ / },
|
| 18 | + { :format => "vbs", :arch => "x86", :file_fp => /ASCII/ }, |
| 19 | + { :format => "vbs", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 20 | + { :format => "loop-vbs", :arch => "x86", :file_fp => /ASCII/ }, |
| 21 | + { :format => "loop-vbs", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 22 | + { :format => "asp", :arch => "x86", :file_fp => /ASCII/ }, |
| 23 | + { :format => "asp", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 24 | + { :format => "aspx", :arch => "x86", :file_fp => /ASCII/ }, |
| 25 | + { :format => "aspx", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 26 | + { :format => "vba", :arch => "x86", :file_fp => /ASCII/ }, |
| 27 | + { :format => "vba", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 28 | + { :format => "vba-exe", :arch => "x86", :file_fp => /ASCII/ }, |
| 29 | + { :format => "vba-exe", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 30 | + { :format => "psh", :arch => "x86", :file_fp => /ASCII/ }, |
| 31 | + { :format => "psh", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 32 | + { :format => "psh-net", :arch => "x86", :file_fp => /ASCII/ }, |
| 33 | + { :format => "psh-net", :arch => "x86_64", :file_fp => /ASCII/ }, |
| 34 | + { :format => "war", :arch => "x86", :file_fp => /Zip/ }, |
| 35 | + { :format => "war", :arch => "x86_64", :file_fp => /Zip/ }, |
18 | 36 | ],
|
19 | 37 | "linux" => [
|
20 | 38 | { :format => "elf", :arch => "x86", :file_fp => /ELF 32.*SYSV/ },
|
21 | 39 | { :format => "elf", :arch => "x64", :file_fp => /ELF 64.*SYSV/ },
|
22 | 40 | { :format => "elf", :arch => "armle", :file_fp => /ELF 32.*ARM/ },
|
23 | 41 | { :format => "elf", :arch => "mipsbe", :file_fp => /ELF 32-bit MSB executable, MIPS/ },
|
24 | 42 | { :format => "elf", :arch => "mipsle", :file_fp => /ELF 32-bit LSB executable, MIPS/ },
|
| 43 | + { :format => "war", :arch => "x86", :file_fp => /Zip/ }, |
| 44 | + { :format => "war", :arch => "x64", :file_fp => /Zip/ }, |
| 45 | + { :format => "war", :arch => "armle", :file_fp => /Zip/ }, |
| 46 | + { :format => "war", :arch => "mipsbe", :file_fp => /Zip/ }, |
| 47 | + { :format => "war", :arch => "mipsle", :file_fp => /Zip/ }, |
25 | 48 | ],
|
26 | 49 | "bsd" => [
|
27 | 50 | { :format => "elf", :arch => "x86", :file_fp => /ELF 32.*BSD/ },
|
| 51 | + { :format => "war", :arch => "x86", :file_fp => /Zip/ }, |
28 | 52 | ],
|
29 | 53 | "solaris" => [
|
30 | 54 | { :format => "elf", :arch => "x86", :file_fp => /ELF 32/ },
|
| 55 | + { :format => "war", :arch => "x86", :file_fp => /Zip/ }, |
31 | 56 | ],
|
32 | 57 | "osx" => [
|
33 | 58 | { :format => "macho", :arch => "x86", :file_fp => /Mach-O.*i386/ },
|
34 | 59 | { :format => "macho", :arch => "x64", :file_fp => /Mach-O 64/ },
|
35 | 60 | { :format => "macho", :arch => "armle", :file_fp => /Mach-O.*(acorn|arm)/ },
|
36 | 61 | { :format => "macho", :arch => "ppc", :file_fp => /Mach-O.*ppc/ },
|
| 62 | + { :format => "war", :arch => "x86", :file_fp => /Zip/ }, |
| 63 | + { :format => "war", :arch => "x64", :file_fp => /Zip/ }, |
| 64 | + { :format => "war", :arch => "armle", :file_fp => /Zip/ }, |
| 65 | + { :format => "war", :arch => "ppc", :file_fp => /Zip/ }, |
37 | 66 | ],
|
38 | 67 | }
|
39 | 68 |
|
40 | 69 | def verify_bin_fingerprint(format_hash, bin)
|
41 | 70 | bin.should be_a(String)
|
42 | 71 | fp = IO.popen("file -","w+") do |io|
|
43 |
| - io.write(bin) |
| 72 | + begin |
| 73 | + io.write(bin) |
| 74 | + rescue |
| 75 | + end |
44 | 76 | io.close_write
|
45 | 77 | io.read
|
46 | 78 | end
|
|
0 commit comments