-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Windows workflow #351
Open
mpgn
wants to merge
17
commits into
main
Choose a base branch
from
windows-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Windows workflow #351
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a2507f8
add worflow for windows
mpgn eb8ceab
change workflow name
mpgn da344b3
fix procdump module name
mpgn 6243163
remove dev from poetry
mpgn a866ab8
rename worflow run
mpgn 06e45dd
test
mpgn 75ba2e2
add ssh
mpgn cf2c0a3
add rdp
mpgn 21e320a
add rdp
mpgn bb03012
add rdp
mpgn b77fc9d
add rdp
mpgn 7b5ca88
add rdp
mpgn 3fa0731
add rdp
mpgn 9c41c56
Update checker.yml
mpgn b565bed
Update checker.yml
mpgn 5e416d7
disable defender
mpgn 77b3797
drop 3.8
mpgn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ def on_admin_login(self, context, connection): | |
dump = True | ||
else: | ||
context.log.fail("Process lsass.exe error un dump, try with verbose") | ||
sys.exit(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why exiting? |
||
|
||
if dump: | ||
regex = r"([A-Za-z0-9-]*.dmp)" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep linting on every push?