the-useless-one / pywerview

A (partial) Python rewriting of PowerSploit's PowerView
GNU General Public License v3.0
909 stars 113 forks source link

Use add_argument's required parameter for those parameters that are required #2

Closed asolino closed 8 years ago

asolino commented 8 years ago

For example, when trying to use the invoke-checklocaladminaccess action, you get:

usage: pywerview.py invoke-checklocaladminaccess [-h] [-w DOMAIN] -u USER
                                                 [-p PASSWORD]
                                                 [--hashes LMHASH:NTHASH]
                                                 [--computername TARGET_COMPUTERNAME]

but, if you don't specify computername parameter the module will fail.. and.. I think you really need to specify it ;). In the same way as the USER parameter, you can define computername this way:

    invoke_checklocaladminaccess_parser.add_argument('--computername', required=True, dest='target_computername',
            help='Computer to test local admin access on')

and will force the script to check that parameter was provided.

I saw this happening on other actions as well.

the-useless-one commented 8 years ago

Yep, this problem was also present for other commands (basically, commands targeting domain computers, and not domain controllers). Should be fixed now, thanks!