File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -539,12 +539,18 @@ def create_exploit(path): # TODO: cover with tests
539539 parts = path .split (os .sep )
540540 module_type , name = parts [0 ], parts [- 1 ]
541541
542- if not name :
543- print_error ("Invalid exploit name. ;(" )
542+ if len (parts ) == 1 or not name :
543+ print_error ("Invalid exploit name: '{}'\n "
544+ "Use following naming convention: module_type/vendor_name/exploit_name\n "
545+ "e.g. exploits/dlink/password_disclosure" .format (name ))
544546 return
545547
546- if module_type not in ['creds' , 'exploits' , 'scanners' ]:
547- print_error ("Invalid module type. ;(" )
548+ types = ['creds' , 'exploits' , 'scanners' ]
549+ if module_type not in types :
550+ print_error ("Invalid module type: '{}'\n "
551+ "Available types: {}\n "
552+ "Use following naming convention: module_type/vendor_name/exploit_name\n "
553+ "e.g. exploits/dlink/password_disclosure" .format (module_type , types ))
548554 return
549555
550556 create_resource (
You can’t perform that action at this time.
0 commit comments