Changeset 5491

Show
Ignore:
Timestamp:
04/22/08 18:20:35 (3 weeks ago)
Author:
hdm
Message:

Let the GUI handle -r, change default window size to fit smaller screens, updated HTTP capture code, added keywords to payload

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/trunk/data/msfgui/msfgui.glade

    r5345 r5491  
    77  <property name="border_width">5</property> 
    88  <property name="width_request">800</property> 
    9   <property name="height_request">600</property> 
     9  <property name="height_request">400</property> 
    1010  <property name="title" translatable="yes"></property> 
    1111  <property name="type">GTK_WINDOW_TOPLEVEL</property> 
  • framework3/trunk/lib/msf/ui/gtk2/app.rb

    r5380 r5491  
    184184                        $gtk2driver.append_log_view("Initialized the Metasploit Framework GUI.\n") 
    185185                         
     186                        # Handle any initalization options 
     187                        process_cli_options() 
     188                end 
     189                 
     190                def process_cli_options 
     191                        res  = $gtk2driver.opts['Resource'] || return 
     192                        data = "" 
     193                        begin 
     194                                data = File.read(res) 
     195                        rescue ::Exception => e 
     196                                $gtk2driver.append_log_view("Failed to open the resource file: #{e}\n") 
     197                                return 
     198                        end 
     199                         
     200                        # spawn a new console 
     201                        pipe = MsfWindow::Consoles.new.last_console.pipe 
     202                         
     203                        data.each_line do |line| 
     204                                line.strip 
     205                                next if line.length == 0 
     206                                next if line =~ /^#/ 
     207                                $gtk2driver.append_log_view("Executing: #{line}...\n") 
     208                                pipe.write_input(line + "\n") 
     209                        end 
     210 
    186211                end 
    187212                 
  • framework3/trunk/lib/msf/ui/gtk2/driver.rb

    r5339 r5491  
    180180                # 
    181181                attr_accessor :active_module, :exploit 
    182  
    183                 protected 
    184  
    185182                attr_writer   :framework # :nodoc: 
    186183                attr_accessor :opts      # :nodoc: 
  • framework3/trunk/lib/msf/ui/gtk2/window/consoles.rb

    r5335 r5491  
    3232                                        } 
    3333                                ) 
    34                                  
     34                                self 
    3535                        end 
    3636 
     
    355355                                text.stop_console 
    356356                        end 
     357                         
     358                        @last_console = text 
    357359 
    358360                end 
    359361                 
    360362                include Msf::Ui::Gtk2::MyControls 
    361                   
     363                attr_accessor :last_console 
     364                 
    362365                def initialize 
    363366 
  • framework3/trunk/modules/auxiliary/server/capture/http.rb

    r5490 r5491  
    6060        end 
    6161 
    62         def setup 
    63                 super 
    64                 @state = {} 
    65         end 
    66  
    6762        def run 
    6863                @formsdir = datastore['FORMSDIR'] 
     
    7166                @myhost   = datastore['SRVHOST'] 
    7267                @myport   = datastore['SRVPORT'] 
     68                Thread.current.priority = 20 
    7369                exploit() 
    7470        end 
    7571         
    7672        def on_client_connect(c) 
    77                 @state[c.peerhost] ||= { 
    78                         :ip    => c.peerhost,  
    79                         :sites => {} 
    80                 } 
    8173                c.extend(Rex::Proto::Http::ServerClient) 
    8274                c.init_cli(self) 
     
    8476         
    8577        def on_client_data(cli) 
    86  
    8778                begin 
    8879                        data = cli.get_once(-1, 5) 
     
    9182                                when Rex::Proto::Http::Packet::ParseCode::Completed 
    9283                                        dispatch_request(cli, cli.request) 
    93  
    9484                                        cli.reset_cli 
    9585                                when  Rex::Proto::Http::Packet::ParseCode::Error 
     
    10292                end 
    10393                 
    104                 close_client(cli)                                               
     94                close_client(cli) 
    10595        end 
    10696 
     
    110100         
    111101        def dispatch_request(cli, req) 
     102                 
     103                phost = cli.peerhost 
    112104                 
    113105                os_name = nil 
     
    232224                        return 
    233225                end 
    234                  
     226 
     227                report_note( 
     228                        :host => cli.peerhost, 
     229                        :type => "http_request", 
     230                        :data => "#{hhead}:#{@myport} #{req.method} #{req.resource} #{os_name} #{ua_name} #{ua_vers}" 
     231                ) 
     232                                         
    235233                print_status("HTTP REQUEST #{cli.peerhost} > #{hhead}:#{@myport} #{req.method} #{req.resource} #{os_name} #{ua_name} #{ua_vers} cookies=#{cookies}") 
    236234                                 
  • framework3/trunk/modules/payloads/singles/linux/x86/chmod.rb

    • Property svn:keywords set to Rev Revision Id Header
  • framework3/trunk/msfgui

    r5407 r5491  
    1919        $stderr.puts "[*] The msfgui interface requires the ruby-gtk2 and ruby-libglade2 packages" 
    2020        $stderr.puts "[*] Dependencies include ruby-pango, ruby-glib2, ruby-gdkpixbuf2, and ruby-atk" 
     21        $stderr.puts "[*] Error: #{e.class} #{e}" 
    2122        exit(0) 
    2223end 
     
    3637arguments = Rex::Parser::Arguments.new( 
    3738        "-v" => [ true,  "A number between 0 and 3 that controls log verbosity" ], 
     39        "-r" => [ true,  "Execute the specified resource file"                  ], 
    3840        "-d" => [ false, "Keep running in the foreground"                       ], 
    3941        "-D" => [ false, "Keep stdio and stderr open for debugging"             ], 
     
    4951                when "-v" 
    5052                        opts['LogLevel'] = val 
     53                when "-r" 
     54                        opts['Resource'] = val 
    5155                when "-d" 
    5256                        foreground = false