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