Class: Aspisec::Modules::Sqlmap — Documentation by YARD 0.9.36

# Class: Aspisec::Modules::Sqlmap

Inherits:
  Aspisec::Module
  - Object
  - Aspisec::Module
  - Aspisec::Modules::Sqlmap
  show all

Defined in:
  lib-ruby/aspisec/modules/sqlmap.rb

## Overview

Sqlmap module.
Inherits Aspisec::Module.

Examples:

    # Get the global config
    conf = Aspisec::Config.new.conf
    # Create a Sqlmap module instance
    sqlmap = Aspisec::Modules::Sqlmap.new(conf)
    # Generic methods
    sqlmap.name # => "sqlmap"
    sqlmap.conf # => {…}
    sqlmap.enabled? # => true
    sqlmap.base # => #<Pathname:/home/noraj/.local/share/sqlmap>
    sqlmap.locations_list # => ["history", "logs"]
    sqlmap.locations # => [#<Aspisec::Module::Location …>, … ]
    # Custom methods for the feature/file/directory location of Sqlmap to clean
    sqlmap.history # => #<Aspisec::Module::Location …>
    sqlmap.logs # => #<Aspisec::Module::Location …>
    # But those custom locations benefits of generic methods
    sqlmap.history.enabled? # => true
    sqlmap.history.name # => => "history"
    sqlmap.history.description # => "Directory containing…"
    sqlmap.history.path => #<Pathname:/home/noraj/.local/share/sqlmap/history>
    # Since `.path` returns a {Pathname} object, we can use generic {File},
    # {FileTest} methods and some from {Dir} and {FileUtils} as well.
    sqlmap.history.path.exist? # => true
    sqlmap.history.path.file? # => false
    sqlmap.history.path.directory? # => true
    sqlmap.history.path.readable? # => true
    sqlmap.history.path.children # => [#<Pathname:/home/noraj/.local/share/sqlmap/history/os.hst>, #<Pathname:…>]
    sqlmap.history.path.children.first.size # => 10

See Also:

- https://github.com/sqlmapproject/sqlmap

## Instance Attribute Summary collapse

- #history ⇒ Location readonly

  see Config::DEFAULT_CONFIG or call Aspisec::Module::Location#description.

- #logs ⇒ Location readonly

  see Config::DEFAULT_CONFIG or call Aspisec::Module::Location#description.

### Attributes inherited from Aspisec::Module

#base, #conf, #locations_list, #name

## Instance Method Summary collapse

- #initialize(conf, logger: nil) ⇒ Sqlmap constructor

  Inherits from Aspisec::Module but has only the `conf` argument, `tool_name` is hardcoded for each module.

### Methods inherited from Aspisec::Module

#check_config, #enabled?, #locations

## Constructor Details

### #initialize(conf, logger: nil) ⇒ `Sqlmap`

Inherits from Aspisec::Module but has only the `conf` argument,
`tool_name` is hardcoded for each module.

Parameters:

- conf (`Aspisec::Config`) —

  an instance of the global configuration

    50
    51
    52
    53
    54
    55
    # File 'lib-ruby/aspisec/modules/sqlmap.rb', line 50

    def initialize(conf, logger: nil)
      super(conf, 'sqlmap', logger:)
      @history = Location.new(@conf, 'history')
      @logs = Location.new(@conf, 'logs')
      @locations_list = %w[history logs]
    end

## Instance Attribute Details

### #history ⇒ `Location` (readonly)

see Config::DEFAULT_CONFIG or call Aspisec::Module::Location#description.

Returns:

- (`Location`)

    41
    42
    43
    # File 'lib-ruby/aspisec/modules/sqlmap.rb', line 41

    def history
      @history
    end

### #logs ⇒ `Location` (readonly)

see Config::DEFAULT_CONFIG or call Aspisec::Module::Location#description.

Returns:

- (`Location`)

    45
    46
    47
    # File 'lib-ruby/aspisec/modules/sqlmap.rb', line 45

    def logs
      @logs
    end