-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
134 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[arsenal] | ||
fuzzing_dirs = ["/usr/local/share/wordlists/**/*.txt"] | ||
use_builtin_cheats = yes | ||
user_cheats_paths = ["~/.cheats"] | ||
formats = ["md", "rst", "yml"] | ||
exclude_list = ["README.md", "README.rst", "index.rst"] | ||
savevarfile = "~/.arsenal.json" | ||
prefix_globalvar_name = "arsenal_prefix_cmd" | ||
|
||
|
||
|
||
[colors] | ||
basic_color = 0 | ||
col1_color = 7 | ||
; gold | ||
col2_color = 4 | ||
; purple light | ||
col3_color = 14 | ||
; 26 ; violet clair: 14 ; 4 yellow ; 6 purple ; 7 cyan ; 9 dark grey | ||
col4_color = 5 | ||
; blue | ||
col5_color = 5 | ||
; output std invert | ||
col1_color_select = 256 | ||
col2_color_select = 256 | ||
col3_color_select = 256 | ||
col4_color_select = 256 | ||
; background red | ||
cursor_color_select = 266 | ||
prompt_color = 0 | ||
info_name_color = 4 | ||
info_desc_color = 0 | ||
info_cmd_color = 0 | ||
arg_name_color = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,72 @@ | ||
import configparser | ||
import os | ||
from os.path import dirname, abspath, expanduser, join | ||
from ast import literal_eval | ||
|
||
# Base paths | ||
DATAPATH = join(dirname(dirname(abspath(__file__))), 'data') | ||
BASEPATH = dirname(dirname(dirname(abspath(__file__)))) | ||
DEFAULT_CONFIG_PATH = join(DATAPATH, "arsenal.conf") | ||
CONFIG_PATH = expanduser("~/.arsenal.conf") | ||
HOMEPATH = expanduser("~") | ||
FORMATS = ["md", "rst", "yml"] | ||
EXCLUDE_LIST = ["README.md", "README.rst", "index.rst"] | ||
FUZZING_DIRS = ["/usr/local/share/wordlists/**/*.txt"] | ||
|
||
CHEATS_PATHS = [ | ||
join(DATAPATH, "cheats"), # DEFAULT | ||
# Additional paths below, add comma to line above | ||
join(BASEPATH, "my_cheats"), | ||
join(HOMEPATH, ".cheats") | ||
] | ||
|
||
DEFAULT_CHEATS_PATHS = [join(DATAPATH, "cheats")] | ||
messages_error_missing_arguments = 'Error missing arguments' | ||
|
||
# set lower delay to use ESC key (in ms) | ||
os.environ.setdefault('ESCDELAY', '25') | ||
os.environ['TERM'] = 'xterm-256color' | ||
|
||
savevarfile = join(HOMEPATH, ".arsenal.json") | ||
arsenal_default_config = configparser.ConfigParser() | ||
arsenal_default_config.read(DEFAULT_CONFIG_PATH) | ||
|
||
arsenal_config = configparser.ConfigParser() | ||
arsenal_config.read(CONFIG_PATH) | ||
|
||
|
||
# Update config in case default have been extended or use has | ||
# removed requiered | ||
config_updated = False | ||
for section in arsenal_default_config.sections(): | ||
if not arsenal_config.has_section(section): | ||
arsenal_config.add_section(section) | ||
config_updated = True | ||
for option in arsenal_default_config.options(section): | ||
if not arsenal_config.has_option(section, option): | ||
config_updated = True | ||
arsenal_config.set(section, option, arsenal_default_config.get(section, option)) | ||
|
||
if config_updated: | ||
with open(CONFIG_PATH, "w") as config_file: | ||
arsenal_config.write(config_file) | ||
|
||
CHEATS_PATHS= [] | ||
use_builtin_cheats = arsenal_config.getboolean("arsenal", "use_builtin_cheats") | ||
user_cheats_paths = literal_eval(arsenal_config.get("arsenal", "user_cheats_paths")) | ||
|
||
for p in user_cheats_paths: | ||
CHEATS_PATHS.append(expanduser(p)) | ||
if use_builtin_cheats: | ||
CHEATS_PATHS += DEFAULT_CHEATS_PATHS | ||
|
||
savevarfile = arsenal_config.get("arsenal", "savevarfile") | ||
FORMATS = literal_eval(arsenal_config.get("arsenal", "formats")) | ||
EXCLUDE_LIST = literal_eval(arsenal_config.get("arsenal", "exclude_list")) | ||
FUZZING_DIRS = literal_eval(arsenal_config.get("arsenal", "fuzzing_dirs")) | ||
PREFIX_GLOBALVAR_NAME = arsenal_config.get("arsenal", "prefix_globalvar_name") | ||
|
||
PREFIX_GLOBALVAR_NAME = "arsenal_prefix_cmd" | ||
BASIC_COLOR = arsenal_config.getint("colors", "basic_color") | ||
COL1_COLOR = arsenal_config.getint("colors", "col1_color") | ||
COL2_COLOR = arsenal_config.getint("colors", "col2_color") | ||
COL3_COLOR = arsenal_config.getint("colors", "col3_color") | ||
COL4_COLOR = arsenal_config.getint("colors", "col4_color") | ||
COL5_COLOR = arsenal_config.getint("colors", "col5_color") | ||
COL1_COLOR_SELECT = arsenal_config.getint("colors", "col1_color_select") | ||
COL2_COLOR_SELECT = arsenal_config.getint("colors", "col2_color_select") | ||
COL3_COLOR_SELECT = arsenal_config.getint("colors", "col3_color_select") | ||
COL4_COLOR_SELECT = arsenal_config.getint("colors", "col4_color_select") | ||
CURSOR_COLOR_SELECT = arsenal_config.getint("colors", "cursor_color_select") | ||
PROMPT_COLOR = arsenal_config.getint("colors", "prompt_color") | ||
INFO_NAME_COLOR = arsenal_config.getint("colors", "info_name_color") | ||
INFO_DESC_COLOR = arsenal_config.getint("colors", "info_desc_color") | ||
INFO_CMD_COLOR = arsenal_config.getint("colors", "info_cmd_color") | ||
ARG_NAME_COLOR = arsenal_config.getint("colors", "arg_name_color") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters