Skip to content

Commit

Permalink
add dbgate module
Browse files Browse the repository at this point in the history
  • Loading branch information
azi-acceis committed Apr 25, 2024
1 parent e840936 commit 4055343
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## Fonctionnalités

- [23 outils](https://acceis.github.io/aspisec/#/pages/tools) pris en charge
- [24 outils](https://acceis.github.io/aspisec/#/pages/tools) pris en charge
- Modularité : le fichier de configuration complet vous permet d'affiner le comportement de chaque module
- Extensible : la conception du cadriciel facilite l'ajout d'un nouveau module
- Correct par défaut : les valeurs par défaut ont été soigneusement choisies pour refléter le comportement le plus attendu et le plus courant.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## Features

- [23 tools](https://acceis.github.io/aspisec/#/pages/tools) supported
- [24 tools](https://acceis.github.io/aspisec/#/pages/tools) supported
- Modularity: the comprehensive configuration file let you fine tune the behavior for every module
- Extensible: the framework design makes it easy to add a new module
- Nice by default: default values have been carefully chosen to reflect the most expected and common behavior
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Bloodhound
- ffuf
- Recaf
- dbgate
- **New features**
- Locations now support [globbing](https://ruby-doc.org/3.3.0/Dir.html#method-c-glob), useful when needing to remove several files in a directory while not removing the whole directory (e.g. log files with rotation in the same directory as the configuration file)
- **Quality**
Expand Down
4 changes: 0 additions & 4 deletions docs/pages/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

More modules:

- [ ] 🟥 ~/.dbgate + ~/.config/dbgate
- false by default
- connections.jsonl, target domain or IP
- [ ] 🟨 ~/.python_history
- [ ] 🟨 ~/.psql_history
- [ ] 🟨 ~/.irb_history
- [ ] 🟨 ~/.rdbg_history
- [ ] 🟨 ~/.rediscli_history
- [ ] 🟥 ~/.config/Recaf
- [ ] 🟨 ~/.bash_history
- [ ] 🟨 ~/.zsh_history
- [ ] 🟨 ~/.histfile
Expand Down
1 change: 1 addition & 0 deletions docs/pages/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The tools handled by Aspisec are (in alphabetical order):
- [Amass](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/Amass)
- [Bloodhound](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/Bloodhound)
- [Crackmapexec](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/Crackmapexec)
- [dbgate](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/Dbgate)
- [ffuf](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/Ffuf)
- [Hashcat](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/Hashcat)
- [John](https://acceis.github.io/aspisec/ruby/Aspisec/Modules/John)
Expand Down
3 changes: 2 additions & 1 deletion lib-ruby/aspisec/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class Config
'amass' => Configs::AMASS,
'bloodhound' => Configs::BLOODHOUND,
'ffuf' => Configs::FFUF,
'recaf' => Configs::RECAF
'recaf' => Configs::RECAF,
'dbgate' => Configs::DBGATE
},
'audit' => {
'enabled' => false,
Expand Down
25 changes: 25 additions & 0 deletions lib-ruby/aspisec/configs/dbgate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

module Aspisec
class Config
module Configs
DBGATE = {
'enabled' => true,
'location' => {
'base' => '$HOME/.dbgate', # ~/.dbgate
'connections' => {
'enabled' => false,
'path' => '<base>/connections.jsonl',
'description' => "File containing connection shortchuts.\n" \
'Connection objects contain target domain or IP address.'
},
'logs' => {
'path' => '<base>/logs',
'description' => "Logs folder.\n" \
"Those log events shouldn't contain customer information but who knows."
}
}
}.freeze
end
end
end
38 changes: 38 additions & 0 deletions lib-ruby/aspisec/modules/dbgate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true

require 'aspisec/module'

module Aspisec
module Modules
# dbgate module.
# Inherits {Aspisec::Module}.
# For more examples of methods, see {Aspisec::Modules::Sqlmap}.
# @see https://github.com/dbgate/dbgate
# @example
# # Get the global config
# conf = Aspisec::Config.new.conf
# # Create a Dbgate module instance
# dbg = Aspisec::Modules::Dbgate.new(conf)
# # Locations available
# dbg.locations_list # => ["connections", "logs"]
class Dbgate < Aspisec::Module
# see {Aspisec::Config::DEFAULT_CONFIG} or call {Aspisec::Module::Location#description}.
# @return [Location]
attr_reader :connections

# see {Aspisec::Config::DEFAULT_CONFIG} or call {Aspisec::Module::Location#description}.
# @return [Location]
attr_reader :logs

# Inherits from {Aspisec::Module} but has only the `conf` argument,
# `tool_name` is hardcoded for each module.
# @param conf [Aspisec::Config] an instance of the global configuration
def initialize(conf, logger: nil)
super(conf, 'dbgate', logger:)
@connections = Location.new(@conf, 'connections')
@logs = Location.new(@conf, 'logs')
@locations_list = %w[connections logs]
end
end
end
end

0 comments on commit 4055343

Please sign in to comment.