Commit Graph
27 Commits
Author SHA1 Message Date
658fa66b18 Fix CI-master failures for run #22804086303 (#613)
Co-authored-by: chack-agent <chack-agent@users.noreply.github.com>
2026-03-07 23:55:03 +01:00
c9055a7688 winPEAS: Fix network scanning (arg parsing, race condition, port scanner, auto-mode crash) (#612)
* Fix thread count override and add -z flag to set thread count

* Enforce THREADS >= 1 after detection; validate -z range; clarify help text

* Strip colours from -z warning; add regression tests for -z getopts/help

* Tighten getopts regression test: match 'while getopts' line with regex

* Fix WinPEAS network host discovery and port scanner bugs

- Fix auto-mode NullReferenceException: change plain 'if' to 'else if'
  for IPAddressNetmask/IPAddressList branches in NetworkScanner.Scan(),
  so the auto path no longer falls through and calls AddRange(null)
- Fix HostsAlive race condition in NetPinger: replace List<string> with
  ConcurrentBag<string> so concurrent async ping callbacks don't corrupt
  the collection
- Fix unbound parallelism: cap outer host loop at MaxDegreeOfParallelism=5
  and inner port loop at 50; create a PortScanner per host to remove
  shared-state concerns
- Fix port scan output bypassing Beaprint: replace raw Console.WriteLine
  with Beaprint.GoodPrint so open-port results are colour-highlighted and
  respect -nocolor
- Move network scan into NetworkInfo.PrintInfo(): add PrintNetworkScan()
  method, wire it into the check list when IsNetworkScan is true, remove
  the detached scan block from RunChecks(), expose NetworkScanOptions and
  PortScannerPorts as public, and remove the now-unused using directive

* Add compiled binaries (x86/x64/Release), Directory.Build.targets Linux shim, fix Vault enum/struct casing

* Fix -network/-ports arg parsing to accept space-separated values

* Remove Directory.Build.targets from tracking; add to .gitignore

* Dispose Ping per-attempt in NetPinger to prevent handle leaks on large sweeps

* Fix TcpClient/WaitHandle leaks in PortScanner: use using block, close wait handle, remove stale AsyncCallback+TcpPortState

* Force-select networkinfo check when -network is set with a subset of checks

* Remove unused System.Threading.Tasks import from PortScanner

* Add tests for space-separated -network/-ports arg normalisation

* Remove Thread.Sleep(1) and unused System.Threading import from PortScanner

* Replace BeginConnect/WaitOne APM with ConnectAsync+Wait(timeout) in PortScanner

* Cap concurrent pings at 50 with SemaphoreSlim in NetPinger to prevent resource exhaustion on large ranges

* Isolate per-IP ping exceptions so a single bad target can't abort the sweep; surface errors in debug mode

* Observe timed-out ConnectAsync task via ContinueWith to prevent UnobservedTaskException

* Broaden ParseOnly reset to cover all arg-parsing-mutable Checks fields to prevent test cross-talk

* Add MainPrint/LinkPrint header to PrintNetworkScan; remove misplaced GreatPrint from NetworkScanner.Scan()

* Add dedicated 'networkscan' system check to avoid running all NetworkInfo sub-checks when -network is passed with a subset

* Delete linpeas_test.sh

* Delete winPEAS/winPEASexe/binaries/Release/winPEAS.exe

* Delete winPEAS/winPEASexe/binaries/x64/Release/winPEAS.exe

* Delete winPEAS/winPEASexe/binaries/x86/Release/winPEAS.exe

---------

Co-authored-by: SirBroccoli <carlospolop@gmail.com>
2026-03-07 14:12:16 +01:00
Carlos Polop f8f4250b81 Add stronger winPEAS/linPEAS tests 2026-01-21 15:14:08 +01:00
Carlos Polop 651dc9cd7d Force-copy TestPlatform framework for MSTest 2026-01-21 12:53:49 +01:00
Carlos Polop 0808fb7f1b Ensure MSTest adapter finds TestPlatform framework 2026-01-21 12:24:56 +01:00
Carlos Polop c332fab519 Fix MSTest adapter dependency load 2026-01-21 11:55:35 +01:00
Carlos Polop 577dcc9964 Fix MSTest framework copy-local for CI 2026-01-21 11:27:00 +01:00
Carlos Polop b591f3d524 Fix winPEAS argument parsing tests 2026-01-21 10:57:32 +01:00
Carlos Polop 83580fcd8a Re-enable winPEAS tests and add linPEAS builder checks 2026-01-21 01:15:38 +01:00
SirBroccoliandGitHub 215c5d074e Merge pull request #456 from peass-ng/dependabot/nuget/winPEAS/winPEASexe/Tests/System.Text.RegularExpressions-4.3.1
Bump System.Text.RegularExpressions from 4.3.0 to 4.3.1 in /winPEAS/winPEASexe/Tests
2025-09-03 13:36:40 +02:00
Carlos Polop 7cd9e6f78b az tokens 2025-01-25 00:40:15 +01:00
dependabot[bot]andGitHub 859a44230d Bump System.Text.RegularExpressions in /winPEAS/winPEASexe/Tests
Bumps System.Text.RegularExpressions from 4.3.0 to 4.3.1.

---
updated-dependencies:
- dependency-name: System.Text.RegularExpressions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-24 18:29:38 +00:00
Carlos Polop 21a5ef9325 add az tokens 2025-01-24 19:27:57 +01:00
Carlos Polop eebe7974a9 gcds 2024-10-07 13:35:40 +01:00
Carlos Polop b8adc7af3b gcpw.test 2024-10-01 04:06:15 +01:00
Carlos Polop f80c1f371e gcpw 2024-10-01 03:41:07 +01:00
Carlos Polop f90cdf9a87 find gcpw info 2024-10-01 02:36:12 +01:00
Carlos Polop b435119723 WinPEASS Big Update 2024-08-27 22:08:48 +02:00
makikvues 78d187db52 - fixed logo
- updated tests, long-running checks are removed
- create search lists only if necessary
2023-08-03 19:21:22 +02:00
Carlos PolopandGitHub 7bb66d2182 Delete SearchHelperTests.cs 2023-05-08 17:20:30 +02:00
Michael Moran 5b96594c3c speed up file search and fix long path error 2023-03-28 06:25:05 +11:00
godylockz 3cc49b5b9a Code Cleanup 2022-12-23 00:45:23 -05:00
makikvues d9c5406244 - updates 2021-07-07 12:13:09 +02:00
makikvues faefb80ec4 - updated winpeas tests
- updated CI-winpeas_build_test.yml
2021-07-07 10:46:51 +02:00
makikvues 4a0bc39db1 Merge branch 'master' into winpeas_dev 2021-07-06 17:05:22 +02:00
makikvues f4bb5dcb9d - tests update 2021-07-06 16:56:28 +02:00
makikvues 1af100d9c4 - updates tests project
- updated github action
2021-07-06 15:19:49 +02:00