Skip to content

Commit

Permalink
Merge pull request #74 from p0dalirius/module-extract
Browse files Browse the repository at this point in the history
Module extract
  • Loading branch information
p0dalirius authored Jul 2, 2024
2 parents 09f1d18 + 7bf1fa6 commit c5b77d7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
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

0 comments on commit c5b77d7

Please sign in to comment.