diff --git a/extensions/admin_ui/controllers/modules/modules.rb b/extensions/admin_ui/controllers/modules/modules.rb index 0847a4584..a1fffd5b4 100644 --- a/extensions/admin_ui/controllers/modules/modules.rb +++ b/extensions/admin_ui/controllers/modules/modules.rb @@ -478,13 +478,11 @@ class Modules < BeEF::Extension::AdminUI::HttpController # sort the parent array nodes tree.sort! {|a,b| a['text'] <=> b['text']} - # sort the children nodes by status + # sort the children nodes by status and name tree.each {|x| x['children'] = - x['children'].sort_by {|a| a['status']} + x['children'].sort_by {|a| [a['status'],a['text']]} } - - - + # append the number of command modules so the branch name results in: " (num)" tree.each {|command_module_branch| num_of_command_modules = command_module_branch['children'].length