Skip to content

Commit 931f281

Browse files
authored
Merge branch 'main' into main
2 parents d06d179 + bac38ac commit 931f281

40 files changed

Lines changed: 2525 additions & 1592 deletions

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: NetExec Wiki
4+
url: https://www.netexec.wiki/
5+
about: Check the wiki for usage guides and documentation before opening an issue.
6+
- name: NetExec Discord
7+
url: https://discord.com/invite/pjwUTQzg8R
8+
about: Join the Discord for general questions and community support.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
## Description
2-
32
Please include a summary of the change and which issue is fixed, or what the enhancement does.
43
List any dependencies that are required for this change.
54

5+
If you have used AI in any form, please state the tool you used (e.g. Claude Code, Cursor, Amp) along with the extent that the work was AI-assisted. See the project's AI policy for more details: https://github.com/Pennyw0rth/NetExec/blob/main/AI_POLICY.md
6+
67
## Type of change
78
Insert an "x" inside the brackets for relevant items (do not delete options)
89

@@ -12,24 +13,28 @@ Insert an "x" inside the brackets for relevant items (do not delete options)
1213
- [ ] Deprecation of feature or functionality
1314
- [ ] This change requires a documentation update
1415
- [ ] This requires a third party update (such as Impacket, Dploot, lsassy, etc)
16+
- [ ] This PR was created with the assistance of AI (list what type of assistance, tool(s)/model(s) in the description)
1517

1618
## Setup guide for the review
1719
Please provide guidance on what setup is needed to test the introduced changes, such as your locally running machine Python version & OS, as well as the target(s) you tested against, including software versions.
1820
In particular:
1921
- Bug Fix: Please provide a short description on how to trigger the bug, to make the bug reproducable for the reviewer.
20-
- Added Feature/Enhancement: Please specify what setup is needed in order to test the changes. E.g. is additional software needed? GPO changes required? Specific registry settings that need to be changed?
22+
- Added Feature/Enhancement: Please specify what setup is needed in order to test the changes, such as:
23+
- Is additional software needed?
24+
- GPO changes required?
25+
- Specific registry settings that need to be changed?
2126

2227
## Screenshots (if appropriate):
2328
Screenshots are always nice to have and can give a visual representation of the change.
24-
If appropriate include before and after screenshot(s) to show which results are to be expected.
29+
If appropriate, include before and after screenshot(s) to show which results are to be expected.
2530

2631
## Checklist:
2732
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
2833

29-
- [ ] I have ran Ruff against my changes (via poetry: `poetry run python -m ruff check . --preview`, use `--fix` to automatically fix what it can)
34+
- [ ] I have ran Ruff against my changes (poetry: `poetry run ruff check .`, use `--fix` to automatically fix what it can)
3035
- [ ] I have added or updated the `tests/e2e_commands.txt` file if necessary (new modules or features are _required_ to be added to the e2e tests)
31-
- [ ] New and existing e2e tests pass locally with my changes
3236
- [ ] If reliant on changes of third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects
33-
- [ ] I have performed a self-review of my own code
37+
- [ ] I have linked relevant sources that describes the added technique (blog posts, documentation, etc)
38+
- [ ] I have performed a self-review of my own code (_not_ an AI review)
3439
- [ ] I have commented my code, particularly in hard-to-understand areas
3540
- [ ] I have made corresponding changes to the documentation (PR here: https://github.com/Pennyw0rth/NetExec-Wiki)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PR Template Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
check-template:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
steps:
16+
- name: Check PR description for template sections
17+
uses: actions/github-script@v7
18+
with:
19+
script: |
20+
const body = context.payload.pull_request.body || '';
21+
const requiredSections = [
22+
'## Description',
23+
'## Type of change',
24+
'## Setup guide for the review',
25+
'## Checklist'
26+
];
27+
28+
const missingSections = requiredSections.filter(
29+
section => !body.includes(section)
30+
);
31+
32+
if (missingSections.length === 0) return;
33+
34+
// Check if we already left a comment to avoid spamming
35+
const comments = await github.rest.issues.listComments({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
issue_number: context.payload.pull_request.number
39+
});
40+
41+
const botComment = comments.data.find(
42+
c => c.user.type === 'Bot' && c.body.includes('<!-- pr-template-check -->')
43+
);
44+
45+
if (botComment) return;
46+
47+
const missing = missingSections.map(s => `- ${s}`).join('\n');
48+
49+
await github.rest.issues.createComment({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
issue_number: context.payload.pull_request.number,
53+
body: `<!-- pr-template-check -->\nIt looks like the PR template may not have been filled out. The following sections appear to be missing:\n\n${missing}\n\nPlease edit your PR description to include them. The template helps reviewers understand and test your changes. Thanks!`
54+
});

AI_POLICY.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# AI Usage Policy
2+
3+
This policy was adapted from the [ghostty project](https://github.com/ghostty-org/ghostty/).
4+
The original version can be found [Ghostty's PR #10412](https://github.com/ghostty-org/ghostty/pull/10412).
5+
6+
The NetExec project has strict rules for AI usage:
7+
8+
- **All AI usage in any form must be disclosed.** You must state
9+
the tool(s) and model(s) you used (e.g. Claude Code, Cursor, Opus 4.6,
10+
Codex 5.2, etc) along with the extent that the work was AI-assisted.
11+
12+
- **Pull requests created in any way by AI can only be for accepted issues.**
13+
Drive-by pull requests that do not reference an accepted issue may be
14+
rejected and closed. If AI isn't disclosed but a maintainer suspects its use,
15+
the PR may be rejected and closed. If you want to share code for a
16+
non-accepted issue, open a discussion or attach it to the existing issue.
17+
18+
- **Pull requests created by AI must have been fully verified with
19+
human use.** AI must not create hypothetically correct code that
20+
hasn't been tested. Importantly, you must not allow AI to write
21+
code for platforms or environments you don't have access to manually
22+
test on.
23+
24+
- **Issues and discussions can use AI assistance but must have a full
25+
human-in-the-loop.** This means that any content generated with AI
26+
must have been reviewed _and edited_ by a human before submission.
27+
AI is very good at being overly verbose and including noise that
28+
distracts from the main point. Humans must do their research and
29+
trim this down.
30+
31+
- **No AI-generated media is allowed (art, images, videos, audio, etc.).**
32+
Text and code are the only acceptable AI-generated content, per the
33+
other rules in this policy.
34+
35+
- **Bad AI drivers will be banned** You've been warned. We love to help junior
36+
developers learn and grow, but if you're interested in that then don't use
37+
AI, and we'll help you.
38+
39+
- **Official maintainers have the final say** We always strive to be helpful,
40+
but there are limits. If you submit agregiously terrible AI generated code
41+
with no review, we may ban you without word. We do not want to waste our
42+
time reviewing slop if the contributor can't be bothered to review the work
43+
themselves.
44+
45+
These rules apply only to outside contributions to NetExec. Maintainers
46+
and trusted contributors are exempt from these rules and may use AI tools at
47+
their discretion; they've proven themselves trustworthy to apply good judgment.
48+
49+
## There are Humans Here
50+
51+
Please remember that NetExec is maintained by humans.
52+
53+
Every discussion, issue, and pull request is read and reviewed by
54+
humans (and sometimes machines, too). It is a boundary point at which
55+
people interact with each other and the work done. It is rude and
56+
disrespectful to approach this boundary with low-effort, unqualified
57+
work, since it puts the burden of validation on the maintainers.
58+
59+
In a perfect world, AI would produce high-quality, accurate work
60+
every time, but today that is simply not true. This is compounded by the fact
61+
that accessibility to AI is high, allowing low skilled individuals to think
62+
that they are contributing useful code. Even many skilled programmers do not
63+
understand how to use it effectively. This has opened up a waterfall of low
64+
quality contributions across the Open Source community, wasting resources.
65+
66+
## AI is Welcome Here, Within Reason
67+
68+
NetExec maintainers acknowledge AI as a productive tool to some workflows, and
69+
are open to leveraging this technology to improve NetExec; however, there are
70+
many low quality AI tools whose use results in pure slop being generated. The
71+
security communinity is not immune from AI psychosis, over-hype, or FOMO.
72+
As with any new technology, it is important to understand how it works and how
73+
to best use it, not blindly apply it to every use case with the hope that it
74+
will fix all your issues.
75+
76+
We include this section to be transparent about the project's usage about
77+
AI for people who may disagree with it.

nxc/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from nxc.helpers.pfx import pfx_auth
2323

2424
from impacket.dcerpc.v5 import transport
25+
from impacket.krb5.ccache import CCache
2526

2627
sem = BoundedSemaphore(1)
2728
global_failed_logins = 0
@@ -552,7 +553,7 @@ def login(self):
552553
if self.args.use_kcache:
553554
self.logger.debug("Trying to authenticate using Kerberos cache")
554555
with sem:
555-
username = self.args.username[0] if len(self.args.username) else ""
556+
username = self.args.username[0] if len(self.args.username) else CCache.parseFile()[1]
556557
password = self.args.password[0] if len(self.args.password) else ""
557558
self.kerberos_login(self.domain, username, password, "", "", self.kdcHost, True)
558559
self.logger.info("Successfully authenticated using Kerberos cache")

nxc/helpers/pfx.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@ def pfx_auth(self):
495495
req = ini.build_asreq(self.domain, username)
496496
self.logger.info("Requesting TGT")
497497

498+
if not self.kdcHost:
499+
self.logger.fail(f"Could not resolve KDC host for domain {self.domain}. Use --kdcHost to specify the domain controller IP")
500+
return False
501+
498502
sock = KerberosClientSocket(KerberosTarget(self.kdcHost))
499503
try:
500504
res = sock.sendrecv(req)

nxc/helpers/powershell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def create_ps_command(ps_command, force_ps32=False, obfs=False, custom_amsi=None
137137
amsi_bypass = ""
138138

139139
# for readability purposes, we do not do a one-liner
140-
if force_ps32: # noqa: SIM108
140+
if force_ps32:
141141
# https://stackoverflow.com/a/60155248
142142
command = amsi_bypass + f"$functions = {{function Command-ToExecute{{{amsi_bypass + ps_command}}}}}; if ($Env:PROCESSOR_ARCHITECTURE -eq 'AMD64'){{$job = Start-Job -InitializationScript $functions -ScriptBlock {{Command-ToExecute}} -RunAs32; $job | Wait-Job | Receive-Job }} else {{IEX '$functions'; Command-ToExecute}}"
143143
else:

0 commit comments

Comments
 (0)