Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module extract #74

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import setuptools


VERSION = "2.0"
VERSION = "2.1"


long_description = """
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smbclientng/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from smbclientng.core.SessionsManager import SessionsManager


VERSION = "2.0"
VERSION = "2.1"


def parseArgs():
Expand Down
18 changes: 18 additions & 0 deletions smbclientng/core/Credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading