Add warning to delete zombie context menu

This commit is contained in:
Brendan Coles
2019-02-24 07:41:53 +00:00
parent 09f028c02d
commit 503965c193
3 changed files with 39 additions and 19 deletions

View File

@@ -255,13 +255,18 @@ ZombieDataGrid = function(url, page, base) {
break;
case 'zombie_grid_delete_zombie':
var token = beefwui.get_rest_token();
var hid = '';
var url = "/api/hooks/" + escape(hid) + "/delete?token=" + token;
if (!confirm('Are you sure you want to delete zombie [id: ' + hb_id + '] ?\nWarning: this will remove all zombie related data, including logs and command results!')) {
//commands_statusbar.update_fail('Cancelled');
return;
}
//commands_statusbar.update_sending('Removing zombie [id: ' + hb_id + '] ...');
var url = "/api/hooks/" + escape(hb_id) + "/delete?token=" + token;
Ext.Ajax.request({
url: url,
method: 'GET'
});
break;
}
}
}

View File

@@ -8,12 +8,12 @@ ZombieTab = function(zombie) {
main_tab = new ZombieTab_DetailsTab(zombie);
log_tab = new ZombieTab_LogTab(zombie);
commands_tab = new ZombieTab_Commands(zombie);
requester_tab = new ZombieTab_Requester(zombie);
proxy_tab = new ZombieTab_Requester(zombie);
xssrays_tab = new ZombieTab_XssRaysTab(zombie);
ipec_tab = new ZombieTab_IpecTab(zombie);
autorun_tab = new ZombieTab_Autorun(zombie);
network_tab = new ZombieTab_Network(zombie);
rtc_tab = new ZombieTab_Rtc(zombie);
webrtc_tab = new ZombieTab_Rtc(zombie);
ZombieTab.superclass.constructor.call(this, {
id:"current-browser",
@@ -26,11 +26,27 @@ ZombieTab = function(zombie) {
forceFit: true,
type: 'fit'
},
items:[main_tab, log_tab, commands_tab, requester_tab, xssrays_tab, ipec_tab, autorun_tab, network_tab, rtc_tab],
items:[
main_tab,
log_tab,
commands_tab,
proxy_tab,
xssrays_tab,
ipec_tab,
autorun_tab,
network_tab,
webrtc_tab
],
listeners:{
afterrender:function(component){
// Hide auto-run tab
component.hideTabStripItem(autorun_tab);
// Hide IPEC tab - it's current broken
component.hideTabStripItem(ipec_tab);
// Hide tabs for disabled functionality
<%= BeEF::Core::Configuration.instance.get("beef.extension.webrtc.enable") ? '' : 'component.hideTabStripItem(webrtc_tab);' %>
<%= BeEF::Core::Configuration.instance.get("beef.extension.xssrays.enable") ? '' : 'component.hideTabStripItem(xssrays_tab);' %>
<%= BeEF::Core::Configuration.instance.get("beef.extension.network.enable") ? '' : 'component.hideTabStripItem(network_tab);' %>
}
}
});

View File

@@ -112,7 +112,7 @@ Ext.extend(zombiesTreeList, Ext.tree.TreePanel, {
listeners: {
itemclick: function(item, object) {
var hb_id = this.contextNode.id.split('zombie-online-')[1];
var hb_id_off = this.contextNode.id.split('zombie-offline-')[1];
var hb_id_off = this.contextNode.id.split('zombie-offline-')[1];
switch (item.id) {
case 'use_as_proxy':
Ext.Ajax.request({
@@ -146,19 +146,18 @@ Ext.extend(zombiesTreeList, Ext.tree.TreePanel, {
});
break;
case 'delete_zombie':
var token = beefwui.get_rest_token();
var hid = '';
if (typeof hb_id_off === 'undefined'){
hid=hb_id;
}else{
hid=hb_id_off;
}
var url = "/api/hooks/" + escape(hid) + "/delete?token=" + token;
Ext.Ajax.request({
url: url,
method: 'GET'
});
break;
var token = beefwui.get_rest_token();
if (!confirm('Are you sure you want to delete zombie [id: ' + hb_id + '] ?\nWarning: this will remove all zombie related data, including logs and command results!')) {
//commands_statusbar.update_fail('Cancelled');
return;
}
//commands_statusbar.update_sending('Removing zombie [id: ' + hb_id + '] ...');
var url = "/api/hooks/" + escape(hb_id) + "/delete?token=" + token;
Ext.Ajax.request({
url: url,
method: 'GET'
});
break;
}
}
}