Skip to content

Commit

Permalink
Added config item to ignore organizational directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
curi0usJack committed Aug 7, 2018
1 parent 1f77cfa commit 492c6f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/ptf.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### This is the base directory where PTF will install the files
BASE_INSTALL_PATH="/pentest"

### Place tools in organizational directories (e.g. exploitation, intelligence-gathering, etc). If set to "False", all tools will be installed in the BASE_INSTALL_PATH
USE_DIRECTORY_ORGANIZATION="True"

### Specify the output log file
LOG_PATH="src/logs/ptf.log"

Expand Down
15 changes: 13 additions & 2 deletions src/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,22 @@ def use_module(module, all_trigger):

# grab install path
base_install = check_config("BASE_INSTALL_PATH=")
strorganize_dirs = check_config("USE_DIRECTORY_ORGANIZATION=")
install_base_location = module_parser(filename, "INSTALL_LOCATION")
module_split = module.split("/")
module_split = module_split[1]
install_location = os.path.expanduser(base_install + "/" + \
module_split + "/" + install_base_location + "/")

if strorganize_dirs == "False":
organize_dirs = False
else:
# Default to True
organize_dirs = True

if bool(organize_dirs) == True:
install_location = os.path.expanduser(base_install + "/" + \
module_split + "/" + install_base_location + "/")
else:
install_location = base_install + "/" + install_base_location + "/"


while 1:
Expand Down

0 comments on commit 492c6f0

Please sign in to comment.