Class: Watobo::Plugin::Sslchecker::Gui::Main

Inherits:
Watobo::Plugin2
  • Object
show all
Defined in:
plugins/sslchecker/gui/gui.rb

Constant Summary

Constants included from Constants

Constants::AC_GROUP_APACHE, Constants::AC_GROUP_DOMINO, Constants::AC_GROUP_ENUMERATION, Constants::AC_GROUP_FILE_INCLUSION, Constants::AC_GROUP_FLASH, Constants::AC_GROUP_GENERIC, Constants::AC_GROUP_JBOSS, Constants::AC_GROUP_JOOMLA, Constants::AC_GROUP_SAP, Constants::AC_GROUP_SQL, Constants::AC_GROUP_TYPO3, Constants::AC_GROUP_XSS, Constants::AUTH_TYPE_BASIC, Constants::AUTH_TYPE_DIGEST, Constants::AUTH_TYPE_NONE, Constants::AUTH_TYPE_NTLM, Constants::CHAT_SOURCE_AUTO_SCAN, Constants::CHAT_SOURCE_FUZZER, Constants::CHAT_SOURCE_INTERCEPT, Constants::CHAT_SOURCE_MANUAL, Constants::CHAT_SOURCE_MANUAL_SCAN, Constants::CHAT_SOURCE_PROXY, Constants::CHAT_SOURCE_UNDEF, Constants::DEFAULT_PORT_HTTP, Constants::DEFAULT_PORT_HTTPS, Constants::FINDING_TYPE_HINT, Constants::FINDING_TYPE_INFO, Constants::FINDING_TYPE_UNDEFINED, Constants::FINDING_TYPE_VULN, Constants::FIRST_TIME_FILE, Constants::GUI_REGULAR_FONT_SIZE, Constants::GUI_SMALL_FONT_SIZE, Constants::ICON_PATH, Constants::LOG_DEBUG, Constants::LOG_INFO, Constants::SCAN_CANCELED, Constants::SCAN_FINISHED, Constants::SCAN_PAUSED, Constants::SCAN_STARTED, Constants::TE_CHUNKED, Constants::TE_COMPRESS, Constants::TE_DEFLATE, Constants::TE_GZIP, Constants::TE_IDENTITY, Constants::TE_NONE, Constants::VULN_RATING_CRITICAL, Constants::VULN_RATING_HIGH, Constants::VULN_RATING_INFO, Constants::VULN_RATING_LOW, Constants::VULN_RATING_MEDIUM, Constants::VULN_RATING_UNDEFINED

Constants included from Gui::Icons

Gui::Icons::ICON_ADD_PROJECT, Gui::Icons::ICON_BROWSER_MEDIUM, Gui::Icons::ICON_BROWSER_SMALL, Gui::Icons::ICON_BTN_DOWN, Gui::Icons::ICON_BTN_UP, Gui::Icons::ICON_CB_CHECKED, Gui::Icons::ICON_CB_CHECKED_ORANGE, Gui::Icons::ICON_CB_UNCHECKED, Gui::Icons::ICON_CONVERSATION, Gui::Icons::ICON_DASHBOARD, Gui::Icons::ICON_DIFFER, Gui::Icons::ICON_FOLDER, Gui::Icons::ICON_FOLDER_SMALL, Gui::Icons::ICON_FUZZER, Gui::Icons::ICON_FUZZER_MEDIUM, Gui::Icons::ICON_FUZZER_SMALL, Gui::Icons::ICON_FUZZ_FILTER, Gui::Icons::ICON_FUZZ_GENERATOR, Gui::Icons::ICON_FUZZ_TAG, Gui::Icons::ICON_HINTS, Gui::Icons::ICON_HINTS_INFO, Gui::Icons::ICON_HINTS_INFO_SMALL, Gui::Icons::ICON_HINTS_SMALL, Gui::Icons::ICON_INFO, Gui::Icons::ICON_INFO_INFO, Gui::Icons::ICON_INFO_INFO_SMALL, Gui::Icons::ICON_INFO_SMALL, Gui::Icons::ICON_INFO_USER, Gui::Icons::ICON_INFO_USER_SMALL, Gui::Icons::ICON_INTERCEPTOR, Gui::Icons::ICON_LOGIN_WIZZARD, Gui::Icons::ICON_MANUAL_REQUEST, Gui::Icons::ICON_MANUAL_REQUEST_MEDIUM, Gui::Icons::ICON_MANUAL_REQUEST_SMALL, Gui::Icons::ICON_PAUSE, Gui::Icons::ICON_PLUGIN, Gui::Icons::ICON_PROJECT, Gui::Icons::ICON_PROJECT_SMALL, Gui::Icons::ICON_REPORT, Gui::Icons::ICON_REQUEST, Gui::Icons::ICON_REQUEST_SMALL, Gui::Icons::ICON_SEND_REQUEST, Gui::Icons::ICON_SITE, Gui::Icons::ICON_SITE_SMALL, Gui::Icons::ICON_START, Gui::Icons::ICON_STOP, Gui::Icons::ICON_TOKEN, Gui::Icons::ICON_TRANSCODER, Gui::Icons::ICON_VULN, Gui::Icons::ICON_VULN_BP, Gui::Icons::ICON_VULN_BP_SMALL, Gui::Icons::ICON_VULN_CRITICAL, Gui::Icons::ICON_VULN_CRITICAL_SMALL, Gui::Icons::ICON_VULN_HIGH, Gui::Icons::ICON_VULN_HIGH_SMALL, Gui::Icons::ICON_VULN_LOW, Gui::Icons::ICON_VULN_LOW_SMALL, Gui::Icons::ICON_VULN_MEDIUM, Gui::Icons::ICON_VULN_MEDIUM_SMALL, Gui::Icons::ICON_VULN_SMALL, Gui::Icons::ICON_WATOBO, Gui::Icons::SIBERAS_ICON, Gui::Icons::TBL_ICON_LOCK, Gui::Icons::WATOBO_LOGO

Constants included from Gui

Gui::DIFF_TYPE_NEW, Gui::DIFF_TYPE_ORIG, Gui::SEL_TYPE_GREP, Gui::SEL_TYPE_HIGHLIGHT, Gui::TABLE_COL_COMMENT, Gui::TABLE_COL_COOKIE, Gui::TABLE_COL_HOST, Gui::TABLE_COL_METHOD, Gui::TABLE_COL_PARMS, Gui::TABLE_COL_PATH, Gui::TABLE_COL_SSL, Gui::TABLE_COL_STATUS

Constants included from Diff::LCS

Diff::LCS::BalancedCallbacks, Diff::LCS::PATCH_MAP, Diff::LCS::SequenceCallbacks, Diff::LCS::VERSION

Instance Method Summary collapse

Methods included from Diff::LCS

LCS, __diff_direction, __inverse_vector, __lcs, __normalize_patchset, __position_hash, __replace_next_larger, diff, #diff, #lcs, patch, #patch, #patch!, patch!, sdiff, #sdiff, traverse_balanced, #traverse_balanced, traverse_sequences, #traverse_sequences, #unpatch, #unpatch!, unpatch!

Constructor Details

#initialize(owner, project) ⇒ Main

Returns a new instance of Main.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'plugins/sslchecker/gui/gui.rb', line 143

def initialize(owner, project)
  super(owner, "SSL-Plugin", project, :opts => DECOR_ALL,:width=>800, :height=>600)

  @plugin_name = "SSL-Checker"
  @project = project
  @site = nil
  @dir = nil
  @scan_thread = nil
  @pbar = nil
  @scanner = nil
  
  @results = []
  @results_lock = Mutex.new
       #   @status_lock = Mutex.new
  @status = :idle
  
   @clipboard_text = ""
self.connect(SEL_CLIPBOARD_REQUEST) do
# setDNDData(FROM_CLIPBOARD, FXWindow.stringType, Fox.fxencodeStringData(@clipboard_text))
  setDNDData(FROM_CLIPBOARD, FXWindow.stringType, @clipboard_text + "\x00" )
end
  
  mr_splitter = FXSplitter.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y|SPLITTER_VERTICAL|SPLITTER_REVERSED|SPLITTER_TRACKING)
  # top = FXHorizontalFrame.new(mr_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_SIDE_BOTTOM)
  top_frame = FXVerticalFrame.new(mr_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_FIX_HEIGHT|LAYOUT_BOTTOM,:height => 500)
  top_splitter = FXSplitter.new(top_frame, LAYOUT_FILL_X|SPLITTER_HORIZONTAL|LAYOUT_FILL_Y|SPLITTER_TRACKING)
  log_frame = FXVerticalFrame.new(mr_splitter, :opts => LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM,:height => 100)

  @settings_frame = FXVerticalFrame.new(top_splitter, :opts => LAYOUT_FILL_Y)
  result_frame = FXVerticalFrame.new(top_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
  
  @controller = CipherTableController.new(result_frame, :opts => LAYOUT_FILL_X)
  @controller.subscribe(:apply_filter){ |f| @cipher_table.filter = f ; @cipher_table.update_table}
  @controller.subscribe(:copy_table){
     types = [ FXWindow.stringType ]
            if acquireClipboard(types)
            puts
            @clipboard_text = @cipher_table.to_csv
            end

  }

 frame = FXVerticalFrame.new(result_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding=>0)
 @cipher_table = CipherTable.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)

  FXLabel.new(@settings_frame, "Enter or select site to test:")
  @sites_combo = FXComboBox.new(@settings_frame, 5, nil, 0, COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
   #@sites_combo = FXTextField.new(@settings_frame, 25, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN|LAYOUT_RIGHT)
  #@filterCombo.width =200

  @sites_combo.numColumns = 35
  @sites_combo.editable = true
  @sites_combo.connect(SEL_COMMAND, method(:onSiteSelect))
  begin

       
    @pbar = FXProgressBar.new(@settings_frame, nil, 0, LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK|PROGRESSBAR_HORIZONTAL)
    
    @pbar.progress = 0
    @pbar.total = 0
    @pbar.barColor=0
    @pbar.barColor = 'grey' #FXRGB(255,0,0)

    @start_button = FXButton.new(@settings_frame, "start")
    @start_button.connect(SEL_COMMAND, method(:start))

    @check = Check.new(@project)

    @check.subscribe(:cipher_checked) { |result|
      begin
        @results_lock.synchronize do
        @results << result
        end
       #  FXApp.instance.forceRefresh
      rescue => bang
      puts bang
      puts bang.backtrace if $DEBUG
      end
    #puts "#{@pbar.progress} of #{@pbar.total}"
    #     logger

    }

    log_frame_header = FXHorizontalFrame.new(log_frame, :opts => LAYOUT_FILL_X)
    FXLabel.new(log_frame_header, "Logs:" )

    #log_text_frame = FXHorizontalFrame.new(bottom_frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|LAYOUT_BOTTOM)
    log_text_frame = FXVerticalFrame.new(log_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding=>0)
    @log_viewer = LogViewer.new(log_text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)

    updateView()
   
  rescue => bang
  puts bang
  puts bang.backtrace if $DEBUG
  end

end

Instance Method Details

#createObject



95
96
97
98
99
# File 'plugins/sslchecker/gui/gui.rb', line 95

def create
  super
  
  updateView()
end

#createChat(site) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'plugins/sslchecker/gui/gui.rb', line 35

def createChat(site)
  chat = nil
 
  unless site =~ /^http/
    url = "https://#{site}/"
  else
    url = site
  end
  request = []
  request << "GET #{url} HTTP/1.1\r\n"
  request << "Host: #{site}\r\n"
  request << "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*\r\n"
  request << "Accept-Language: de\r\n"
  request << "Proxy-Connection: close\r\n"
  request << "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n"
  request << "\r\n"
  
  puts request

  chat = Watobo::Chat.new(request, [], :id => 0)

  return chat
end

#onSiteSelect(sender, sel, item) ⇒ Object



59
60
61
62
63
64
65
66
67
68
# File 'plugins/sslchecker/gui/gui.rb', line 59

def onSiteSelect(sender, sel, item)
  if sender.numItems > 0
  @site = sender.getItemData(sender.currentItem)
  else
    unless sender.text.empty?
    @site = sender.text.gsub(/^https?:\/\//,"").strip 
    end
  end
 
end

#start(sender, sel, item) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'plugins/sslchecker/gui/gui.rb', line 101

def start(sender, sel, item)
  unless @site.nil?
   @cipher_table.clear_ciphers

    puts "Site: #{@site}"
    puts @site.class
    #puts "Directory: #{@dir}"
    chat = createChat(@site)
    checklist = []
    checklist.push @check
    chatlist = []
    chatlist.push chat
    scan_prefs = Watobo::Conf::Scanner.to_h
    @scanner = Watobo::Scanner3.new(chatlist, checklist, nil, scan_prefs)

    @pbar.total = @scanner.sum_total
    @pbar.progress = 0
    @pbar.barColor = 'red'
    
    unless @project.getCurrentProxy().nil?
       @log_viewer.log(LOG_INFO,"!!! WARNING FORWARDING PROXY IS SET !!! - SSL-Check running against proxy may not make sense!")
    end
     @update_lock.synchronize do 
          @status = :running
        end
     
    @log_viewer.log LOG_INFO, "Scan started with #{@check.cipherlist.length} ciphers ..."
  #  @scan_thread = Thread.new(scanner) { |scan|
      begin

       @scanner.run()
       # sleep 1 # to let the update_timer finish its work
       # getApp().removeTimeout(@update_timer) 
      rescue => bang
      puts bang
      puts bang.backtrace if $DEBUG
      end
    #}

  end
end

#updateViewObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'plugins/sslchecker/gui/gui.rb', line 70

def updateView()
  #@project = project
  @site = nil
  @sites_combo.clearItems()
  #@dir_combo.clearItems()
  unless Watobo.project.nil? then
    count = 0
    Watobo::Chats.sites(:ssl => true, :in_scope => Watobo::Scope.exist? ).each do |site|
    #puts "Site: #{site}"
      count += 1
      @sites_combo.appendItem(site, site)
    end
    if @sites_combo.numItems > 0
      @sites_combo.setCurrentItem(0)
      @site = @sites_combo.getItemData(0)
      @sites_combo.numVisible = ( @sites_combo.numItems > 15 ) ? 15 : @sites_combo.numItems
   # else
   #   @log_viewer.log(LOG_INFO,"No SSL Sites available - you need to visit a SSL Site first!")
    elsif Watobo::Scope.exist?
       @sites_combo.appendItem("no site for defined scope", nil)
    end
  end

end