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

Commit 0a49f75

Browse files
author
mpgn
authored
Merge pull request #381 from byt3bl33d3r/v5-dev
Some fix pushed in to v5.0.2
2 parents 618ab8a + 9e0f4c2 commit 0a49f75

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Supported Python versions](https://img.shields.io/badge/python-3.6+-blue.svg)
1+
![Supported Python versions](https://img.shields.io/badge/python-3.8+-blue.svg)
22

33
# CrackMapExec
44

@@ -46,5 +46,4 @@ If you use CrackMapExec a lot (especially if it's used commercially), please con
4646
Press the "Sponsor" button on the top of this page to see ways of donating/sponsoring this project.
4747

4848
# To do
49-
- Kerberos support
5049
- ~~0wn everything~~

cme/connection.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def login(self):
181181
tmp = usr
182182
usr = tmp.split('\\')[1].strip()
183183
self.domain = tmp.split('\\')[0]
184-
if self.args.hash:
184+
if hasattr(self.args, 'hash') and self.args.hash:
185185
with sem:
186186
for ntlm_hash in self.args.hash:
187187
if isinstance(ntlm_hash, str):
@@ -205,19 +205,28 @@ def login(self):
205205
for password in self.args.password:
206206
if isinstance(password, str):
207207
if not self.over_fail_limit(usr.strip()):
208-
if self.plaintext_login(self.domain, usr.strip(), password): return True
208+
if hasattr(self.args, 'domain'):
209+
if self.plaintext_login(self.domain, usr.strip(), password): return True
210+
else:
211+
if self.plaintext_login(usr.strip(), password): return True
209212

210213
elif not isinstance(password, str) and isfile(password.name) and self.args.no_bruteforce == False:
211214
for f_pass in password:
212215
if not self.over_fail_limit(usr.strip()):
213-
if self.plaintext_login(self.domain, usr.strip(), f_pass.strip()): return True
216+
if hasattr(self.args, 'domain'):
217+
if self.plaintext_login(self.domain, usr.strip(), f_pass.strip()): return True
218+
else:
219+
if self.plaintext_login(usr.strip(), f_pass.strip()): return True
214220
password.seek(0)
215221

216222
elif not isinstance(password, str) and isfile(password.name) and self.args.no_bruteforce == True:
217223
user.seek(0)
218224
for usr, f_pass in zip(user, password):
219225
if not self.over_fail_limit(usr.strip()):
220-
if self.plaintext_login(self.domain, usr.strip(), f_pass.strip()): return True
226+
if hasattr(self.args, 'domain'):
227+
if self.plaintext_login(self.domain, usr.strip(), f_pass.strip()): return True
228+
else:
229+
if self.plaintext_login(usr.strip(), f_pass.strip()): return True
221230

222231
elif isinstance(user, str):
223232
if hasattr(self.args, 'hash') and self.args.hash:

cme/protocols/smb.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,9 @@ def enum_host_info(self):
237237

238238
if self.args.domain:
239239
self.domain = self.args.domain
240-
241-
# always print FQDN even if local auth
242-
# if self.args.local_auth:
243-
# self.domain = self.hostname
240+
241+
if self.args.local_auth:
242+
self.domain = self.hostname
244243

245244
#Re-connect since we logged off
246245
self.create_conn_obj()

cme/protocols/ssh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ssh(connection):
1212
@staticmethod
1313
def proto_args(parser, std_parser, module_parser):
1414
ssh_parser = parser.add_parser('ssh', help="own stuff using SSH", parents=[std_parser, module_parser])
15+
ssh_parser.add_argument("--no-bruteforce", action='store_true', help='No spray when using file for username and password (user1 => password1, user2 => password2')
1516
#ssh_parser.add_argument("--key-file", type=str, help="Authenticate using the specified private key")
1617
ssh_parser.add_argument("--port", type=int, default=22, help="SSH port (default: 22)")
1718

0 commit comments

Comments
 (0)