Skip to content
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

Cleanup & Lint Code #35

Merged
merged 261 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
f9489dc
fix type check and add docstrings to powershell.py
Marshall-Hallenbeck Sep 20, 2023
8533521
automatic ruff fixing
Marshall-Hallenbeck Sep 20, 2023
1e381fb
fix exception handling and remove unused function
Marshall-Hallenbeck Sep 20, 2023
b788f09
fix exception handling
Marshall-Hallenbeck Sep 20, 2023
bdf0fe2
cleanup wmiexec_event code
Marshall-Hallenbeck Sep 20, 2023
ee1e7b0
fix exception handling
Marshall-Hallenbeck Sep 20, 2023
fb0d153
refactor(add_computer): refactor and add docstrings to add_computer m…
Marshall-Hallenbeck Sep 20, 2023
f5439cb
clean up find-computer module
Marshall-Hallenbeck Sep 22, 2023
1c7df15
more cleanup
Marshall-Hallenbeck Sep 22, 2023
d0ecd4b
fix escaping in smbexec
Marshall-Hallenbeck Sep 22, 2023
9eb4487
actually add the linter workflow
Marshall-Hallenbeck Sep 22, 2023
017c26b
fix running ruff
Marshall-Hallenbeck Sep 22, 2023
155547c
add back in more checks for ruff
Marshall-Hallenbeck Sep 22, 2023
9ecb07c
ignore additional linting rule
Marshall-Hallenbeck Sep 22, 2023
76bf3be
clean up appcmd.py
Marshall-Hallenbeck Sep 22, 2023
2a5c01d
do some cleanup for hash_spider for #38
Marshall-Hallenbeck Sep 22, 2023
b38e71d
refactor(ms17-010): clean up and add full AI-generated comments to MS…
Marshall-Hallenbeck Sep 22, 2023
da2ec9b
documentation(mssql_priv): add docstrings and a bit of cleanup
Marshall-Hallenbeck Sep 22, 2023
b33ccfb
fix exception handle and add TODO
Marshall-Hallenbeck Sep 22, 2023
85ed079
remove old urllib3 error ignore
Marshall-Hallenbeck Sep 22, 2023
7f4ab23
More cleanup
Marshall-Hallenbeck Sep 22, 2023
89968b3
fix ignore rule (E->F)
Marshall-Hallenbeck Sep 22, 2023
63ac5c7
properly import specific ctypes and update description
Marshall-Hallenbeck Sep 22, 2023
5b6153c
properly use fstring
Marshall-Hallenbeck Sep 22, 2023
a460565
add F841 (variable assigned but never used) to ruff exclude
Marshall-Hallenbeck Sep 22, 2023
a730ed0
clean up rdp module
Marshall-Hallenbeck Sep 22, 2023
3f1d0f4
clean up ntdsutil module
Marshall-Hallenbeck Sep 22, 2023
f554223
refactor(wcc): update wcc module quotes and refactor some formatting
Marshall-Hallenbeck Sep 22, 2023
d12c139
cleanup
Marshall-Hallenbeck Sep 22, 2023
bbf1024
fix variable naming for file listing
Marshall-Hallenbeck Sep 22, 2023
dae229a
cleanup wdigest module
Marshall-Hallenbeck Sep 22, 2023
efbecca
cleanup winscp_dump module
Marshall-Hallenbeck Sep 22, 2023
bda8ecb
clean up wireless module
Marshall-Hallenbeck Sep 22, 2023
e3dfbb3
remove flake
Marshall-Hallenbeck Sep 23, 2023
0dc6d61
no need for gitmodules anymore
Marshall-Hallenbeck Sep 23, 2023
d7d30cb
update ruff version
Marshall-Hallenbeck Sep 23, 2023
7b44fcd
ruff autoformat to clean up all the single quotes and other bad forma…
Marshall-Hallenbeck Sep 23, 2023
69514ce
Remove old NotImplementedError
NeffIsBack Sep 23, 2023
c445d38
fix string interpolation
Marshall-Hallenbeck Sep 24, 2023
443c363
Merge branch 'marshall_cleanup' of https://github.com/Pennyw0rth/NetE…
Marshall-Hallenbeck Sep 24, 2023
14be9d5
ruff cleanup
Marshall-Hallenbeck Sep 24, 2023
a258447
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 2, 2023
5e80ebd
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 5, 2023
052cbe2
Fix tab indention error in ldap.py
NeffIsBack Oct 5, 2023
193ef25
remove unnecessary imports
Marshall-Hallenbeck Sep 20, 2023
39cdcc1
remove unused code
Marshall-Hallenbeck Sep 20, 2023
b0b36ed
rename nxc PATH variable
Marshall-Hallenbeck Sep 20, 2023
7f5a6f4
fix escaping sequence in log
Marshall-Hallenbeck Sep 20, 2023
a2dc037
nxcdb: fix escaping sequence
Marshall-Hallenbeck Sep 20, 2023
f4d5a56
smbexec: fix escaping sequence
Marshall-Hallenbeck Sep 20, 2023
5ab24c1
fix exception handling and printing in build collector
Marshall-Hallenbeck Sep 20, 2023
01c5303
update exception handling
Marshall-Hallenbeck Sep 20, 2023
f1f34b3
update exception handling and add docstring to call_cmd_args. also ma…
Marshall-Hallenbeck Sep 20, 2023
182c7a5
doc(connection.py): add docstring for call_modules
Marshall-Hallenbeck Sep 20, 2023
345a074
cleanup: fix variable names in query_db_cred
Marshall-Hallenbeck Sep 20, 2023
a1c0080
fix type check and add docstrings to powershell.py
Marshall-Hallenbeck Sep 20, 2023
45fdc26
automatic ruff fixing
Marshall-Hallenbeck Sep 20, 2023
ffb9dd3
fix exception handling and remove unused function
Marshall-Hallenbeck Sep 20, 2023
8ec3e62
fix exception handling
Marshall-Hallenbeck Sep 20, 2023
f6812f2
cleanup wmiexec_event code
Marshall-Hallenbeck Sep 20, 2023
e80c480
fix exception handling
Marshall-Hallenbeck Sep 20, 2023
a8b14ce
refactor(add_computer): refactor and add docstrings to add_computer m…
Marshall-Hallenbeck Sep 20, 2023
110e647
clean up find-computer module
Marshall-Hallenbeck Sep 22, 2023
5ec969c
more cleanup
Marshall-Hallenbeck Sep 22, 2023
1b97ceb
fix escaping in smbexec
Marshall-Hallenbeck Sep 22, 2023
3ab397f
actually add the linter workflow
Marshall-Hallenbeck Sep 22, 2023
10b3cdd
fix running ruff
Marshall-Hallenbeck Sep 22, 2023
0ca3827
add back in more checks for ruff
Marshall-Hallenbeck Sep 22, 2023
28e25c5
ignore additional linting rule
Marshall-Hallenbeck Sep 22, 2023
6c68100
clean up appcmd.py
Marshall-Hallenbeck Sep 22, 2023
9ec7cd6
do some cleanup for hash_spider for #38
Marshall-Hallenbeck Sep 22, 2023
064921b
refactor(ms17-010): clean up and add full AI-generated comments to MS…
Marshall-Hallenbeck Sep 22, 2023
ddc5c2e
documentation(mssql_priv): add docstrings and a bit of cleanup
Marshall-Hallenbeck Sep 22, 2023
63a761c
fix exception handle and add TODO
Marshall-Hallenbeck Sep 22, 2023
7e7e867
remove old urllib3 error ignore
Marshall-Hallenbeck Sep 22, 2023
cfbdcb3
More cleanup
Marshall-Hallenbeck Sep 22, 2023
f402c45
fix ignore rule (E->F)
Marshall-Hallenbeck Sep 22, 2023
6580604
properly import specific ctypes and update description
Marshall-Hallenbeck Sep 22, 2023
84b1e41
properly use fstring
Marshall-Hallenbeck Sep 22, 2023
5f0ed02
add F841 (variable assigned but never used) to ruff exclude
Marshall-Hallenbeck Sep 22, 2023
9598e97
clean up rdp module
Marshall-Hallenbeck Sep 22, 2023
3655cbf
clean up ntdsutil module
Marshall-Hallenbeck Sep 22, 2023
e84a52c
refactor(wcc): update wcc module quotes and refactor some formatting
Marshall-Hallenbeck Sep 22, 2023
e9a7fda
cleanup
Marshall-Hallenbeck Sep 22, 2023
a956d2c
fix variable naming for file listing
Marshall-Hallenbeck Sep 22, 2023
7deee30
cleanup wdigest module
Marshall-Hallenbeck Sep 22, 2023
51c8ee3
cleanup winscp_dump module
Marshall-Hallenbeck Sep 22, 2023
2dd8ea9
clean up wireless module
Marshall-Hallenbeck Sep 22, 2023
2805dc6
remove flake
Marshall-Hallenbeck Sep 23, 2023
2cae1dc
no need for gitmodules anymore
Marshall-Hallenbeck Sep 23, 2023
9ae9d01
update ruff version
Marshall-Hallenbeck Sep 23, 2023
11ddfd9
ruff autoformat to clean up all the single quotes and other bad forma…
Marshall-Hallenbeck Sep 23, 2023
386208a
fix string interpolation
Marshall-Hallenbeck Sep 24, 2023
6a06460
Remove old NotImplementedError
NeffIsBack Sep 23, 2023
7620112
ruff cleanup
Marshall-Hallenbeck Sep 24, 2023
e24601b
Fix #48 tries to falsly add creds to bloodhound using --laps
NeffIsBack Sep 27, 2023
4ec4672
ldap: fix error output string
Marshall-Hallenbeck Oct 6, 2023
f66923b
ldap: fix truthiness check
Marshall-Hallenbeck Oct 6, 2023
84358bb
mssql: fix indentation
Marshall-Hallenbeck Oct 6, 2023
165fa50
bloodhound: fix imports
Marshall-Hallenbeck Oct 6, 2023
95aaac7
cleanup: fix F403 from Ruff (import *)
Marshall-Hallenbeck Oct 6, 2023
b38ad26
formatting
Marshall-Hallenbeck Oct 6, 2023
389b381
cleanup(ruff): finish cleaning up E722 (do not euse bare except)
Marshall-Hallenbeck Oct 6, 2023
c2f4c5d
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 6, 2023
f573f7f
Merge branch 'marshall_cleanup' of https://github.com/Pennyw0rth/NetE…
Marshall-Hallenbeck Oct 12, 2023
bbc661b
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 12, 2023
54bddb5
fix: remove redundant Except
Marshall-Hallenbeck Oct 12, 2023
33d2dc2
Merge branch 'marshall_cleanup' of https://github.com/Pennyw0rth/NetE…
Marshall-Hallenbeck Oct 12, 2023
3533350
fix: remove extra Exception
Marshall-Hallenbeck Oct 12, 2023
f61d068
ruff: remove unnecessary f string
Marshall-Hallenbeck Oct 12, 2023
a295db8
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 12, 2023
76ac0f7
fix: change conflict resolution I messed up and remove ruff quote sec…
Marshall-Hallenbeck Oct 12, 2023
52a1a7a
Merge branch 'marshall_cleanup' of https://github.com/Pennyw0rth/NetE…
Marshall-Hallenbeck Oct 12, 2023
c9112b1
ruff: add quote flake8 rules and re-run ruff
Marshall-Hallenbeck Oct 12, 2023
2b50e9b
ruff: add pydocstyle rules and ignores
Marshall-Hallenbeck Oct 12, 2023
f812ea1
ruff: dont require docstring to end in punctuation and allow empty do…
Marshall-Hallenbeck Oct 12, 2023
b002336
ruff: fix pydocstyle via ruff
Marshall-Hallenbeck Oct 12, 2023
335e6c9
ruff: manually fixed pydocstyle ruff alerts and add exclusions
Marshall-Hallenbeck Oct 12, 2023
9052470
fix: properly handle connection issue to bolt and let user know
Marshall-Hallenbeck Oct 12, 2023
8c51b37
fix: dont throw an exception right after catching it
Marshall-Hallenbeck Oct 12, 2023
b01384d
fix error string
Marshall-Hallenbeck Oct 12, 2023
25e4248
fix: inform user if handlekatz file doesnt exist
Marshall-Hallenbeck Oct 12, 2023
d638b17
fix: inform user if impersonate file doesnt exist
Marshall-Hallenbeck Oct 12, 2023
007d09a
fix: inform user if msol.ps1 file doesnt exist
Marshall-Hallenbeck Oct 12, 2023
adc59ff
Merge remote-tracking branch 'origin/develop' into marshall_cleanup
Marshall-Hallenbeck Oct 12, 2023
b24b921
ruff: pyupgrade (UP) ruff changes
Marshall-Hallenbeck Oct 12, 2023
4f5a892
ruff: remove encoding
Marshall-Hallenbeck Oct 12, 2023
d080a96
ruff: add flake8-2020 (YTT)
Marshall-Hallenbeck Oct 12, 2023
7940fb6
ruff: add flake8-async (ASYNC)
Marshall-Hallenbeck Oct 12, 2023
2d20b22
ruff: add flake8-bugbear
Marshall-Hallenbeck Oct 12, 2023
4045beb
ruff: auto flake8-bugbear, see B006 mutable-argument-default for func…
Marshall-Hallenbeck Oct 12, 2023
bfd32f1
ruff: manually fix flake8-bugbear issues
Marshall-Hallenbeck Oct 12, 2023
7edc283
fix(tests): re-add mistakenly removed tests
Marshall-Hallenbeck Oct 12, 2023
40f557b
ruff: fix flake8-builtins (A) issues
Marshall-Hallenbeck Oct 12, 2023
e3d6622
remove redundant paranthesis
Marshall-Hallenbeck Oct 13, 2023
3c4d9cc
ruff: change lint workflow to just run ruff and rely on pyproject.toml
Marshall-Hallenbeck Oct 13, 2023
dcc7241
ruff: auto-run flake8-comprehensions (C4)
Marshall-Hallenbeck Oct 13, 2023
0f93876
ruff: auto-run flake8-implicit-str-concat (ISC)
Marshall-Hallenbeck Oct 13, 2023
d9f2db1
ruff: manual flake8-implicit-str-concat (ISC) fixes
Marshall-Hallenbeck Oct 13, 2023
9b7d2cf
ruff: add flake8-import-conventions (ICN)
Marshall-Hallenbeck Oct 13, 2023
916c739
ruff: add flake8-pie (PIE) and auto-run
Marshall-Hallenbeck Oct 13, 2023
008b99a
ruff: add flake8-pytest-style (PT) and auto-run
Marshall-Hallenbeck Oct 13, 2023
ae14929
ruff: add flake8-quotes (Q) and auto-run
Marshall-Hallenbeck Oct 13, 2023
781afc9
ruff: add flake8-raise (RSE) and auto-run
Marshall-Hallenbeck Oct 13, 2023
cdcde5a
ruff: add flake8-return (RET) and auto-run
Marshall-Hallenbeck Oct 14, 2023
8f5e742
ruff: exclude RET505-508
Marshall-Hallenbeck Oct 14, 2023
9a4dbf1
tests: add --poetry parameter to prepend 'poetry run' before commands
Marshall-Hallenbeck Oct 14, 2023
cf63796
fix: ftp class name
Marshall-Hallenbeck Oct 14, 2023
d8b2931
ruff: add flake8-simplify (SIM) and auto-fix
Marshall-Hallenbeck Oct 14, 2023
cdc8bdb
fix: remove extra param added erroneously
Marshall-Hallenbeck Oct 14, 2023
39b0ca6
fix: ftp proto name
Marshall-Hallenbeck Oct 14, 2023
276e6c7
fix(tests): properly reference test passwords file
Marshall-Hallenbeck Oct 14, 2023
f3a358f
simplify logic and add additional debug statements
Marshall-Hallenbeck Oct 14, 2023
4d2ab76
refactor: simplify logic
Marshall-Hallenbeck Oct 14, 2023
7a8756d
add noqa for SIM115
Marshall-Hallenbeck Oct 14, 2023
c9b325a
refactor: update if logic
Marshall-Hallenbeck Oct 14, 2023
3a27363
refactor: use with for file open
Marshall-Hallenbeck Oct 14, 2023
e03e3a1
refactor: use with open for file opening
Marshall-Hallenbeck Oct 14, 2023
53af86a
refactor: use with open for file writing
Marshall-Hallenbeck Oct 14, 2023
c1585a5
refactor: simplify logic again
Marshall-Hallenbeck Oct 14, 2023
cd1b468
refactor: simplify logic
Marshall-Hallenbeck Oct 14, 2023
adeddb7
refactor remaining flake8-simplify (SIM) issues
Marshall-Hallenbeck Oct 14, 2023
378f660
ruff: add flake8-tidy-imports (TID)
Marshall-Hallenbeck Oct 14, 2023
b4475f4
ruff: add eradicate (ERA)
Marshall-Hallenbeck Oct 14, 2023
82e5d78
ruff: eradicate commented out code
Marshall-Hallenbeck Oct 14, 2023
21a8707
ruff: add Pylint (PL) and auto-run
Marshall-Hallenbeck Oct 14, 2023
847f849
ruff: remove Pylint from ruff
Marshall-Hallenbeck Oct 14, 2023
6fae02a
ruff: add flynt (FLY) and auto-fix
Marshall-Hallenbeck Oct 14, 2023
2b34359
ruff: add ERA001 ignores
Marshall-Hallenbeck Oct 14, 2023
201b328
ruff: pin 292 version since older versions dont display all checks
Marshall-Hallenbeck Oct 15, 2023
59767fe
refactor: move try outside forloop
Marshall-Hallenbeck Oct 15, 2023
0cb67d3
ruff: add PERF
Marshall-Hallenbeck Oct 15, 2023
f1af5b8
ruff: run previously unincluded PIE790 fixes in ruff 0.0.292
Marshall-Hallenbeck Oct 15, 2023
5b5ed0c
refactor: improve character randomization
Marshall-Hallenbeck Oct 15, 2023
bc0254d
refactor: clean up parse_perms logic
Marshall-Hallenbeck Oct 15, 2023
467882a
refactor: move try except outside forloops - PERF203
Marshall-Hallenbeck Oct 15, 2023
3e05665
refactor: use list comprehension for domains retrieved - PERF401
Marshall-Hallenbeck Oct 15, 2023
cd3f3e9
refactor: reference ascii_lowercase directly
Marshall-Hallenbeck Oct 15, 2023
b3ea011
remove string import
Marshall-Hallenbeck Oct 15, 2023
8c73dec
refactor(wmi): fix try except in forloop, add docstring, fix wql vari…
Marshall-Hallenbeck Oct 15, 2023
fd433b1
update logging string
Marshall-Hallenbeck Oct 15, 2023
94b515b
ruff: ignore PERF203 - only for pre-3.11 and may cause issues if refa…
Marshall-Hallenbeck Oct 15, 2023
528248d
refactor(samrfunc): use list/dict comprehension
Marshall-Hallenbeck Oct 15, 2023
a90898d
refactor: use list comprehension
Marshall-Hallenbeck Oct 15, 2023
6841537
refactor(daclread): add additional debug, update docstrings, refactor…
Marshall-Hallenbeck Oct 15, 2023
44b0619
refactor: list comprehension
Marshall-Hallenbeck Oct 15, 2023
e043e07
refactor: list comprehension, better header skip, and update docstring
Marshall-Hallenbeck Oct 15, 2023
dbc1fee
Replace for loops with list comprehensions
NeffIsBack Oct 15, 2023
2391d1d
Fix poetry.lock file
NeffIsBack Oct 15, 2023
e672dce
Convert for loops into list comprehensions
NeffIsBack Oct 15, 2023
e77ecd3
ruff: add F841 back in and auto-fix
Marshall-Hallenbeck Oct 15, 2023
052bfa3
Resolve merge conflicts
NeffIsBack Oct 15, 2023
b33f677
Simplify code and remove unused variables
NeffIsBack Oct 15, 2023
a7b95f2
ruff: add refurb (FURB) and auto-fix
Marshall-Hallenbeck Oct 16, 2023
b39389f
ruff: fix E261 - spaces before inline comments
Marshall-Hallenbeck Oct 16, 2023
84d55aa
ruff: add LOG (no fixes) and RUF and auto-fix
Marshall-Hallenbeck Oct 16, 2023
2854aa0
ruff: fix a single RUF012 and then ignore it for future use
Marshall-Hallenbeck Oct 17, 2023
d28dc10
fix(ruff): add back in res variable since it's called in the followin…
Marshall-Hallenbeck Oct 17, 2023
9861719
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 17, 2023
a3b0428
fix(tests): add in space so command is correct
Marshall-Hallenbeck Oct 17, 2023
14d6e9b
fix: remove ClassVar to be revisited later
Marshall-Hallenbeck Oct 17, 2023
8056ef8
fix(kerberos): pass kdc_host on kerberos connection
Marshall-Hallenbeck Oct 17, 2023
1ce4a5e
Update dependencies
NeffIsBack Oct 17, 2023
0cfdbd4
Update dependencies from dev
NeffIsBack Oct 17, 2023
ab5452d
Use poetry to run ruff
NeffIsBack Oct 17, 2023
dd3a285
Fix lint cli
NeffIsBack Oct 17, 2023
b3e1a0d
Add ruff version output to cli
NeffIsBack Oct 17, 2023
ffeb206
Increase parallel test runs and fix description of test cli
NeffIsBack Oct 18, 2023
f87eeff
move imports back to conditional and add comment
Marshall-Hallenbeck Oct 18, 2023
ce73f68
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 18, 2023
b9497d3
Revert "Merge branch 'develop' into marshall_cleanup"
Marshall-Hallenbeck Oct 18, 2023
0376a00
ruff: add in --preview flag for linting in GitHub runner
Marshall-Hallenbeck Oct 18, 2023
dbbffc5
fix(add-computer): set proper permission on open user request and exi…
Marshall-Hallenbeck Oct 18, 2023
085868c
fix(tests): some modules have a PASSWORD and may have a USERNAME para…
Marshall-Hallenbeck Oct 18, 2023
e153790
tests: add add-computer to e2e tests
Marshall-Hallenbeck Oct 18, 2023
41fac78
tests: add iis and pi module tests
Marshall-Hallenbeck Oct 18, 2023
30c474c
refactor(tests): move --options above the module run for each module
Marshall-Hallenbeck Oct 18, 2023
a68265b
feat(tests): allow running specific proto tests via --protocols
Marshall-Hallenbeck Oct 20, 2023
92ddea1
fix: remove unnecessary newlining
Marshall-Hallenbeck Oct 21, 2023
7eef62e
fix: undo newlining
Marshall-Hallenbeck Oct 21, 2023
c523d96
convert string concat to fstring
Marshall-Hallenbeck Oct 21, 2023
ac4c2f4
remove 'exploit' term from MS17-010 since its a check, not an exploit
Marshall-Hallenbeck Oct 21, 2023
e9dd72e
remove python env specification
Marshall-Hallenbeck Oct 21, 2023
3ce70c7
fix arbitrary newlining
Marshall-Hallenbeck Oct 21, 2023
33a8dfc
remove redundant log call
Marshall-Hallenbeck Oct 21, 2023
8ecdceb
fix redundant lines
Marshall-Hallenbeck Oct 21, 2023
41ec0b1
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 21, 2023
aa69605
remove http server; fixes #21
Marshall-Hallenbeck Oct 22, 2023
b31b3b7
fix: remove loading http server for #35
Marshall-Hallenbeck Oct 22, 2023
e9eccba
refactor: remove Python shebangs since they are not needed
Marshall-Hallenbeck Oct 22, 2023
9e6cef1
remove unnecessary import
Marshall-Hallenbeck Oct 22, 2023
96f4d2e
Cache python dependencies in lint.yml
NeffIsBack Oct 23, 2023
8d32b56
Update lint.yml
NeffIsBack Oct 23, 2023
2595fab
Format cli.py
NeffIsBack Oct 24, 2023
34c9c33
Extract base64 code to file
NeffIsBack Oct 24, 2023
cdf089f
Fix format of config list
NeffIsBack Oct 24, 2023
d1db71d
Fix multi-line log message
NeffIsBack Oct 26, 2023
c2d6ead
Extract base64 script from python code
NeffIsBack Oct 26, 2023
a416cec
Convert one-liner into multi-liner for readability
NeffIsBack Oct 26, 2023
afe4cd7
Change back formating for readability
NeffIsBack Oct 26, 2023
db8368e
Change back formating for readability
NeffIsBack Oct 26, 2023
b2c63d5
Change back formating for readability
NeffIsBack Oct 26, 2023
dc5ef93
Merge branch 'develop' into marshall_cleanup
Marshall-Hallenbeck Oct 26, 2023
84431ba
readd pyreadline to poetry.lock
Marshall-Hallenbeck Oct 26, 2023
71d39f2
ruff: autofix
Marshall-Hallenbeck Oct 26, 2023
ce1d2a0
ruff: linting stuff (some was from my conflict resolution I messed up)
Marshall-Hallenbeck Oct 26, 2023
0bdbdc7
fix(tests): add second parameter for ftp put location
Marshall-Hallenbeck Oct 26, 2023
dcdff05
fix and add more debug statements for winrm
Marshall-Hallenbeck Oct 26, 2023
9387891
fix comments without space after hash
Marshall-Hallenbeck Oct 26, 2023
72500d9
Simplify code and remove unnecessary return nones
NeffIsBack Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint Python code with ruff
# Caching source: https://gist.github.com/gh640/233a6daf68e9e937115371c0ecd39c61?permalink_comment_id=4529233#gistcomment-4529233

on: [push, pull_request]

jobs:
lint:
name: Lint Python code with ruff
runs-on: ubuntu-latest
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies with dev group
run: |
poetry install --with dev
- name: Run ruff
run: |
poetry run ruff --version
poetry run ruff check . --preview
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
name: NetExec Tests for Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
max-parallel: 5
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: NetExec tests on ${{ matrix.os }}
- name: NetExec set up python on ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ coverage.xml
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

Expand Down
Empty file removed .gitmodules
Empty file.
17 changes: 6 additions & 11 deletions build_collector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import shutil
import subprocess
Expand All @@ -11,27 +8,26 @@

from shiv.bootstrap import Environment

# from distutils.ccompiler import new_compiler
from shiv.builder import create_archive
from shiv.cli import __version__ as VERSION


def build_nxc():
print("building nxc")
print("Building nxc")
try:
shutil.rmtree("bin")
shutil.rmtree("build")
except Exception as e:
except FileNotFoundError:
pass
except Exception as e:
print(f"Exception while removing bin & build: {e}")

try:
print("remove useless files")
os.mkdir("build")
os.mkdir("bin")
shutil.copytree("nxc", "build/nxc")

except Exception as e:
print(e)
print(f"Exception while creating bin and build directories: {e}")
return

subprocess.run(
Expand All @@ -48,7 +44,6 @@ def build_nxc():
check=True,
)

# [shutil.rmtree(p) for p in Path("build").glob("**/__pycache__")]
[shutil.rmtree(p) for p in Path("build").glob("**/*.dist-info")]

env = Environment(
Expand Down Expand Up @@ -93,7 +88,7 @@ def build_nxcdb():
try:
build_nxc()
build_nxcdb()
except:
except FileNotFoundError:
pass
finally:
shutil.rmtree("build")
92 changes: 0 additions & 92 deletions flake.lock

This file was deleted.

36 changes: 0 additions & 36 deletions flake.nix

This file was deleted.

3 changes: 0 additions & 3 deletions nxc/.hooks/hook-lsassy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all("lsassy")
3 changes: 0 additions & 3 deletions nxc/.hooks/hook-pypykatz.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all("pypykatz")
Loading