Skip to content

Commit

Permalink
create_exploit(): adding vendor validation
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkz committed Jul 21, 2016
1 parent a84c088 commit d4d5935
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions routersploit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,14 @@ def create_exploit(path): # TODO: cover with tests
from .templates import exploit

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"
"Use following naming convention: module_type/vendor_name/exploit_name\n"
"e.g. exploits/dlink/password_disclosure".format(name))
Expand Down

0 comments on commit d4d5935

Please sign in to comment.