From 7d25c2c636a2d818334336f648d0e25c1e99e376 Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Mon, 1 Jul 2024 13:33:21 +0200 Subject: [PATCH 1/2] Added function is_anonymous --- smbclientng/core/Credentials.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/smbclientng/core/Credentials.py b/smbclientng/core/Credentials.py index e04fb92..6fcd180 100644 --- a/smbclientng/core/Credentials.py +++ b/smbclientng/core/Credentials.py @@ -79,6 +79,24 @@ def set_hashes(self, hashes): self.nt_hex = nthash self.nt_raw = binascii.unhexlify(nthash) + def is_anonymous(self): + """ + Determines if the credentials are anonymous. + + This method checks if the username is None or an empty string to determine if the credentials are anonymous. + + Returns: + bool: True if the credentials are anonymous, False otherwise. + """ + anonymous = False + if self.username is None: + anonymous = True + elif len(self.username) == 0: + anonymous = True + else: + anonymous = False + return anonymous + def canPassTheHash(self): """ Determines if the current credentials can be used for a pass-the-hash attack. From 7bf1fa69ac2a3ab6cd3487c45a945dd42d58ee78 Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:33:44 +0200 Subject: [PATCH 2/2] Release 2.1 --- README.md | 2 +- pyproject.toml | 2 +- setup.py | 4 ++-- smbclientng/__main__.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 15119ff..5c3670f 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ $ ./smbclient-ng.py -h / __| '_ ` _ \| '_ \ / __| | |/ _ \ '_ \| __|____| '_ \ / _` | \__ \ | | | | | |_) | (__| | | __/ | | | ||_____| | | | (_| | |___/_| |_| |_|_.__/ \___|_|_|\___|_| |_|\__| |_| |_|\__, | - by @podalirius_ v2.0 |___/ + by @podalirius_ v2.1 |___/ usage: smbclient-ng.py [-h] [--debug] [--no-colors] [-S startup_script] [-N] --host HOST [--port PORT] [--kdcHost FQDN KDC] [-d DOMAIN] [-u USER] [--no-pass | -p [PASSWORD] | -H diff --git a/pyproject.toml b/pyproject.toml index d3c13b6..11a8cca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "smbclientng" -version = "2.0" +version = "2.1" description = "smbclient-ng, a fast and user friendly way to interact with SMB shares." authors = ["p0dalirius"] diff --git a/setup.py b/setup.py index 26acb75..a642777 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ import setuptools -VERSION = "2.0" +VERSION = "2.1" long_description = """ @@ -85,7 +85,7 @@ / __| '_ ` _ \| '_ \ / __| | |/ _ \ '_ \| __|____| '_ \ / _` | \__ \ | | | | | |_) | (__| | | __/ | | | ||_____| | | | (_| | |___/_| |_| |_|_.__/ \___|_|_|\___|_| |_|\__| |_| |_|\__, | - by @podalirius_ v2.0 |___/ + by @podalirius_ v2.1 |___/ usage: smbclient-ng.py [-h] [--debug] [--no-colors] [-S startup_script] [-N] --host HOST [--port PORT] [--kdcHost FQDN KDC] [-d DOMAIN] [-u USER] [--no-pass | -p [PASSWORD] | -H diff --git a/smbclientng/__main__.py b/smbclientng/__main__.py index 411619a..3c80cf7 100644 --- a/smbclientng/__main__.py +++ b/smbclientng/__main__.py @@ -13,7 +13,7 @@ from smbclientng.core.SessionsManager import SessionsManager -VERSION = "2.0" +VERSION = "2.1" def parseArgs():