# Title: System Information - Linux Exploit Suggester 2
# ID: SY_Linux_exploit_suggester_2
# Author: Carlos Polop
# Last Update: 07-03-2024
# Description: Execute Linux Exploit Suggester 2 (Perl version) to identify potential kernel exploits:
#   - Alternative kernel vulnerability detection
#   - Perl-based exploit suggestions
#   - Common vulnerable scenarios:
#     * Known kernel vulnerabilities
#     * Unpatched kernel versions
#     * Missing security patches
#     * Alternative exploit paths
#   - Exploitation methods:
#     * Kernel exploit execution: Use suggested exploits
#     * Common attack vectors:
#       - Kernel memory corruption
#       - Race conditions
#       - Use-after-free
#       - Integer overflow
#     * Exploit techniques:
#       - Kernel memory manipulation
#       - Privilege escalation
#       - Root access acquisition
#       - System compromise
# License: GNU GPL
# Version: 1.0
# Functions Used: print_2title, print_info
# Global Variables:
# Initial Functions:
# Generated Global Variables: $les2_b64
# Fat linpeas: 1
# Small linpeas: 0


if [ "$(command -v perl 2>/dev/null || echo -n '')" ] && ! [ "$MACPEAS" ]; then
    print_2title "Executing Linux Exploit Suggester 2"
    print_info "https://github.com/jondonas/linux-exploit-suggester-2"
    les2_b64="peass{https://raw.githubusercontent.com/jondonas/linux-exploit-suggester-2/master/linux-exploit-suggester-2.pl}"
    echo $les2_b64 | base64 -d | perl 2>/dev/null | sed "s,$(printf '\033')\\[[0-9;]*[a-zA-Z],,g" | grep -iE "CVE" -B 1 -A 10 | grep -Ev "^\-\-$" | sed -${E} "s,CVE-[0-9]+-[0-9]+,${SED_RED},g"
    echo ""
fi
