peass-ng / PEASS-ng

PEASS - Privilege Escalation Awesome Scripts SUITE (with colors)

Home Page:https://book.hacktricks.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LinPEAS - Exploit Suggester red color not applied in a specific case

Schrubitteflau opened this issue · comments

If you are going to suggest something, please remove the following template.

Issue description

When the section Executing Linux Exploit Suggester is reached, Linux Exploit Suggester is executed and some regexes are applied with sed to add some colors on its results. However, if several CVE identifiers are found for a same vulnerability, it breaks the regex and the red color is not applied, see :
image

Steps to reproduce the issue

  1. Download the last release of LinPEAS
  2. Execute it on any system that might be vulnerable to a lot of CVEs, to get more results from Linux Exploit Suggester, such as 14.04.6 LTS
  3. Hopefully find a line with several CVE identifiers and notice that the red color is not applied

Which parameters did you use for executing the script and how did you execute it?

No parameter, but the issue stands in the System Information section, so -o system_information can be used.

Is there any AV / Threat protection in the system?

no

Please, indicate the OS, the OS version, and the kernel version (build number in case of Windows)

Linux ubuntu 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
VERSION="14.04.6 LTS, Trusty Tahr"

Please, indicate the check that is failing and add a screenshot showing the problem

I suggest updating the current regex from \[CVE-[0-9]+-[0-9]+\].* to [(CVE-[0-9]+-[0-9]+,?)+\].*. Not that a comma , is now part of the regex, which means the sed delimitor should be modified, for example from sed -${E} "s,\[CVE-[0-9]+-[0-9]+\].*,${SED_RED},g" to sed -${E} "s/\[(CVE-[0-9]+-[0-9]+,?)+\].*/${SED_RED}/g"

How did you expect it to work?

The red color should be applied. The modification mentionned above seems to solve the issue :
image

Additional details / screenshot

Note that this issue has been seen on Linux Exploit Suggester (version 1), NOT the 2.

I guess this is already fixed