Added skeleton for custom hooks

Part of issue #101
This commit is contained in:
bcoles
2012-04-23 19:33:19 +09:30
parent fa59e633b0
commit 923921b92b
4 changed files with 118 additions and 2 deletions

View File

@@ -0,0 +1,77 @@
//
// Copyright 2012 Wade Alcorn wade@bindshell.net
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
HooksTab = function() {
/*
* The panel used to configure the hook.
********************************************/
var hooks_panel = new Ext.FormPanel({
title: 'Hooks',
id: 'hooks-panel',
hideLabels : false,
border: false,
padding: '3px 5px 0 5px',
items:[{
fieldLabel: 'Text',
xtype: 'textarea',
id: 'inputText',
name: 'inputText',
width: '100%',
height: '40%',
allowBlank: true
},{
fieldLabel: 'Result',
xtype: 'textarea',
id: 'resultText',
name: 'resultText',
width: '100%',
height: '40%',
allowBlank: true
}],
buttons: [{
text: 'Add Hook',
handler: function() {
var form = Ext.getCmp('hooks-panel').getForm();
var form_values = form.getValues();
var input_text = form_values['inputText'];
var result="";
form.setValues({resultText: result});
}
},{
text: 'Delete Hook',
handler: function() {
var form = Ext.getCmp('hooks-panel').getForm();
var form_values = form.getValues();
var input_text = form_values['inputText'];
var result="";
form.setValues({resultText: result});
}
}]
});
HooksTab.superclass.constructor.call(this, {
region: 'center',
items: [hooks_panel],
autoScroll: true,
border: false
});
};
Ext.extend(HooksTab,Ext.Panel, {});

View File

@@ -41,6 +41,7 @@ MainPanel = function(){
this.grid = new DataGrid('/ui/logs/all.json',30);
this.grid.border = false;
this.welcome_tab = new WelcomeTab;
//this.hooks_tab = new HooksTab;
//this.hackvertor_tab = new HackVertorTab;
MainPanel.superclass.constructor.call(this, {
@@ -71,7 +72,14 @@ MainPanel = function(){
items:[
this.grid
/*
]},{
]},{
id:'hooks-view',
layout:'border',
title:'Hooks',
hideMode:'offsets',
items:[
//this.hooks_tab
]},{
id:'hackvertor-view',
layout:'border',
title:'HackVertor',

View File

@@ -0,0 +1,29 @@
#
# Copyright 2012 Wade Alcorn wade@bindshell.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'test/unit'
class TC_Hooks < Test::Unit::TestCase
def setup
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '.'))
$root_dir = File.expand_path('../../../../', __FILE__)
end
def test_hooks
assert(true)
end
end

View File

@@ -32,6 +32,7 @@ require './extensions/tc_xssrays'
require './extensions/tc_vnc'
require './extensions/tc_ipec_tunnel'
require './extensions/tc_hackverter'
require './extensions/tc_hooks'
require './extensions/tc_proxy'
require './extensions/tc_requester'
require './extensions/tc_event_logger'
@@ -61,9 +62,10 @@ class TS_BeefTests
suite << TC_Proxy.suite
suite << TC_Hackverter.suite
suite << TC_EventLogger.suite
suite << TC_Hooks.suite
return suite
end
end
Test::Unit::UI::Console::TestRunner.run(TS_BeefTests)
Test::Unit::UI::Console::TestRunner.run(TS_BeefTests)