(Fixes issue 299): now commands are sorted by working-kind (working commands firsts). Also replaced numbers with constants for future code maintenance.

git-svn-id: https://beef.googlecode.com/svn/trunk@921 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
antisnatchor
2011-04-24 15:38:28 +00:00
parent a2bc8ff2f0
commit c57519c990
4 changed files with 31 additions and 20 deletions

View File

@@ -3,11 +3,13 @@ module Core
module Constants
module CommandModule
VERIFIED_NOT_WORKING = 0
VERIFIED_WORKING = 1
VERIFIED_WORKING = 0
VERIFIED_UNKNOWN = 1
VERIFIED_USER_NOTIFY = 2
VERIFIED_UNKNOWN = 3
VERIFIED_NOT_WORKING = 3
end

View File

@@ -34,10 +34,11 @@ ZombieTab_Commands = function(zombie) {
"the wiki:<br /><a href='http://code.google.com/p/beef/wiki/DevDocs'>" +
"http://code.google.com/p/beef/wiki/DevDocs</a><br/><br/>" +
"Each command module has a traffic light icon, which is used to indicate the following:<ul>" +
"<li><img alt='' src='media/images/icons/red.png' unselectable='on'> - Command does not work against this target</li>" +
"<li><img alt='' src='media/images/icons/grey.png' unselectable='on'> - It is unknown if this command works against this target</li>" +
"<li><img alt='' src='media/images/icons/green.png' unselectable='on'> - The command works against the target and should be invisible to the user</li>" +
"<li><img alt='' src='media/images/icons/orange.png' unselectable='on'> - The command works against the target, but may be visible to the user</li>" +
"<li><img alt='' src='media/images/icons/green.png' unselectable='on'> - The command works against the target and should be invisible to the user</li></ul>"
"<li><img alt='' src='media/images/icons/grey.png' unselectable='on'> - It is unknown if this command works against this target</li>" +
"<li><img alt='' src='media/images/icons/red.png' unselectable='on'> - Command does not work against this target</li></ul>"
})
]
});

View File

@@ -27,14 +27,17 @@ module Metasploit
browsers = BeEF::Core::Constants::Browsers::match_browser(msfi['name'] + msfi['targets'].to_json)
targets << {'os_name' => os_name, 'browser_name' => 'ALL', 'verified_status' => 3} if browsers.count == 0
browsers.each do |bn|
targets << {'os_name' => os_name, 'browser_name' => bn, 'verified_status' => 1}
end
targets << {'os_name' => "ALL", 'verified_status' => 0 }
targets << {'os_name' => os_name, 'browser_name' => 'ALL', 'verified_status' =>
BeEF::Core::Constants::CommandModule::VERIFIED_UNKNOWN} if browsers.count == 0
browsers.each do |bn|
targets << {'os_name' => os_name, 'browser_name' => bn, 'verified_status' =>
BeEF::Core::Constants::CommandModule::VERIFIED_WORKING
}
end
targets << {'os_name' => "ALL", 'verified_status' => BeEF::Core::Constants::CommandModule::VERIFIED_NOT_WORKING}
msfci = BeEF::Core::Models::DynamicCommandInfo.new(
:name => msfi['name'],
:description => msfi['description'],

View File

@@ -39,14 +39,19 @@ module Commands
puts "st: " + st
os_name = BeEF::Core::Constants::Os::match_os(st)
browsers = BeEF::Core::Constants::Browsers::match_browser(msfinfo['name'] + msfinfo['targets'].to_json)
targets << {'os_name' => os_name, 'browser_name' => 'ALL', 'verified_status' => 3} if browsers.count == 0
targets << {'os_name' => os_name, 'browser_name' => 'ALL', 'verified_status' =>
BeEF::Core::Constants::CommandModule::VERIFIED_UNKNOWN} if browsers.count == 0
browsers.each do |bn|
targets << {'os_name' => os_name, 'browser_name' => bn, 'verified_status' => 1}
targets << {'os_name' => os_name, 'browser_name' => bn, 'verified_status' =>
BeEF::Core::Constants::CommandModule::VERIFIED_WORKING
}
end
targets << {'os_name' => "ALL", 'verified_status' => 0 }
targets << {'os_name' => "ALL", 'verified_status' => BeEF::Core::Constants::CommandModule::VERIFIED_NOT_WORKING}
mod.dynamic_command_info = BeEF::Core::Models::DynamicCommandInfo.new(
:name => msfinfo['name'],