mirror of
https://github.com/Pennyw0rth/NetExec.git
synced 2026-11-08 10:09:50 -10:00
Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77b3797da6 | ||
|
|
5e416d7b3e | ||
|
|
b565bed227 | ||
|
|
9c41c567b9 | ||
|
|
3fa07310c5 | ||
|
|
7b5ca88243 | ||
|
|
b77fc9d919 | ||
|
|
bb030122fe | ||
|
|
21e320af41 | ||
|
|
cf2c0a3b66 | ||
|
|
75ba2e2afd | ||
|
|
06e45dd23f | ||
|
|
a866ab825c | ||
|
|
6243163ad8 | ||
|
|
da344b3b5f | ||
|
|
eb8ceab063 | ||
|
|
a2507f85b0 | ||
|
|
1af282888c | ||
|
|
f2311b308b | ||
|
|
d44ed75076 | ||
|
|
271268a092 | ||
|
|
cdffba942d | ||
|
|
15f29a9c4f | ||
|
|
08e3f17365 | ||
|
|
e4ca4f9fef | ||
|
|
5f79c176ea | ||
|
|
3e18d2f588 | ||
|
|
c956dba3ab | ||
|
|
fbeab5fb5c | ||
|
|
665f778dd0 | ||
|
|
791733853e | ||
|
|
eedbce83b6 | ||
|
|
2bc18c5786 | ||
|
|
e25988275a | ||
|
|
f3fb3d431f | ||
|
|
0983df94db | ||
|
|
bd8620125c | ||
|
|
aa38c7a18a | ||
|
|
3797ccf888 | ||
|
|
cfe231a9a1 | ||
|
|
67da598b11 | ||
|
|
efa0b75c10 | ||
|
|
2fa3e83ae9 | ||
|
|
94e0ab62ea | ||
|
|
061ee498bf | ||
|
|
7afb4afd35 | ||
|
|
4e0b44f6a6 |
No files matched your search
@@ -0,0 +1,179 @@
|
||||
name: NetExec Checker
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
uses: ./.github/workflows/lint.yml
|
||||
nxc-smb:
|
||||
runs-on: windows-latest
|
||||
needs: [lint]
|
||||
# technique stolen from @Hackndo my best friend for life <3
|
||||
steps:
|
||||
- name: Create new user
|
||||
run: |
|
||||
net user nxc Pwn3d!!! /add
|
||||
- name: Add to local admin
|
||||
run: |
|
||||
net localgroup Administrators nxc /add
|
||||
- name: Update registry key
|
||||
run: |
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
|
||||
- name: 👾 Disable defender
|
||||
run: start-process -filepath powershell -ArgumentList '/c','Set-MpPreference -DisableRealtimeMonitoring $true' -verb RunAs
|
||||
shell: powershell
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install poetry
|
||||
run: |
|
||||
pipx install poetry --python python3.11
|
||||
poetry --version
|
||||
poetry env info
|
||||
- name: Install libraries without dev group
|
||||
run: |
|
||||
poetry install
|
||||
- name: Dumping sam
|
||||
run: |
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! --sam
|
||||
- name: Dumping lsa
|
||||
run: |
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! --lsa
|
||||
- name: Dumping dpapi
|
||||
run: |
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! --dpapi
|
||||
- name: Dumping with lsassy
|
||||
run: |
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! -M lsassy
|
||||
- name: Exec command
|
||||
run: |
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! -x whoami --exec-method=smbexec
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! -x whoami --exec-method=wmiexec
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! -x whoami --exec-method=atexec
|
||||
poetry run netexec smb %COMPUTERNAME% -u nxc -p Pwn3d!!! -x whoami --exec-method=mmcexec
|
||||
- name: Dumping with procdump
|
||||
run: |
|
||||
poetry run netexec --verbose smb %COMPUTERNAME% %COMPUTERNAME% %COMPUTERNAME% -u nxc -p Pwn3d!!! -M procdump
|
||||
|
||||
nxc-winrm:
|
||||
runs-on: windows-latest
|
||||
needs: [lint]
|
||||
# technique stolen from @Hackndo my best friend for life <3
|
||||
steps:
|
||||
- name: Create new user
|
||||
run: |
|
||||
net user nxc Pwn3d!!! /add
|
||||
- name: Add to local admin
|
||||
run: |
|
||||
net localgroup Administrators nxc /add
|
||||
- name: Update registry key
|
||||
run: |
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
|
||||
- name: Enable WinRM
|
||||
run: |
|
||||
winrm quickconfig -quiet
|
||||
- name: 👾 Disable defender
|
||||
run: start-process -filepath powershell -ArgumentList '/c','Set-MpPreference -DisableRealtimeMonitoring $true' -verb RunAs
|
||||
shell: powershell
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install poetry
|
||||
run: |
|
||||
pipx install poetry --python python3.11
|
||||
poetry --version
|
||||
poetry env info
|
||||
- name: Install libraries without dev group
|
||||
run: |
|
||||
poetry install
|
||||
- name: Dumping sam
|
||||
run: |
|
||||
poetry run netexec winrm 127.0.0.1 -u nxc -p Pwn3d!!! --sam
|
||||
- name: Dumping lsa
|
||||
run: |
|
||||
poetry run netexec winrm 127.0.0.1 -u nxc -p Pwn3d!!! --lsa
|
||||
- name: Exec command
|
||||
run: |
|
||||
poetry run netexec winrm 127.0.0.1 -u nxc -p Pwn3d!!! -x whoami
|
||||
|
||||
nxc-rdp:
|
||||
runs-on: windows-latest
|
||||
needs: [lint]
|
||||
# technique stolen from @Hackndo my best friend for life <3
|
||||
steps:
|
||||
- name: Create new user
|
||||
run: |
|
||||
net user nxc Pwn3d!!! /add
|
||||
- name: Add to local admin
|
||||
run: |
|
||||
net localgroup Administrators nxc /add
|
||||
- name: Update registry key
|
||||
run: |
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
|
||||
- name: Update registry key rdo
|
||||
run: |
|
||||
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
||||
- name: Open Firewall
|
||||
run: |
|
||||
netsh advfirewall firewall add rule name="Open Remote Desktop" protocol=TCP dir=in localport=3389 action=allow
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install poetry
|
||||
run: |
|
||||
pipx install poetry --python python3.11
|
||||
poetry --version
|
||||
poetry env info
|
||||
- name: Install libraries without dev group
|
||||
run: |
|
||||
poetry install
|
||||
- name: Checking rdp
|
||||
run: |
|
||||
poetry run netexec rdp 127.0.0.1
|
||||
- name: Checking auth
|
||||
run: |
|
||||
poetry run netexec rdp 127.0.0.1 -u nxc -p Pwn3d!!!
|
||||
|
||||
nxc-ssh:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint]
|
||||
# technique stolen from @Hackndo my best friend for life <3
|
||||
steps:
|
||||
- name: Enable ssh
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install openssh-server
|
||||
sudo systemctl status ssh
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install poetry
|
||||
run: |
|
||||
pipx install poetry --python python3.11
|
||||
poetry --version
|
||||
poetry env info
|
||||
- name: Install libraries without dev group
|
||||
run: |
|
||||
poetry install
|
||||
- name: Connection with user
|
||||
run: |
|
||||
poetry run netexec ssh 127.0.0.1
|
||||
@@ -1,14 +1,11 @@
|
||||
name: Lint Python code with ruff
|
||||
name: lint
|
||||
# Caching source: https://gist.github.com/gh640/233a6daf68e9e937115371c0ecd39c61?permalink_comment_id=4529233#gistcomment-4529233
|
||||
|
||||
on:
|
||||
push:
|
||||
on: [workflow_call]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
if:
|
||||
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
Whitespace-only changes.
@@ -2,8 +2,6 @@ name: NetExec Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -14,7 +12,7 @@ jobs:
|
||||
max-parallel: 5
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install poetry
|
||||
|
||||
+15
-5
@@ -412,12 +412,22 @@ class connection:
|
||||
for ntlm_hash in self.args.hash:
|
||||
if isfile(ntlm_hash):
|
||||
with open(ntlm_hash) as ntlm_hash_file:
|
||||
for line in ntlm_hash_file:
|
||||
secret.append(line.strip())
|
||||
cred_type.append("hash")
|
||||
for i, line in enumerate(ntlm_hash_file):
|
||||
line = line.strip()
|
||||
if len(line) != 32 and len(line) != 65:
|
||||
self.logger.fail(f"Invalid NTLM hash length on line {(i + 1)} (len {len(line)}): {line}")
|
||||
continue
|
||||
else:
|
||||
secret.append(line)
|
||||
cred_type.append("hash")
|
||||
else:
|
||||
secret.append(ntlm_hash)
|
||||
cred_type.append("hash")
|
||||
if len(ntlm_hash) != 32 and len(ntlm_hash) != 65:
|
||||
self.logger.fail(f"Invalid NTLM hash length {len(ntlm_hash)}, authentication not sent")
|
||||
exit(1)
|
||||
else:
|
||||
secret.append(ntlm_hash)
|
||||
cred_type.append("hash")
|
||||
self.logger.debug(secret)
|
||||
|
||||
# Parse AES keys
|
||||
if self.args.aesKey:
|
||||
|
||||
@@ -247,6 +247,14 @@ conf = {
|
||||
"services": [{"name": "CSFalconService", "description": "CrowdStrike Falcon Sensor Service"}],
|
||||
"pipes": [{"name": "CrowdStrike\\{*", "processes": ["CSFalconContainer.exe", "CSFalconService.exe"]}]
|
||||
},
|
||||
{
|
||||
"name": "Cortex",
|
||||
"services": [
|
||||
{"name": "xdrhealth", "description": "Cortex XDR Health Helper"},
|
||||
{"name": "cyserver", "description": " Cortex XDR"}
|
||||
],
|
||||
"pipes": []
|
||||
},
|
||||
{
|
||||
"name": "Cybereason",
|
||||
"services": [
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
from xmltodict import parse
|
||||
from time import sleep
|
||||
from csv import reader
|
||||
from base64 import b64encode
|
||||
@@ -381,28 +379,30 @@ class NXCModule:
|
||||
xml_doc_path = os.path.abspath(self.local_export_path + "/" + self.export_name)
|
||||
xml_tree = ElementTree.parse(xml_doc_path)
|
||||
root = xml_tree.getroot()
|
||||
to_string = ElementTree.tostring(root, encoding="UTF-8", method="xml")
|
||||
xml_to_dict = parse(to_string)
|
||||
dump = json.dumps(xml_to_dict)
|
||||
obj = json.loads(dump)
|
||||
|
||||
if len(obj["KeePassFile"]["Root"]["Group"]["Entry"]):
|
||||
for obj2 in obj["KeePassFile"]["Root"]["Group"]["Entry"]:
|
||||
for password in obj2["String"]:
|
||||
if password["Key"] == "Password":
|
||||
context.log.highlight(str(password["Key"]) + " : " + str(password["Value"]["#text"]))
|
||||
else:
|
||||
context.log.highlight(str(password["Key"]) + " : " + str(password["Value"]))
|
||||
context.log.highlight("")
|
||||
if len(obj["KeePassFile"]["Root"]["Group"]["Group"]):
|
||||
for obj2 in obj["KeePassFile"]["Root"]["Group"]["Group"]:
|
||||
try:
|
||||
for obj3 in obj2["Entry"]:
|
||||
for password in obj3["String"]:
|
||||
if password["Key"] == "Password":
|
||||
context.log.highlight(str(password["Key"]) + " : " + str(password["Value"]["#text"]))
|
||||
else:
|
||||
context.log.highlight(str(password["Key"]) + " : " + str(password["Value"]))
|
||||
context.log.highlight("")
|
||||
except KeyError:
|
||||
pass
|
||||
root_entries = root.find("./Root/Entry")
|
||||
if root_entries is not None:
|
||||
for entry in root_entries:
|
||||
if entry is not None:
|
||||
self.print_password(context, entry)
|
||||
else:
|
||||
context.log.highlight("None")
|
||||
|
||||
objects = root.findall("./Root/Group")
|
||||
while objects:
|
||||
current_object = objects.pop(0)
|
||||
for entry in current_object.findall("./Entry"):
|
||||
self.print_password(context, entry)
|
||||
for history in entry.findall("./History"):
|
||||
for history_entry in history.findall("./Entry"):
|
||||
self.print_password(context, history_entry)
|
||||
objects.extend(current_object.findall("./Group"))
|
||||
|
||||
def print_password(self, context, entries):
|
||||
for entry in entries.findall("./String"):
|
||||
key = entry.find("./Key")
|
||||
value = entry.find("./Value")
|
||||
key_text = key.text if key is not None else "None"
|
||||
value_text = value.text if value is not None and value.text is not None else "None"
|
||||
context.log.highlight(f"{key_text} : {value_text}")
|
||||
context.log.highlight("-------------------------------------")
|
||||
@@ -78,6 +78,7 @@ class NXCModule:
|
||||
dump = True
|
||||
else:
|
||||
context.log.fail("Process lsass.exe error un dump, try with verbose")
|
||||
sys.exit(1)
|
||||
|
||||
if dump:
|
||||
regex = r"([A-Za-z0-9-]*.dmp)"
|
||||
|
||||
@@ -512,6 +512,11 @@ class NXCDBMenu(cmd.Cmd):
|
||||
def do_exit(line):
|
||||
sys.exit()
|
||||
|
||||
@staticmethod
|
||||
def do_EOF(line):
|
||||
sys.exit()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def help_exit():
|
||||
help_string = """
|
||||
|
||||
@@ -752,7 +752,7 @@ class ldap(connection):
|
||||
|
||||
users = parse_result_attributes(resp)
|
||||
# we print the total records after we parse the results since often SearchResultReferences are returned
|
||||
self.logger.display(f"Total records returned: {len(users):d}")
|
||||
self.logger.display(f"Enumerated {len(users):d} domain users: {self.domain}")
|
||||
self.logger.highlight(f"{'-Username-':<30}{'-Last PW Set-':<20}{'-BadPW-':<8}{'-Description-':<60}")
|
||||
for user in users:
|
||||
# TODO: functionize this - we do this calculation in a bunch of places, different, including in the `pso` module
|
||||
|
||||
+36
-8
@@ -147,6 +147,9 @@ class smb(connection):
|
||||
def __init__(self, args, db, host):
|
||||
self.domain = None
|
||||
self.server_os = None
|
||||
self.server_os_major = None
|
||||
self.server_os_minor = None
|
||||
self.server_os_build = None
|
||||
self.os_arch = 0
|
||||
self.hash = None
|
||||
self.lmhash = ""
|
||||
@@ -161,6 +164,7 @@ class smb(connection):
|
||||
self.no_da = None
|
||||
self.no_ntlm = False
|
||||
self.protocol = "SMB"
|
||||
self.is_guest = None
|
||||
|
||||
connection.__init__(self, args, db, host)
|
||||
|
||||
@@ -229,7 +233,19 @@ class smb(connection):
|
||||
self.domain = self.hostname
|
||||
self.targetDomain = self.hostname
|
||||
|
||||
# As of June 2024 Samba will always report the version as "Windows 6.1", apparently due to a bug https://stackoverflow.com/a/67577401/17395725
|
||||
# Together with the reported build version "0" by Samba we can assume that it is a Samba server. Windows should always report a build version > 0
|
||||
# Also only on Windows we should get an OS arch as for that we would need MSRPC
|
||||
self.server_os = self.conn.getServerOS()
|
||||
self.server_os_major = self.conn.getServerOSMajor()
|
||||
self.server_os_minor = self.conn.getServerOSMinor()
|
||||
self.server_os_build = self.conn.getServerOSBuild()
|
||||
if "Windows 6.1" in self.server_os and self.server_os_build == 0 and self.os_arch == 0:
|
||||
self.server_os = "Unix - Samba"
|
||||
elif self.server_os_build == 0 and self.os_arch == 0:
|
||||
self.server_os = "Unix"
|
||||
self.logger.debug(f"Server OS: {self.server_os} {self.server_os_major}.{self.server_os_minor} build {self.server_os_build}")
|
||||
|
||||
self.logger.extra["hostname"] = self.hostname
|
||||
|
||||
if isinstance(self.server_os.lower(), bytes):
|
||||
@@ -310,7 +326,8 @@ class smb(connection):
|
||||
self.logger.debug(f"Got TGS for {self.args.delegate} through S4U")
|
||||
|
||||
self.conn.kerberosLogin(self.username, password, domain, lmhash, nthash, aesKey, kdcHost, useCache=useCache, TGS=tgs)
|
||||
self.check_if_admin()
|
||||
if "Unix" not in self.server_os:
|
||||
self.check_if_admin()
|
||||
|
||||
if username == "":
|
||||
self.username = self.conn.getCredentials()[0]
|
||||
@@ -375,8 +392,11 @@ class smb(connection):
|
||||
self.domain = domain
|
||||
|
||||
self.conn.login(self.username, self.password, domain)
|
||||
|
||||
self.check_if_admin()
|
||||
self.logger.debug(f"Logged in with password to SMB with {domain}/{self.username}")
|
||||
self.is_guest = bool(self.conn.isGuestSession())
|
||||
self.logger.debug(f"{self.is_guest=}")
|
||||
if "Unix" not in self.server_os:
|
||||
self.check_if_admin()
|
||||
self.logger.debug(f"Adding credential: {domain}/{self.username}:{self.password}")
|
||||
self.db.add_credential("plaintext", domain, self.username, self.password)
|
||||
user_id = self.db.get_credential("plaintext", domain, self.username, self.password)
|
||||
@@ -384,7 +404,7 @@ class smb(connection):
|
||||
|
||||
self.db.add_loggedin_relation(user_id, host_id)
|
||||
|
||||
out = f"{domain}\\{self.username}:{process_secret(self.password)} {self.mark_pwned()}"
|
||||
out = f"{domain}\\{self.username}:{process_secret(self.password)} {self.mark_guest()}{self.mark_pwned()}"
|
||||
self.logger.success(out)
|
||||
|
||||
if not self.args.local_auth and self.username != "":
|
||||
@@ -444,14 +464,17 @@ class smb(connection):
|
||||
self.nthash = nthash
|
||||
|
||||
self.conn.login(self.username, "", domain, lmhash, nthash)
|
||||
|
||||
self.check_if_admin()
|
||||
user_id = self.db.add_credential("hash", domain, self.username, nthash)
|
||||
self.logger.debug(f"Logged in with hash to SMB with {domain}/{self.username}")
|
||||
self.is_guest = bool(self.conn.isGuestSession())
|
||||
self.logger.debug(f"{self.is_guest=}")
|
||||
if "Unix" not in self.server_os:
|
||||
self.check_if_admin()
|
||||
user_id = self.db.add_credential("hash", domain, self.username, self.hash)
|
||||
host_id = self.db.get_hosts(self.host)[0].id
|
||||
|
||||
self.db.add_loggedin_relation(user_id, host_id)
|
||||
|
||||
out = f"{domain}\\{self.username}:{process_secret(self.hash)} {self.mark_pwned()}"
|
||||
out = f"{domain}\\{self.username}:{process_secret(self.hash)} {self.mark_guest()}{self.mark_pwned()}"
|
||||
self.logger.success(out)
|
||||
|
||||
if not self.args.local_auth and self.username != "":
|
||||
@@ -531,6 +554,7 @@ class smb(connection):
|
||||
return bool(self.create_smbv1_conn() or self.create_smbv3_conn())
|
||||
|
||||
def check_if_admin(self):
|
||||
self.logger.debug(f"Checking if user is admin on {self.host}")
|
||||
rpctransport = SMBTransport(self.conn.getRemoteHost(), 445, r"\svcctl", smb_connection=self.conn)
|
||||
dce = rpctransport.get_dce_rpc()
|
||||
try:
|
||||
@@ -544,6 +568,7 @@ class smb(connection):
|
||||
# 0xF003F - SC_MANAGER_ALL_ACCESS
|
||||
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms685981(v=vs.85).aspx
|
||||
scmr.hROpenSCManagerW(dce, f"{self.host}\x00", "ServicesActive\x00", 0xF003F)
|
||||
self.logger.debug(f"User is admin on {self.host}!")
|
||||
self.admin_privs = True
|
||||
except scmr.DCERPCException:
|
||||
self.admin_privs = False
|
||||
@@ -1774,3 +1799,6 @@ class smb(connection):
|
||||
except Exception as e:
|
||||
self.logger.debug(f"Error calling remote_ops.finish(): {e}")
|
||||
NTDS.finish()
|
||||
|
||||
def mark_guest(self):
|
||||
return highlight(f"{highlight('(Guest)')}" if self.is_guest else "")
|
||||
@@ -78,10 +78,11 @@ class UserSamrDump:
|
||||
if resp2["ErrorCode"] != 0:
|
||||
raise Exception("Connect error")
|
||||
|
||||
domain_name = resp2["Buffer"]["Buffer"][0]["Name"]
|
||||
resp3 = samr.hSamrLookupDomainInSamServer(
|
||||
self.dce,
|
||||
serverHandle=resp["ServerHandle"],
|
||||
name=resp2["Buffer"]["Buffer"][0]["Name"],
|
||||
name=domain_name,
|
||||
)
|
||||
if resp3["ErrorCode"] != 0:
|
||||
raise Exception("Connect error")
|
||||
@@ -132,7 +133,7 @@ class UserSamrDump:
|
||||
# set these for the while loop
|
||||
enumerationContext = enumerate_users_resp["EnumerationContext"]
|
||||
status = enumerate_users_resp["ErrorCode"]
|
||||
self.print_user_info(users)
|
||||
self.print_user_info(users, domain_name)
|
||||
self.dce.disconnect()
|
||||
|
||||
def get_user_info(self, domain_handle, user_ids):
|
||||
@@ -165,7 +166,8 @@ class UserSamrDump:
|
||||
samr.hSamrCloseHandle(self.dce, open_user_resp["UserHandle"])
|
||||
return users
|
||||
|
||||
def print_user_info(self, users):
|
||||
def print_user_info(self, users, domain_name):
|
||||
self.logger.display(f"Enumerated {len(users):d} local users: {domain_name}")
|
||||
self.logger.highlight(f"{'-Username-':<30}{'-Last PW Set-':<20}{'-BadPW-':<8}{'-Description-':<60}")
|
||||
for user in users:
|
||||
self.logger.debug(f"Full user info: {user}")
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
DEADBEEFDEADBEEFDEADBEEFDEADBEEF
|
||||
DEADBEEFDEADBEEFDEADBEEFDEADBEEF:DEADBEEFDEADBEEFDEADBEEFDEADBEEF
|
||||
TooShort
|
||||
ToooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooLong
|
||||
fc525c9683e8fe067095ba2ddc971889
|
||||
aad3b435b51404eeaad3b435b51404ee:fc525c9683e8fe067095ba2ddc971889
|
||||
@@ -137,7 +137,10 @@ netexec smb TARGET_HOST -u '' -p '' -M petitpotam
|
||||
##### SMB Auth File
|
||||
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE --no-bruteforce
|
||||
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE --no-bruteforce --continue-on-success
|
||||
netexec smb TARGET_HOST -u TEST_USER_FILE -p tests/data/test_passwords.txt
|
||||
netexec smb TARGET_HOST -u TEST_USER_FILE -p TEST_PASSWORD_FILE
|
||||
##### SMB Hash File
|
||||
netexec smb TARGET_HOST -u LOGIN_USERNAME -H tests/data/test_hashes.txt
|
||||
netexec smb TARGET_HOST -u TEST_USER_FILE -H tests/data/test_hashes.txt
|
||||
##### WMI
|
||||
netexec wmi TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS # need an extra space after this command due to regex
|
||||
netexec wmi TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS --wmi-namespace root/cimv2
|
||||
|
||||
Reference in new issue
Block a user