-
-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom wordlist functionality addition for scan modules #1026
base: master
Are you sure you want to change the base?
Conversation
@pUrGe12 custom wordlist functionality existed in Nettacker for many years it is just not well documented . Some of the improvements in PR1026 are sill welcome (e.g. you are welcome to add the new '-W' argument to define the wordlist to make the feature easier to use) Here is how to use the custom wordlist feature - add this to the command lie:
by default the relative path is assumed to be
Can you please update your PR (or submit a new one) which just sets the 'read_from_file' based on the '-W' argument. The rest of Nettacker (e.g. modules, fuzzer) do not need to be modified - the feature is already built-in! |
Updated based on the suggestion! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be simplified even further - please review/amend this PR
nettacker/config.py
Outdated
@@ -127,6 +127,7 @@ class DefaultSettings(ConfigBase): | |||
scan_subdomains = False | |||
selected_modules = None | |||
url_base_path = None | |||
user_wordlist = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not necessary
nettacker/core/arg_parser.py
Outdated
"--wordlist", | ||
action="store", | ||
dest="user_wordlist", | ||
default=Config.settings.user_wordlist, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 'read_from_file' nor user_wordlist - there is no value in creating unnecessary setting/variable
nettacker/core/module.py
Outdated
@@ -39,6 +39,9 @@ def __init__( | |||
self.module_inputs[module_extra_args] = self.module_inputs["modules_extra_args"][ | |||
module_extra_args | |||
] | |||
if options.user_wordlist: | |||
self.module_inputs["read_from_file"] = options.user_wordlist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary copy - just use 'read_from_file' - no need to create an additional user_wordlist, only to copy it into 'read_from_file'
nettacker/locale/en.yaml
Outdated
@@ -35,6 +35,7 @@ cannot_run_api_server: You can't run API Server through itself! | |||
error_target: Cannot specify the target(s) | |||
error_target_file: "Cannot specify the target(s), unable to open file: {0}" | |||
error_username: "Cannot specify the username(s), unable to open file: {0}" | |||
error_wordlist: "Unable to open wordlist file: {0}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary
have made the required changes. |
"-W", | ||
"--wordlist", | ||
action="store", | ||
dest="read_from_file", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you lost help and default here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I add a "read_from_file" variable in config and set that to none for default or just specify None
here itself? I'll have to edit config to set default right?
nettacker/core/module.py
Outdated
@@ -39,6 +39,7 @@ def __init__( | |||
self.module_inputs[module_extra_args] = self.module_inputs["modules_extra_args"][ | |||
module_extra_args | |||
] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary empty line here
Proposed change
As discussed in issue #1025, users cannot use their own wordlist through the command line (they will have to go and change the path in config.py). I have added a command line argument that allows users to enter a path to their wordlist. If they don't then the defaults are used.
Your PR description goes here.
Type of change
Checklist
make pre-commit
, it didn't generate any changesmake test
, all tests passed locally