Release 2.1.6, Fixed #84

This commit is contained in:
Remi GASCOU (Podalirius)
2024-10-03 16:14:26 +02:00
parent 91ea799bf6
commit 0184867925
6 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "smbclientng"
version = "2.1.5"
version = "2.1.6"
description = "smbclient-ng, a fast and user friendly way to interact with SMB shares."
authors = ["p0dalirius"]
+1 -1
View File
@@ -7,7 +7,7 @@
import setuptools
VERSION = "2.1.5"
VERSION = "2.1.6"
long_description = """
+5 -3
View File
@@ -13,7 +13,7 @@ from smbclientng.core.Logger import Logger
from smbclientng.core.SessionsManager import SessionsManager
VERSION = "2.1.5"
VERSION = "2.1.6"
def parseArgs():
@@ -31,7 +31,8 @@ def parseArgs():
parser.add_argument("-S", "--startup-script", metavar="startup_script", required=False, type=str, help="File containing the list of commands to be typed at start of the console.")
parser.add_argument("-N", "--not-interactive", dest="not_interactive", required=False, action="store_true", default=False, help="Non interactive mode.")
parser.add_argument("-L", "--logfile", dest="logfile", metavar="LOGFILE", required=False, default=None, type=str, help="File to write logs to.")
parser.add_argument( "--timeout", dest="timeout", metavar="TIMEOUT", required=False, type=float, default=3, help="Timeout in seconds for SMB connections (default: 3)")
parser.add_argument("--timeout", dest="timeout", metavar="TIMEOUT", required=False, type=float, default=3, help="Timeout in seconds for SMB connections (default: 3)")
parser.add_argument("--advertised-name", dest="advertisedName", metavar="ADVERTISED_NAME", required=False, type=str, help="Advertised name of your machine to the SMB client.")
group_target = parser.add_argument_group("Target")
group_target.add_argument("--host", action="store", metavar="HOST", required=True, type=str, help="IP address or hostname of the SMB Server to connect to.")
@@ -113,7 +114,7 @@ def main():
sessionsManager = SessionsManager(config=config, logger=logger)
if any([(options.auth_domain != '.'), (options.auth_username is not None), (options.auth_password is not None),(options.auth_hashes is not None)]):
if any([(options.auth_domain != '.'), (options.auth_username is not None), (options.auth_password is not None), (options.auth_hashes is not None)]):
credentials = Credentials(
domain=options.auth_domain,
username=options.auth_username,
@@ -128,6 +129,7 @@ def main():
host=options.host,
port=options.port,
timeout=options.timeout,
advertisedName=options.advertisedName
)
# Start the main interactive command line
+3 -1
View File
@@ -53,7 +53,7 @@ class SMBSession(object):
test_rights(sharename): Tests read and write access rights on a share.
"""
def __init__(self, host, port, timeout, credentials, config=None, logger=None):
def __init__(self, host, port, timeout, credentials, advertisedName=None, config=None, logger=None):
super(SMBSession, self).__init__()
# Objects
self.config = config
@@ -65,6 +65,7 @@ class SMBSession(object):
self.port = port
# Timeout (default 3 seconds)
self.timeout = timeout
self.advertisedName = advertisedName
# Credentials
self.credentials = credentials
@@ -125,6 +126,7 @@ class SMBSession(object):
self.smbClient = impacket.smbconnection.SMBConnection(
remoteName=self.host,
remoteHost=self.host,
myName=self.advertisedName,
sess_port=int(self.port),
timeout=self.timeout,
)
+3 -1
View File
@@ -38,7 +38,7 @@ class SessionsManager(object):
self.config = config
self.logger = logger
def create_new_session(self, credentials, host, timeout, port=445):
def create_new_session(self, credentials, host, timeout, port=445, advertisedName=None):
"""
Creates a new session with the given session information.
@@ -54,6 +54,7 @@ class SessionsManager(object):
port=port,
timeout=timeout,
credentials=credentials,
advertisedName=advertisedName,
config=self.config,
logger=self.logger
)
@@ -127,6 +128,7 @@ class SessionsManager(object):
# Create
mode_create = ModuleArgumentParser(add_help=False, description="Create a new session.")
mode_create.add_argument("--advertised-name", dest="advertisedName", metavar="ADVERTISED_NAME", required=False, type=str, help="Advertised name of your machine to the SMB client.")
group_target = mode_create.add_argument_group("Target")
group_target.add_argument("--host", action="store", metavar="HOST", required=True, type=str, help="IP address or hostname of the SMB Server to connect to.")
group_target.add_argument("--port", action="store", metavar="PORT", type=int, default=445, help="Port of the SMB Server to connect to. (default: 445)")
+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/bash
python3 main.py -d 'LAB' -u 'Administrator' -p 'Admin123!' --host '192.168.56.106' ${@}
python3 main.py -d 'LAB' -u 'Administrator' -p 'Admin123!' --host '10.0.0.201' ${@}