Compare commits

...
3 Commits
Author SHA1 Message Date
Rémi GASCOU (Podalirius) 3a8a902a58 Update README to include smbclient-ng information
Added a note about the new smbclient-ng project written in Go.
2026-07-21 09:16:09 +02:00
someyackandDylab 58fbd9e4b6 Add support for domain-qualified usernames (#207)
Co-authored-by: Dylab <dylan@yack.one>
2026-07-10 07:20:08 +02:00
lapinou a40eb121ef fix(pth): fix pth with a LM:NT hash (#206) 2026-07-10 07:20:03 +02:00
5 changed files with 37 additions and 5 deletions
+5
View File
@@ -10,6 +10,11 @@
<br>
</p>
> [!NOTE]
> Check out the new smbclient-ng written in Go, faster and cross platform by default!
>
> https://github.com/TheManticoreProject/smbclient-ng
## Features
- [x] `acls`: List ACLs of files and folders in cwd. Syntax: `acls`
+9 -2
View File
@@ -90,7 +90,11 @@ def parseArgs():
"-d", "--domain", default=".", type=str, help="Authentication domain."
)
group_auth.add_argument(
"-u", "--user", type=str, default="", help="Username for authentication."
"-u",
"--user",
type=str,
default="",
help=r"Username for authentication. Supports DOMAIN\user.",
)
group_auth.add_argument(
"-k", "--kerberos", action="store_true", help="Use Kerberos authentication."
@@ -132,8 +136,11 @@ def parseArgs():
if options.user and not (options.password or options.no_pass or options.hashes or options.ccache_file or options.kerberos):
from getpass import getpass
prompt_domain, prompt_username = Credentials.parse_domain_username(
domain=options.domain, username=options.user
)
options.password = getpass(
f" | Provide a password for '{options.domain}\\{options.user}': "
f" | Provide a password for '{prompt_domain}\\{prompt_username}': "
)
if options.aes_key or options.ccache_file:
+1 -1
View File
@@ -213,7 +213,7 @@ class SessionsManager(object):
dest="auth_username",
metavar="USER",
action="store",
help="User to authenticate with.",
help=r"User to authenticate with. Supports DOMAIN\user.",
)
secret = mode_create.add_argument_group()
cred = secret.add_mutually_exclusive_group()
+18 -2
View File
@@ -61,8 +61,9 @@ class Credentials(object):
):
super(Credentials, self).__init__()
# Identity
self.domain = domain
self.username = username
self.domain, self.username = self.parse_domain_username(
domain=domain, username=username
)
self.password = password
# Hashes
@@ -74,6 +75,21 @@ class Credentials(object):
self.aesKey = aesKey
self.ccacheFile = ccacheFile
@staticmethod
def parse_domain_username(
domain: str, username: Optional[str]
) -> tuple[str, Optional[str]]:
if username is None:
return domain, username
for separator in ("\\", "/"):
if separator in username:
user_domain, user_name = username.split(separator, 1)
if user_domain and user_name:
return user_domain, user_name
return domain, username
def set_hashes(self, hashes: Optional[str]):
"""
Sets the LM and NT hashes for the credentials.
+4
View File
@@ -61,6 +61,10 @@ def parse_lm_nt_hashes(lm_nt_hashes_string: str) -> tuple[str, str]:
elif m_lm_hash is not None and m_nt_hash is None:
lm_hash_value = m_lm_hash
nt_hash_value = "31d6cfe0d16ae931b73c59d7e0c089c0"
else:
lm_hash_value = m_lm_hash
nt_hash_value = m_nt_hash
return lm_hash_value, nt_hash_value