[ssh] conflict fix

Signed-off-by: XiaoliChan <2209553467@qq.com>
main
XiaoliChan 2023-10-18 20:12:25 +08:00
commit ac0fa8c3a0
3 changed files with 473 additions and 580 deletions

View File

@ -4,9 +4,10 @@
# author of the module : github.com/mpgn
# nanodump: https://github.com/helpsystems/nanodump
import os
import base64
import sys
import pypykatz
from pypykatz.pypykatz import pypykatz
import tempfile
from datetime import datetime
from nxc.helpers.bloodhound import add_user_bh
@ -59,7 +60,6 @@ class NXCModule:
self.useembeded = False
else:
self.nano_path = f"{tempfile.gettempdir()}"
self.dir_result = self.nano_path
if "NANO_EXE_NAME" in module_options:
@ -76,7 +76,7 @@ class NXCModule:
self.connection = connection
self.context = context
if self.useembeded:
with open(self.nano_path + self.nano, "wb") as nano:
with open(os.path.join(self.nano_path, self.nano), "wb") as nano:
if self.connection.os_arch == 32 and self.context.protocol == "smb":
self.context.log.display("32-bit Windows detected.")
nano.write(self.nano_embedded32)
@ -90,14 +90,14 @@ class NXCModule:
sys.exit(1)
if self.context.protocol == "smb":
with open(self.nano_path + self.nano, "rb") as nano:
with open(os.path.join(self.nano_path, self.nano), "rb") as nano:
try:
self.connection.conn.putFile(self.share, self.tmp_share + self.nano, nano.read)
self.context.log.success(f"Created file {self.nano} on the \\\\{self.share}{self.tmp_share}")
except Exception as e:
self.context.log.fail(f"Error writing file to share {self.share}: {e}")
else:
with open(self.nano_path + self.nano, "rb") as nano:
with open(os.path.join(self.nano_path, self.nano), "rb") as nano:
try:
self.context.log.display(f"Copy {self.nano} to {self.remote_tmp_dir}")
exec_method = MSSQLEXEC(self.connection.conn)
@ -154,7 +154,7 @@ class NXCModule:
if dump:
self.context.log.display(f"Copying {nano_log_name} to host")
filename = f"{self.dir_result}{self.connection.hostname}_{self.connection.os_arch}_{self.connection.domain}.log"
filename = os.path.join(self.dir_result,f"{self.connection.hostname}_{self.connection.os_arch}_{self.connection.domain}.log")
if self.context.protocol == "smb":
with open(filename, "wb+") as dump_file:
try:

1017
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -37,38 +37,38 @@ python = "^3.7.0"
requests = ">=2.27.1"
beautifulsoup4 = ">=4.11,<5"
lsassy = ">=3.1.8"
termcolor = "^1.1.0"
termcolor = "^2.3.0"
msgpack = "^1.0.0"
neo4j = "^4.1.1"
neo4j = "^4.1.1" # do not upgrade this until performance regression issues in 5 are fixed (as of 9/23)
pylnk3 = "^0.4.2"
pypsrp = "^0.7.0"
paramiko = "^3.3.1"
impacket = { git = "https://github.com/mpgn/impacket.git", branch = "gkdi" }
impacket = { git = "https://github.com/Pennyw0rth/impacket.git", branch = "gkdi" }
dsinternals = "^1.2.4"
xmltodict = "^0.12.0"
xmltodict = "^0.13.0"
terminaltables = "^3.1.0"
aioconsole = "^0.3.3"
pywerview = "^0.3.3"
minikerberos = "^0.4.0"
aioconsole = "^0.6.2"
pywerview = "^0.3.3" # pywerview 5 requires libkrb5-dev installed which is not default on kali (as of 9/23)
minikerberos = "^0.4.1"
pypykatz = "^0.6.8"
aardwolf = "^0.2.7"
dploot = "^2.2.1"
bloodhound = "^1.6.1"
asyauth = "~0.0.13"
asyauth = "~0.0.14"
masky = "^0.2.0"
sqlalchemy = "^2.0.4"
aiosqlite = "^0.18.0"
aiosqlite = "^0.19.0"
pyasn1-modules = "^0.3.0"
rich = "^13.3.5"
python-libnmap = "^0.7.3"
resource = "^0.2.1"
oscrypto = { git = "https://github.com/NeffIsBack/oscrypto" }
oscrypto = { git = "https://github.com/Pennyw0rth/oscrypto" } # Pypi version currently broken, see: https://github.com/wbond/oscrypto/issues/78 (as of 9/23)
pyreadline = "^2.1" # for the build - impacket imports its hidden from the builder so an error occurs
[tool.poetry.group.dev.dependencies]
flake8 = "*"
ruff = "*"
pylint = "*"
shiv = "*"
black = "^20.8b1"
pytest = "^7.2.2"
[build-system]