Changeset 5535

Show
Ignore:
Timestamp:
06/22/08 14:59:12 (4 months ago)
Author:
egypt
Message:

add 'resource' command, no tab completion yet because i'm lazy

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/trunk/lib/msf/ui/console/command_dispatcher/core.rb

    r5532 r5535  
    5151                        "back"     => "Move back from the current context", 
    5252                        "banner"   => "Display an awesome metasploit banner", 
     53                        "cd"       => "Change the current working directory", 
    5354                        "exit"     => "Exit the console", 
    5455                        "help"     => "Help menu", 
     
    6162#                       "persist"  => "Persist or restore framework state information", 
    6263 
     64                        "loadpath" => "Searches for and loads modules from a path", 
    6365                        "quit"     => "Exit the console", 
     66                        "resource" => "Run the commands stored in a file", 
    6467                        "route"    => "Route traffic through a session", 
    6568                        "save"     => "Saves the active datastores", 
    66                         "loadpath" => "Searches for and loads modules from a path", 
    6769                        "search"   => "Searches module names and descriptions", 
    6870                        "sessions" => "Dump session listings and display information about sessions", 
     
    7072                        "setg"     => "Sets a global variable to a value", 
    7173                        "show"     => "Displays modules of a given type, or all modules", 
     74                        "sleep"    => "Do nothing for the specified number of seconds", 
    7275                        "unload"   => "Unload a framework plugin", 
    7376                        "unset"    => "Unsets one or more variables", 
     
    7578                        "use"      => "Selects a module by name", 
    7679                        "version"  => "Show the console library version number", 
    77                         "sleep"    => "Do nothing for the specified number of seconds", 
    78                         "cd"       => "Change the current working directory", 
    7980                } 
    8081        end 
     
    9596                "Core" 
    9697        end 
     98 
     99    def cmd_resource(*args) 
     100        driver.load_resource(*args) 
     101        end 
     102 
    97103 
    98104        # 
     
    278284        def cmd_jobs_tabs(str, words) 
    279285                if(not words[1]) 
    280                         return %w{-l -k -h} 
     286                        return %w{-l -k -K -h} 
    281287                end 
    282288                if (words[1] == '-k') 
    283289                        # XXX return the list of job values 
     290                        ret = [] 
     291                        framework.jobs.each_key do |i| 
     292                                ret.push i 
     293                        end 
     294                        return ret 
    284295                end 
    285296        end