Changeset 5283

Show
Ignore:
Timestamp:
01/07/08 01:00:42 (8 months ago)
Author:
hdm
Message:

Added consoles to the GUI

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/trunk/lib/msf/core/exploit/capture.rb

    r4393 r5283  
    44# 
    55# This module provides methods for receiving raw packets.  
    6 # Please see the ruby-pcapx documentation for more information. 
     6# Please see the pcaprub documentation for more information. 
    77# 
    88### 
     
    2121                                OptString.new('INTERFACE', [false, 'The name of the interface']), 
    2222                                OptString.new('FILTER', [false, 'The filter string for capturing traffic']), 
    23                                 OptInt.new('SNAPLEN', [true, 'The number of bytes to capture', 65535]) 
     23                                OptInt.new('SNAPLEN', [true, 'The number of bytes to capture', 65535]), 
     24                                OptInt.new('TIMEOUT', [true, 'The number of seconds to wait for new data', 1]) 
    2425 
    2526                        ], Msf::Exploit::Capture 
     
    2829                 
    2930                begin 
    30                         require 'PcapX
    31                         @pcapx_loaded = true 
     31                        require 'Pcaprub
     32                        @pcaprub_loaded = true 
    3233                rescue ::Exception => e 
    33                         @pcapx_loaded = false 
    34                         @pcapx_error  = e 
     34                        @pcaprub_loaded = false 
     35                        @pcaprub_error  = e 
    3536                end 
    36          
     37 
     38                begin 
     39                        require 'scruby' 
     40                        @scruby_loaded = true 
     41                rescue ::Exception => e 
     42                        @scruby_loaded = false 
     43                        @scruby_error  = e 
     44                end 
     45                         
    3746        end 
    3847 
    3948        def stats_recv 
    4049                return(0) if not self.capture 
    41                 self.capture.stats.recv 
     50                self.capture.stats['recv'] 
    4251        end 
    4352 
    4453        def stats_drop 
    4554                return(0) if not self.capture 
    46                 self.capture.stats.drop 
     55                self.capture.stats['drop'] 
    4756        end 
    4857 
     58        def stats_ifdrop 
     59                return(0) if not self.capture 
     60                self.capture.stats['ifdrop'] 
     61        end 
     62         
    4963        # 
    5064        # Opens a handle to the specified device 
     
    5266        def open_pcap 
    5367         
    54                 if (not @pcapx_loaded) 
    55                         print_status("The PcapX module is not available: #{@pcapx_error.to_s}") 
    56                         raise RuntimeError, "PcapX not available" 
     68                if (not @pcaprub_loaded) 
     69                        print_status("The Pcaprub module is not available: #{@pcaprub_error.to_s}") 
     70                        raise RuntimeError, "Pcaprub not available" 
    5771                end 
    5872                 
     
    6175         
    6276                # Capture device 
    63                 dev = datastore['INTERFACE'] || ::PcapX.lookupdev 
    64                 len = datastore['SNAPLEN']   || 65535 
     77                dev = datastore['INTERFACE'] || ::Pcap.lookupdev 
     78                len = (datastore['SNAPLEN']  || 65535).to_i 
     79                tim = (datastore['TIMEOUT']  || 0).to_i 
    6580                fil = datastore['FILTER'] 
    66  
    67                 self.capture = ::PcapX::Capture.open_live(dev, len, true
     81                                 
     82                self.capture = ::Pcap.open_live(dev, len, true, tim
    6883 
    6984                if (not self.capture) 
    70                         raise RuntimeError, "Could not open the wireless device interface" 
     85                        raise RuntimeError, "Could not open the device interface" 
    7186                end 
    7287 
     
    8095        end 
    8196 
     97        # Extend this to support a wider range of link layer types 
    8298        def capture_find_linklayer(pkt) 
    8399                return if not pkt 
     
    110126                return set 
    111127        end 
     128         
     129        def each_packet 
     130         
     131        end 
    112132 
    113133        attr_accessor :capture 
  • framework3/trunk/lib/msf/core/module_manager.rb

    r5274 r5283  
    794794                                load_module_from_file(path, file, loaded, recalc, counts, demand) 
    795795                        rescue NameError 
     796                                 
     797                                # As of Jan-06-2007 this code isn't hit with the official module tree 
     798                                 
    796799                                # If we get a name error, it's possible that this module depends 
    797800                                # on another one that we haven't loaded yet.  Let's postpone 
     
    808811 
    809812                        delay.each_key { |file| 
     813 
    810814                                begin 
    811815                                        # Load the module from the file... 
  • framework3/trunk/lib/msf/ui/gtk2/app.rb

    r5260 r5283  
    264264                def on_logs_activate 
    265265                        MsfWindow::Logs.new 
     266                end 
     267                 
     268                # 
     269                # Action for "Window/Console" menu 
     270                # 
     271                def on_consoles_activate 
     272                        MsfWindow::Consoles.new 
    266273                end 
    267274 
  • framework3/trunk/lib/msf/ui/gtk2/window.rb

    r4972 r5283  
    11require 'msf/ui/gtk2/window/logs' 
    22require 'msf/ui/gtk2/window/auxiliary' 
     3require 'msf/ui/gtk2/window/consoles' 
    34 
    45