Skip to content

Commit 9e2d9da

Browse files
committed
Make spec exercise non-exes
1 parent f50ede1 commit 9e2d9da

File tree

1 file changed

+33
-1
lines changed
  • spec/support/shared/contexts/msf/util

1 file changed

+33
-1
lines changed

spec/support/shared/contexts/msf/util/exe.rb

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,64 @@
1515
{ :format => "exe-only", :arch => "x86", :file_fp => /PE32 / },
1616
{ :format => "exe-only", :arch => "x64", :file_fp => /PE32\+ / },
1717
{ :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/ },
1836
],
1937
"linux" => [
2038
{ :format => "elf", :arch => "x86", :file_fp => /ELF 32.*SYSV/ },
2139
{ :format => "elf", :arch => "x64", :file_fp => /ELF 64.*SYSV/ },
2240
{ :format => "elf", :arch => "armle", :file_fp => /ELF 32.*ARM/ },
2341
{ :format => "elf", :arch => "mipsbe", :file_fp => /ELF 32-bit MSB executable, MIPS/ },
2442
{ :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/ },
2548
],
2649
"bsd" => [
2750
{ :format => "elf", :arch => "x86", :file_fp => /ELF 32.*BSD/ },
51+
{ :format => "war", :arch => "x86", :file_fp => /Zip/ },
2852
],
2953
"solaris" => [
3054
{ :format => "elf", :arch => "x86", :file_fp => /ELF 32/ },
55+
{ :format => "war", :arch => "x86", :file_fp => /Zip/ },
3156
],
3257
"osx" => [
3358
{ :format => "macho", :arch => "x86", :file_fp => /Mach-O.*i386/ },
3459
{ :format => "macho", :arch => "x64", :file_fp => /Mach-O 64/ },
3560
{ :format => "macho", :arch => "armle", :file_fp => /Mach-O.*(acorn|arm)/ },
3661
{ :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/ },
3766
],
3867
}
3968

4069
def verify_bin_fingerprint(format_hash, bin)
4170
bin.should be_a(String)
4271
fp = IO.popen("file -","w+") do |io|
43-
io.write(bin)
72+
begin
73+
io.write(bin)
74+
rescue
75+
end
4476
io.close_write
4577
io.read
4678
end

0 commit comments

Comments
 (0)