Skip to content

Commit 0e9d3e5

Browse files
authored
Merge branch 'main' into feat-lsassy
2 parents a742bce + 83b7148 commit 0e9d3e5

56 files changed

Lines changed: 491 additions & 617 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ Awesome code contributors of NetExec:
6363
[![](https://github.com/NeffIsBack.png?size=50)](https://github.com/NeffIsBack)
6464
[![](https://github.com/Hackndo.png?size=50)](https://github.com/Hackndo)
6565
[![](https://github.com/XiaoliChan.png?size=50)](https://github.com/XiaoliChan)
66+
[![](https://github.com/termanix.png?size=50)](https://github.com/termanix)
67+
[![](https://github.com/Dfte.png?size=50)](https://github.com/Dfte)

nxc/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def gen_cli_args():
6060
6161
The network execution tool
6262
Maintained as an open source project by @NeffIsBack, @MJHallenbeck, @_zblurx
63-
63+
6464
For documentation and usage examples, visit: https://www.netexec.wiki/
6565
6666
{highlight('Version', 'red')} : {highlight(VERSION)}

nxc/database.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def initialize_db():
110110

111111
# Even if the default workspace exists, we still need to check if every protocol has a database (in case of a new protocol)
112112
init_protocol_dbs("default")
113-
113+
114114

115115
def format_host_query(q, filter_term, HostsTable):
116116
"""One annoying thing is that if you search for an ip such as '10.10.10.5',
@@ -127,16 +127,16 @@ def format_host_query(q, filter_term, HostsTable):
127127
else:
128128
nxc_logger.debug("Neither 'ip' nor 'host' columns found in the table")
129129
return q
130-
131-
# first we check if its an ip address
130+
131+
# first we check if its an ip address
132132
try:
133133
ipaddress.ip_address(filter_term)
134134
nxc_logger.debug(f"filter_term is an IP address: {filter_term}")
135135
q = q.filter(ip_column == filter_term)
136136
except ValueError:
137137
nxc_logger.debug(f"filter_term is not an IP address: {filter_term}")
138138
like_term = func.lower(f"%{filter_term}%")
139-
139+
140140
# check if the hostname column exists for hostname searching
141141
q = q.filter(ip_column.like(like_term) | func.lower(HostsTable.c.hostname).like(like_term)) if hasattr(HostsTable.c, "hostname") else q.filter(ip_column.like(like_term))
142142

nxc/helpers/even6_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ def xml(self, template=None):
145145
return ""
146146

147147
attrs = filter(lambda x: x is not None, (x.xml(template) for x in self._attributes))
148-
148+
149149
attrs = " ".join(attrs)
150150
if len(attrs) > 0:
151151
attrs = " " + attrs
152-
152+
153153
if self._empty:
154154
return f"<{self._name.val}{attrs}/>"
155155
else:

nxc/helpers/misc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,3 @@ def detect_if_ip(target):
145145
return True
146146
except Exception:
147147
return False
148-

nxc/helpers/ntlm_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ def parse_challenge(challange):
3131
target_info["os_version"] = f"{WIN_VERSIONS[product_build]} Build {product_build}"
3232
else:
3333
target_info["os_version"] = f"{major_version}.{minor_version} Build {product_build}"
34-
return target_info
34+
return target_info

nxc/modules/add-computer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def on_login(self, context, connection):
8686
# If SAMR fails now try over LDAPS
8787
if not self.noLDAPRequired:
8888
self.do_ldaps_add(connection, context)
89-
89+
9090
def do_samr_add(self, context):
9191
"""
9292
Connects to a target server and performs various operations related to adding or deleting machine accounts.

nxc/modules/bitlocker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def __init__(self, context=None, module_options=None):
1515
self.module_options = module_options
1616

1717
def options(self, context, module_options):
18-
"""
18+
"""
1919
USAGE:
20-
20+
2121
NetExec smb <IP> -u <username> -p <password> -M bitlocker
2222
NetExec wmi <IP> -u <username> -p <password> -M bitlocker (Better option to use on real life.)
2323
"""
@@ -43,18 +43,18 @@ def check_bitlocker_status(self):
4343
try:
4444
# Executing the PowerShell command to get BitLocker volumes status.
4545
check_bitlocker_command_str_output = self.connection.execute(check_bitlocker_command_str, True)
46-
46+
4747
if "'Get-BitLockerVolume' is not recognized" in check_bitlocker_command_str_output:
4848
self.context.log.fail("BitLockerVolume not found on target.")
4949
return
5050

5151
# Splitting the output into lines.
5252
lines = str(check_bitlocker_command_str_output).splitlines()
5353
data_lines = [line for line in lines if re.match(r"\w:", line)]
54-
54+
5555
for line in data_lines:
5656
# Checking every line for starting with drive
57-
if line[1] == ":":
57+
if line[1] == ":":
5858
parts = line.split()
5959
MountPoint, EncryptionMethod, protection_status = parts[0], parts[1], parts[2]
6060

@@ -85,15 +85,15 @@ def check_bitlocker_status(self):
8585
oxidResolver=True,
8686
doKerberos=self.connection.kerberos,
8787
kdcHost=self.connection.kdcHost)
88-
88+
8989
try:
9090
# CoCreateInstanceEx for WMI login
9191
i_interface = dcom_conn.CoCreateInstanceEx(wmi.CLSID_WbemLevel1Login, wmi.IID_IWbemLevel1Login)
9292
iWbemLevel1Login = wmi.IWbemLevel1Login(i_interface)
9393

9494
# Specify the namespace for BitLocker
9595
bitlockerNamespace = "root\\CIMv2\\Security\\MicrosoftVolumeEncryption"
96-
96+
9797
# NTLM login for WMI
9898
iWbemServices = iWbemLevel1Login.NTLMLogin(bitlockerNamespace, NULL, NULL)
9999

@@ -113,7 +113,7 @@ def check_bitlocker_status(self):
113113
6: "XTS_AES_128",
114114
7: "XTS_AES_256_WITH_DIFFUSER"
115115
}
116-
116+
117117
try:
118118
while True:
119119
iWbemClassObject = iEnumWbemClassObject.Next(0xffffffff, 1)

0 commit comments

Comments
 (0)