Class: Watobo::Gui::ActionSelect

Inherits:
FXVerticalFrame
  • Object
show all
Includes:
Watobo
Defined in:
lib/watobo/gui/fuzzer_gui.rb

Constant Summary

Constants included from Watobo

LICENSE, VERSION

Instance Method Summary collapse

Methods included from Watobo

active_checks, active_module_path, base_directory, create_project, create_request, init_framework, load_chat, load_defaults, log, logs, passive_checks, passive_module_path, plugin_path, print_debug, project, project_name, running_projects, save_proxy_settings, save_proxy_settings_UNUSED, save_thread, save_thread_UNUSED, session_name, temp_directory, version, working_directory, workspace_path, workspace_path=

Constructor Details

#initialize(owner, interface, opts) ⇒ ActionSelect

Returns a new instance of ActionSelect.



819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
# File 'lib/watobo/gui/fuzzer_gui.rb', line 819

def initialize(owner, interface, opts)
  super(owner, opts)

  @interface = interface

  group_box = FXGroupBox.new(self, "Select Action", LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0)
  @source_dt = FXDataTarget.new(0)

  @source_dt.connect(SEL_COMMAND) do
    @b64_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
    @url_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
    @md5_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
    @ruby_proc_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
    if @source_dt.value != 3
      @textbox.enabled = false
      @textbox.backColor = FXColor::LightGrey
    else
      @textbox.enabled = true
      @textbox.backColor = FXColor::White
    end

  end

  begin
    frame = FXVerticalFrame.new(group_box, LAYOUT_FILL_X)
    @b64_rb = FXRadioButton.new(frame, "Encode Base64", @source_dt, FXDataTarget::ID_OPTION)

    frame = FXVerticalFrame.new(group_box, LAYOUT_FILL_X)
    @url_rb = FXRadioButton.new(frame, "Encode URL", @source_dt, FXDataTarget::ID_OPTION + 1)
    #      @textbox = FXText.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :width => 100, :height => 100)

    frame = FXHorizontalFrame.new(group_box, :opts => LAYOUT_FILL_X)
    @md5_rb = FXRadioButton.new(frame, "Hash MD5", @source_dt, FXDataTarget::ID_OPTION + 2)

    frame = FXVerticalFrame.new(group_box, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
    @ruby_proc_rb = FXRadioButton.new(frame, "Ruby Proc", @source_dt, FXDataTarget::ID_OPTION + 3)
    text_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_THICK|FRAME_SUNKEN, :padding => 0)
    @textbox = FXText.new(text_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :width => 100, :height => 100)
    proc_skeleton = "proc { |input|\n# place your code betweenhere\n# e.g. 'input + \"TAIL\"\n\n\n# and here\n}"
    @textbox.setText(proc_skeleton)
    @textbox.enabled = false
    @textbox.backColor = FXColor::LightGrey


      # @textbox.editable = true
  rescue => bang
    puts "AAAAAA"
    puts bang
  end
  updateFields()

end

Instance Method Details

#createActionObject



775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
# File 'lib/watobo/gui/fuzzer_gui.rb', line 775

def createAction()
  action = case @source_dt.value
             when 0
               action_proc = proc { |input| Base64.encode64(input) }
               Action.new(action_proc, :action_type => 'Encode: Base64')
             when 1
               action_proc = proc { |input| CGI::escape(input) }
               Action.new(action_proc, :action_type => 'Encode: URL')
             when 2
               action_proc = proc { |input| Digest::MD5.hexdigest(input) }
               Action.new(action_proc, :action_type => 'Hash: MD5')
             when 3
               begin
                 #  puts "* Action: Proc"
                 # puts @textbox.to_s
                 code = @textbox.to_s
                 action_proc = eval(code)
                   # puts action_proc

               rescue SyntaxError => bang
                 puts bang
                 puts code
               rescue LocalJumpError => bang
                 puts bang
                 puts code
               rescue SecurityError => bang
                 puts "desired functionality forbidden. it may harm your system!"
                 puts code
               rescue => bang
                 puts bang
                 puts code

               end
               if action_proc
                 Action.new(action_proc, :action_type => "Ruby: Proc", :info => "#{@textbox.to_s}")
               else
                 nil
               end
           end

  return action
end

#updateFieldsObject



767
768
769
770
771
772
773
# File 'lib/watobo/gui/fuzzer_gui.rb', line 767

def updateFields
  @b64_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
  @url_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
  @md5_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)
  @ruby_proc_rb.handle(self, FXSEL(SEL_UPDATE, 0), nil)

end