Fixed issue 34: now only one zombie tab is created (current browser). When switching between browsers, the previous zombiePanel is destroyed.

This commit is contained in:
antisnatchor
2012-02-15 13:16:13 +01:00
parent 9131a5d65c
commit 74d176ff73
4 changed files with 23 additions and 19 deletions

View File

@@ -21,27 +21,25 @@ ZombieTab = function(zombie) {
requester_tab = new ZombieTab_Requester(zombie);
xssrays_tab = new ZombieTab_XssRaysTab(zombie);
//-------------------------------------------
ZombieTab.superclass.constructor.call(this, {
id: zombie.session,
id:"current-browser",
activeTab: 0,
loadMask: {msg:'Loading browser...'},
title: zombie.ip,
title: "Current Browser",
autoScroll: true,
closable: true,
closable: false,
viewConfig: {
forceFit: true,
type: 'fit'
},
items:[main_tab, log_tab, commands_tab, requester_tab, xssrays_tab]
});
};
Ext.extend(ZombieTab, Ext.TabPanel, {
listeners: {
close: function(panel) {
panel.destroy();
}
activate: function(panel) {},
deactivate: function(panel) {},
close: function(panel) {}
}
});

View File

@@ -132,7 +132,8 @@ function get_dynamic_payload_details(payload, zombie) {
generate_form_input_field(Ext.getCmp("payload-panel"), input, null, false, zombie);
});
Ext.getCmp("payload-panel").doLayout();
Ext.getCmp("payload-panel").doLayout();
console.log("========payloadPanel.doLayout==============");
}
})
}
@@ -146,6 +147,7 @@ function get_dynamic_payload_details(payload, zombie) {
* @param: {Object} the status bar.
*/
function genExisingExploitPanel(panel, command_id, zombie, sb) {
console.log("genExisingExploitPanel========" + zombie.session);
if(typeof panel != 'object') {
Ext.beef.msg('Bad!', 'Incorrect panel chosen.');
return;
@@ -297,6 +299,7 @@ function genExisingExploitPanel(panel, command_id, zombie, sb) {
* @param: {Object} the status bar.
*/
function genNewExploitPanel(panel, command_module_id, command_module_name, zombie, sb) {
if(typeof panel != 'object') {
Ext.beef.msg('Bad!', 'Incorrect panel chosen.');
return;
@@ -327,9 +330,8 @@ function genNewExploitPanel(panel, command_module_id, command_module_name, zombi
}
module = module.command_modules[1];
panel.removeAll();
var form = new Ext.form.FormPanel({
var form = new Ext.form.FormPanel({
url: submiturl,
id: 'form-command-module-zombie-'+zombie.session,
@@ -394,7 +396,7 @@ function genNewExploitPanel(panel, command_module_id, command_module_name, zombi
bodyBorder: false,
height: 200,
hidden: true,
border: false //we can remove the border of the panel
border: false //we can remove the border of the panel
});
Ext.each(module.Data, function(input){
@@ -402,7 +404,6 @@ function genNewExploitPanel(panel, command_module_id, command_module_name, zombi
);
form.add(payload_panel);
panel.add(form);
panel.doLayout();
// hide the load mask after rendering of the config panel is done

View File

@@ -95,7 +95,7 @@ ZombieTab_Commands = function(zombie) {
nonce: Ext.get ("nonce").dom.value
}
});
genNewExploitPanel(command_module_config, node.id, node.text, zombie, commands_statusbar);
commands_statusbar.showValid('Ready');
}
@@ -189,4 +189,8 @@ ZombieTab_Commands = function(zombie) {
var sb = Ext.getCmp('command-module-bbar-zombie-'+zombie.session);
};
Ext.extend(ZombieTab_Commands, Ext.Panel, {});
Ext.extend(ZombieTab_Commands, Ext.Panel, {
listeners: {
close: function(panel) {}
}
});

View File

@@ -113,12 +113,13 @@ Ext.extend(zombiesTreeList, Ext.tree.TreePanel, {
//creates a new hooked browser tab when a hooked browser is clicked
click: function(node, e) {
if(!node.leaf) return;
if(!mainPanel.get(node.attributes.session)) {
mainPanel.remove(mainPanel.getComponent('current-browser'));
if(!mainPanel.getComponent('current-browser')) {
mainPanel.add(new ZombieTab(node.attributes));
}
mainPanel.activate(node.attributes.session);
mainPanel.activate(mainPanel.getComponent('current-browser'));
},
//show the context menu when a HB is right-clicked
contextmenu: function(node, event){