815 Commits

Author SHA1 Message Date
SirBroccoli a9d8395583 Auto-merge PR #648 (Chack Agent)
Co-authored-by: HackTricks PEASS Wordlist Updater <peass-wordlist-updater@hacktricks.xyz>
2026-06-08 08:58:55 +00:00
SirBroccoli 4be3e81aef Auto-merge PR #647 (Chack Agent)
Co-authored-by: HackTricks PEASS Autoimprover <peass-autoimprover@hacktricks.xyz>
2026-05-31 06:56:24 +00:00
Carlos Polop d01e61a0ac Merge branch 'master' of github.com:peass-ng/PEASS-ng 2026-05-28 12:44:29 +02:00
Carlos Polop 195fc242ba f 2026-05-28 12:44:26 +02:00
SirBroccoli e5f01f3df7 Auto-merge PR #643 (Chack Agent)
Co-authored-by: HackTricks PEASS Wordlist Updater <peass-wordlist-updater@hacktricks.xyz>
2026-05-25 08:07:28 +00:00
Carlos Polop 18ea88b35b Expand linPEAS module metadata tests 2026-05-21 13:24:52 +02:00
Carlos Polop ca743bf978 Bound linpeas sudo listing checks 2026-05-21 13:09:33 +02:00
Carlos Polop 1ea8107bf5 Fix bot PR auto-merge and linpeas exclude matching 2026-05-21 13:03:38 +02:00
sammonsempes 0d6dab6c1e [LINPEAS] Add Dirty Frag check (CVE-2026-43284 / CVE-2026-43500) (#640) 2026-05-10 19:01:55 +02:00
Rodrigo Amaral 179f79794d Fix broken link for PackageKit Pack2TheRoot (#639)
Co-authored-by: Rodrigo <rodrigo@192>
2026-05-06 10:50:12 +02:00
Carlos Polop 15a244cb30 Improve Azure VM managed identity discovery 2026-05-05 17:58:20 +02:00
Carlos Polop 49bafa87a9 f 2026-04-30 13:45:33 +02:00
Carlos Polop 8bf6564d02 f 2026-04-30 13:30:04 +02:00
Carlos Polop c447ef1433 copyfail check 2026-04-30 12:59:09 +02:00
Théo Louis-Tisserand e9dc98fc9c fix(linpeas): correct pkexec version regex pattern (#632) 2026-04-30 10:00:50 +02:00
SirBroccoli 1993984d21 Auto-merge PR #636 (Chack Agent)
Co-authored-by: HackTricks PEASS Autoimprover <peass-autoimprover@hacktricks.xyz>
2026-04-30 06:07:24 +00:00
sammonsempes f8273fa13b feat: detect PackageKit Pack2TheRoot (CVE-2026-41651) (#634) 2026-04-22 20:05:17 +02:00
Carlos Polop 5d4b4522ef lhe 2026-04-17 13:15:05 +02:00
s1d3r 65d6e4662a fix(linpeas): highlight writable shell binaries as 95% PE vector on merged-usr systems (#630)
The PATH-derived portion of writeVB uses `sed 's/:/$|^/g'` to turn the
colon-separated PATH into an alternation regex. This produces patterns like
`^/usr/bin$|^/sbin$|^/bin` where every entry except the last gets a trailing
`$` anchor — making it an exact match on the directory name itself rather than
a prefix match on files inside it.

On modern merged-/usr distributions (Debian 10+, Ubuntu 20.04+, Fedora 17+,
Arch) `/bin` is a symlink to `usr/bin`, so `find /` returns `/usr/bin/bash`
rather than `/bin/bash`.  The pattern `^/usr/bin$` does not match
`/usr/bin/bash` (the `$` prevents it), so a writable bash binary falls through
to the lower-severity writeB coloring (plain RED) instead of the 95% PE vector
RED/YELLOW.

Add explicit patterns for the common shell interpreters and env so they are
always flagged as 95% PE vectors regardless of PATH ordering or /usr-merge
layout:

  /bin/bash  /usr/bin/bash
  /bin/sh    /usr/bin/sh
  /bin/dash  /usr/bin/dash
  /bin/zsh   /usr/bin/zsh
  /usr/bin/env

Co-authored-by: s1d3r <s1d3r@users.noreply.github.com>
2026-04-12 23:44:18 +02:00
Jaime Polop b1a2eef8fd Update 4_Capabilities.sh (#629) 2026-04-09 15:54:03 +02:00
SirBroccoli 5841e7c39d Auto-merge PR #628 (Chack Agent)
Co-authored-by: HackTricks PEASS Autoimprover <peass-autoimprover@hacktricks.xyz>
2026-03-31 05:11:16 +00:00
R Muthra ac31bcefab feat: detect hidden group access via newgrp (gshadow desync) (#625)
* feat: detect hidden group access via newgrp (gshadow desync)

Problem: groups/id only show current session memberships
Fix: probe all system groups via newgrp to detect accessible groups not shown
Impact: identifies hidden access (docker, lxd, etc.) missed by standard checks

Real case: user present in gshadow docker group but not reflected in session
newgrp docker succeeds -> container escape -> root

* Update linPEAS/builder/linpeas_parts/6_users_information/19_Actual_groups.sh

fixed the  command-injection vector.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Muthra <muthra@example.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: SirBroccoli <carlospolop@gmail.com>
2026-03-23 16:29:33 +01:00
SirBroccoli b8528da949 Improve container and runtime enumeration (#624)
* Improve container and runtime enumeration

* Fix CI failures for PR #624

---------

Co-authored-by: chack-agent <chack-agent@users.noreply.github.com>
2026-03-22 21:44:38 +01:00
Carlos Polop d71e346ab1 f 2026-03-20 16:56:05 +01:00
SirBroccoli 1fb7aefa40 Auto-merge PR #622 (Chack Agent)
* test: trigger linpeas workflow failure

* Fix CI failures for PR #622

* docs: clarify builder output wording

---------

Co-authored-by: chack-agent <chack-agent@users.noreply.github.com>
2026-03-19 21:27:55 +00:00
github-actions[bot] 43acba0fde Fix CI-master_test failure (run #22819411371) (#616)
* Fix CI-master failures for run #22819411371

* Delete linPEAS/linpeas_fat.sh

---------

Co-authored-by: chack-agent <chack-agent@users.noreply.github.com>
Co-authored-by: SirBroccoli <carlospolop@gmail.com>
2026-03-08 16:02:36 +01:00
Carlos Polop aaaa178974 Merge branch 'master' of github.com:peass-ng/PEASS-ng 2026-03-08 11:41:18 +01:00
Carlos Polop 2bc2911c1d f 2026-03-08 11:41:15 +01:00
Giveen 115b7e60a7 MITRE ATT&CK Integration for LinPEAS and WinPEAS (#614)
* feat: MITRE ATT&CK integration for LinPEAS and WinPEAS

- Add -T T1234,T5678 flag to LinPEAS to filter checks by technique
- Add mitre=T1234,T5678 argument to WinPEAS for technique-based filtering
- Annotate every check title with MITRE technique ID(s) displayed in grey
- Add $_mitre_tag to Generated Global Variables in 0_variables_base.sh
- Add check_mitre_filter() shell function with prefix-match support
- Add MitreAttackIds property to ISystemCheck interface (C#)
- Update MainPrint/GreatPrint in Beaprint.cs to accept optional mitreIds
- Tag all 158 LinPEAS check modules with # Mitre: metadata
- Tag all 16 WinPEAS check classes with MitreAttackIds property
- Update linpeasModule.py to parse # Mitre: metadata field
- Update linpeasBaseBuilder.py to emit check_mitre_filter wrappers
- Add 3 MITRE argument parsing tests to ArgumentParsingTests.cs

* test: add MITRE filter coverage for LinPEAS builder and WinPEAS

LinPEAS (test_builder.py):
- test_mitre_flag_present_in_getopts: -T: must appear in getopts string
- test_mitre_flag_present_in_help_text: -T must appear in built help text
- test_mitre_filter_function_present: check_mitre_filter() must be in built script

WinPEAS (ArgumentParsingTests.cs):
- PassesMitreFilter_EmptyFilter_AllChecksPass: no filter -> all checks run
- PassesMitreFilter_ExactMatch_Passes: T1082 filter matches T1082 check
- PassesMitreFilter_NoMatch_Fails: T1082 filter rejects T1057 check
- PassesMitreFilter_PrefixMatch_Passes: T1552 filter matches T1552.001/T1552.005
- PassesMitreFilter_SubtechniqueDoesNotMatchDifferentBase_Fails: T1548 != T1552.001

* chore: ignore .github/instructions/ and untrack todos.instructions.md

* fix: complete and accurate MITRE ATT&CK mappings for LinPEAS and WinPEAS

gitignore:
- Add .github/instructions/ to .gitignore and untrack todos.instructions.md

LinPEAS — corrected mappings:
- 29_Interesting_environment_variables.sh: add missing T1552.007,T1082
- 3_USBCreator.sh: T1548 → T1548.003,T1068 (polkit bypass + CVE-class exploit)
- 9_Doas.sh: T1548 → T1548.003 (doas is a sudo/sudo-caching equivalent)
- 10_Pkexec.sh: T1548 → T1548.003,T1548.004,T1068 per-section specificity
- 2_Process_cred_in_memory.sh: T1003,T1055 → T1003.007 (Proc Filesystem, drop wrong T1055)
- 11_Superusers.sh: T1087.001,T1548 → T1087.001 (discovery only, no elevation abuse)
- 14/15/16 writable files: T1574 → T1574.009,T1574.010 (specific sub-techniques)

WinPEAS — corrected mappings:
- SystemInfo: class expanded to full technique union; WSUS T1195→T1072,T1068;
  KrbRelayUp T1558→T1187,T1558; Object Manager T1548→T1068;
  Named Pipes T1559.001→T1559; Low-priv pipes T1559.001→T1134.001,T1559
- EventsInfo: class expanded with T1078.003,T1552.001,T1059.001,T1082
- UserInfo: class expanded; Token privileges T1134→T1134.001
- ProcessInfo: Leaked Handlers T1134.003→T1134.001 (token impersonation, not make-token)
- ServicesInfo: class adds T1574.011,T1068
- ApplicationsInfo: class adds T1010,T1014
- NetworkInfo: class adds T1018,T1090
- ActiveDirectoryInfo: T1484→T1484.001; class adds T1003
- WindowsCreds: class sub-techniques T1552→T1552.001,T1552.002, T1555→T1555.003,T1555.004;
  SSClient T1059→T1552.001 (wrong technique entirely)
- FilesInfo: class expanded with T1552.002,T1552.004,T1552.006,T1564.001,T1574.001,
  T1059.004,T1114.001,T1218,T1649; Cloud Credentials T1552.005→T1552.001
- SoapClientInfo: T1059,T1071→T1559,T1071.001 (IPC/Web protocol, not scripting)

* fix: add missing T1613 and T1562.001 to SystemInfo class-level MitreAttackIds; label AD object enumeration with T1087.002 and T1018

* fix: correct linpeas mitre filter matching logic

* fix: MITRE code bugs — pass-through for untagged checks, remove dead OR in section gate

- PassesMitreFilter (Checks.cs): when MitreAttackIds is null or empty and a filter
  is active, return true (pass-through) instead of false.  Previously any future
  ISystemCheck added without MITRE IDs would be silently excluded by an active filter.
- linpeasBaseBuilder.py: remove redundant '|| [ -z "$MITRE_FILTER" ]' from the
  generated section-level gate.  check_mitre_filter already returns 0 immediately
  when MITRE_FILTER is empty, so the OR branch was unreachable and inconsistent with
  the check-level gate which uses the same function without the extra guard.
- ArgumentParsingTests.cs: add PassesMitreFilter_NullMitreAttackIds_PassesThrough
  and PassesMitreFilter_EmptyMitreAttackIds_PassesThrough regression tests.

* fix(mitre): 4 bugs — dead arg parser, wait logic, subprocess forks, cleanup race

Checks.cs: max-regex-file-size used string.Equals which requires exact match,
so 'max-regex-file-size=500000' could never match and MaxRegexFileSize was stuck
at 1000000 forever. Fixed to arg.StartsWith.

Checks.cs RunChecks: wait compared loop index i against
_systemCheckSelectedKeysHashSet.Count, which is 0 when all checks run (so
i < -1 is always false) and semantically wrong when a key subset is selected.
Replaced with a pre-count of checks that pass both filters and a running counter.

0_variables_base.sh check_mitre_filter: replaced two $(echo ... | tr ...)
subprocess forks per call with pure parameter-expansion while-loops. Zero
process forks, POSIX-compliant, ~632 fork()s saved per full filtered run.
Declares _mitre_tags_left and _mitre_filters_left in Generated Global Variables.

linpeas_builder.py: os.remove of the shared temp file raised FileNotFoundError
when multiple sequential builder invocations ran (the second saw the file
already deleted by the first). Wrapped in try/except FileNotFoundError.

Tests: Added PassesMitreFilter_SubtechniqueFilter_DoesNotMatchParentOnlyTag
and MaxRegexFileSize_ArgParsed_Correctly regression tests (16 total).

* ci: add manual build-artifacts workflow (winPEAS.exe + linpeas.sh)

* fix(linpeas): getopts silent mode — clear error when -T given without argument

Switch getopts to silent mode (leading ':') so the shell does not emit its
own terse 'No arg for -T option' message. Add explicit :) case that prints
  ERROR: -T requires an argument (e.g. -T T1082,T1552)
and then dumps the help text before exiting 1. Add *) case for unrecognised
flags with the same pattern. Behaviour for all valid flags is unchanged.

* chore: untrack build-artifacts workflow, add to .gitignore
2026-03-08 01:26:40 +01:00
Giveen ec18e4b2e2 Fix thread count override and add -z flag to set thread count (#611)
* 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
2026-03-06 11:36:03 +01:00
SirBroccoli 42f126c392 Auto-merge PR #609 (Chack Agent)
Co-authored-by: HackTricks PEASS Autoimprover <peass-autoimprover@hacktricks.xyz>
2026-02-28 04:20:02 +00:00
SirBroccoli 11a506f81a Auto-merge PR #607 (Chack Agent)
Co-authored-by: HackTricks PEASS Wordlist Updater <peass-wordlist-updater@hacktricks.xyz>
2026-02-26 12:20:50 +00:00
SirBroccoli 39e475923f Auto-merge PR #605 (Chack Agent)
* ci: speed up PR-tests and add linpeas typo fixture

* Fix syntax: use '==' in __main__ guard in linpeas_builder.py

* ci: retrigger pr-tests after fixer

* f

* kernel checks

* Revert PR changes to PR-tests.yml and regexes.yaml (#606)

* Initial plan

* revert: remove PR changes to PR-tests.yml and regexes.yaml

Co-authored-by: carlospolop <17181413+carlospolop@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: carlospolop <17181413+carlospolop@users.noreply.github.com>

---------

Co-authored-by: chack-agent <chack-agent@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: carlospolop <17181413+carlospolop@users.noreply.github.com>
2026-02-26 00:28:24 +00:00
Carlos Polop 98e5e7c3f2 f 2026-02-24 21:31:15 +01:00
Carlos Polop 381bf74ebd test: intentional master break in linpeas builder for chack validation 2026-02-14 01:03:28 +01:00
Carlos Polop 3e2af030d4 f 2026-02-12 20:02:37 +01:00
Carlos Polop ec746e73e3 additions 2026-02-12 03:44:02 +01:00
Carlos Polop cf3565d7e0 Revert "test: intentional ci break for chack agent workflow validation"
This reverts commit 386ef0642a.
2026-02-11 17:17:46 +01:00
Carlos Polop 386ef0642a test: intentional ci break for chack agent workflow validation 2026-02-11 17:05:14 +01:00
SirBroccoli 5c110bd4f8 Fix/systemd generated vars ci (#584)
* Fix Systemd module generated vars metadata

* add auto master fix

* f
2026-02-11 11:43:32 +01:00
SirBroccoli c1bf38a8ab Auto-merge PR #581 (Codex) 2026-02-03 23:34:53 +00:00
Carlos Polop 04c0b8aab3 f 2026-02-03 18:11:07 +01:00
SirBroccoli fce28d2b81 Auto-merge PR #579 (Codex)
* autoimprover: simplify linpeas checks

* Fix CI failures for PR #579

---------

Co-authored-by: HackTricks PEASS Autoimprover <peass-autoimprover@hacktricks.xyz>
Co-authored-by: codex-action <codex-action@users.noreply.github.com>
2026-01-31 12:54:18 +00:00
Carlos Polop 1473fedcbf Fix linPEAS module section path matching 2026-01-21 15:21:50 +01:00
Carlos Polop f8f4250b81 Add stronger winPEAS/linPEAS tests 2026-01-21 15:14:08 +01:00
Carlos Polop 83580fcd8a Re-enable winPEAS tests and add linPEAS builder checks 2026-01-21 01:15:38 +01:00
SirBroccoli db30e3bd7d Fix Browser_profiles module ID casing (#576) 2026-01-20 23:54:30 +01:00
SirBroccoli b4c1043a93 Merge branch 'master' into fix/issue-410-printnightmare 2026-01-20 23:06:29 +01:00
SirBroccoli 3371be7bd6 Merge pull request #557 from peass-ng/fix/issue-474-service-timeout
Add timeout to service enumeration
2026-01-20 23:02:35 +01:00
SirBroccoli 2344f5b106 Auto-merge PR #570 (Codex) 2026-01-20 17:25:25 +00:00