Commit d4d59353 by fwkz

create_exploit(): adding vendor validation

parent a84c0882
...@@ -537,9 +537,14 @@ def create_exploit(path): # TODO: cover with tests ...@@ -537,9 +537,14 @@ def create_exploit(path): # TODO: cover with tests
from .templates import exploit from .templates import exploit
parts = path.split(os.sep) parts = path.split(os.sep)
module_type, name = parts[0], parts[-1] module_type, vendor, name = parts[0], [1], parts[-1]
if len(parts) < 3:
print_error("Invalid format. "
"Use following naming convention: module_type/vendor_name/exploit_name\n"
"e.g. exploits/dlink/password_disclosure".format(name))
return
if len(parts) == 1 or not name: if not name:
print_error("Invalid exploit name: '{}'\n" print_error("Invalid exploit name: '{}'\n"
"Use following naming convention: module_type/vendor_name/exploit_name\n" "Use following naming convention: module_type/vendor_name/exploit_name\n"
"e.g. exploits/dlink/password_disclosure".format(name)) "e.g. exploits/dlink/password_disclosure".format(name))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment