diff --git a/extensions/admin_ui/controllers/panel/index.html b/extensions/admin_ui/controllers/panel/index.html index a104a41e8..dbc9a42ef 100644 --- a/extensions/admin_ui/controllers/panel/index.html +++ b/extensions/admin_ui/controllers/panel/index.html @@ -13,12 +13,16 @@ <%= script_tag 'ext-base.js' %> <%= script_tag 'ext-all.js' %> <%= script_tag 'ext-beef.js' %> + <%= script_tag 'esapi/jquery-1.6.4.min.js' %> <%= script_tag 'esapi/Class.create.js' %> <%= script_tag 'esapi/jquery-encoder-0.1.0.js' %> - + + + <%= script_tag 'ui/common/beef_common.js' %> + <%= script_tag 'ux/TabCloseMenu.js' %> <%= script_tag 'ux/StatusBar.js' %> <%= script_tag 'ux/PagingStore.js' %> diff --git a/extensions/admin_ui/media/javascript/ui/common/beef_common.js b/extensions/admin_ui/media/javascript/ui/common/beef_common.js new file mode 100644 index 000000000..1687dc33f --- /dev/null +++ b/extensions/admin_ui/media/javascript/ui/common/beef_common.js @@ -0,0 +1,44 @@ +// +// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +/*! + * BeEF Web UI commons + */ + +if(typeof beefwui === 'undefined' && typeof window.beefwui === 'undefined') { + + var BeefWUI = { + + rest_token: "", + + /** + * Retrieve the token needed to call the RESTful API. + * This is obviously a post-auth call. + */ + get_rest_token: function() { + if(this.rest_token.length == 0){ + var url = "/ui/modules/getRestfulApiToken.json"; + jQuery.ajax({ + contentType: 'application/json', + dataType: 'json', + type: 'GET', + url: url, + async: false, + processData: false, + success: function(data){ + beefwui.rest_token = data.token; + }, + error: function(){ + beefwui.rest_token = ""; + } + }); + } + return this.rest_token; + } + }; + + window.beefwui = BeefWUI; +}