1
2
3
4
5
6 import tempfile
7
8 from lib.common.abstracts import Package
9
11 """Java Applet analysis package."""
12 PATHS = [
13 ("ProgramFiles", "Mozilla Firefox", "firefox.exe"),
14 ("ProgramFiles", "Internet Explorer", "iexplore.exe"),
15 ]
16
18 html = """
19 <html>
20 <body>
21 <applet archive="%s" code="%s" width="1" height="1">
22 </applet>
23 </body>
24 </html>
25 """ % (path, class_name)
26
27 _, file_path = tempfile.mkstemp(suffix=".html")
28 with open(file_path, "w") as file_handle:
29 file_handle.write(html)
30
31 return file_path
32
34 browser = self.get_path("browser")
35 class_name = self.options.get("class")
36 html_path = self.make_html(path, class_name)
37 return self.execute(
38 browser, args=[html_path], trigger="file:%s" % html_path
39 )
40