Capstone Practical Labs
Import all the VMs into VMWare Workstation Pro (free) or Virtualbox and change Network adapter to NAT.
Blue
O.S. - Windows 7
Credentials:
user:Password123!
administrator:Password456!
mkdir -p ~/tcm/peh/blue/
cd ~/tcm/peh/blue/sudo nmap -p- -A -T4 192.168.31.132 -oA bluePORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Windows 7 Ultimate 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
49152/tcp open msrpc Microsoft Windows RPC
49153/tcp open msrpc Microsoft Windows RPC
49154/tcp open msrpc Microsoft Windows RPC
49155/tcp open msrpc Microsoft Windows RPC
49156/tcp open msrpc Microsoft Windows RPC
MAC Address: 00:0C:29:33:BE:EE (VMware)
Device type: general purpose
Running: Microsoft Windows 7|2008|8.1
OS CPE: cpe:/o:microsoft:windows_7::- cpe:/o:microsoft:windows_7::sp1 cpe:/o:microsoft:windows_server_2008::sp1 cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_8 cpe:/o:microsoft:windows_8.1
OS details: Microsoft Windows 7 SP0 - SP1, Windows Server 2008 SP1, Windows Server 2008 R2, Windows 8, or Windows 8.1 Update 1
Network Distance: 1 hop
Service Info: Host: WIN-845Q99OO4PP; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 2:1:0:
|_ Message signing enabled but not required
| smb2-time:
| date: 2024-07-13T20:57:32
|_ start_date: 2024-07-13T20:49:44
|_nbstat: NetBIOS name: WIN-845Q99OO4PP, NetBIOS user: <unknown>, NetBIOS MAC: 00:0c:29:33:be:ee (VMware)
|_clock-skew: mean: 1h19m51s, deviation: 2h18m33s, median: -8s
| smb-os-discovery:
| OS: Windows 7 Ultimate 7601 Service Pack 1 (Windows 7 Ultimate 6.1)
| OS CPE: cpe:/o:microsoft:windows_7::sp1
| Computer name: WIN-845Q99OO4PP
| NetBIOS computer name: WIN-845Q99OO4PP\x00
| Workgroup: WORKGROUP\x00
|_ System time: 2024-07-13T16:57:32-04:00
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
TRACEROUTE
HOP RTT ADDRESS
1 0.68 ms 192.168.31.132Exploit MS17-010
MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
Metasploit

Manual exploit

โ The machine can crash with this attack.

Academy
O.S. - Debian 10
Credentials:
root:tcm
Consider first attacks to ports
21,80.Brute-forcing port
22(SSH) can be used to check if network detection is applied at client side, and for testing some default/weak credentials.
Port 80
Visit 192.168.31.128
Debian
Apache 2.4.38 Server default webpage
poor hygiene, etc
http://192.168.31.128/phpmyadmin
FTP - Port 21
First do a version check for vulnerabilities
Proceed with
ftpconnection
Try http://192.168.31.128/note.txt - Not found
10201321 - cd73502828457d15655bbd7a63fb0bc8
Crash md5 hash online
โก๏ธ hashcat
Inside the Kali VM,
hashcatwill use only the CPU for cracking the hash

10201321:student
โก๏ธ dirb
โก๏ธ ffuf
Navigate to http://192.168.31.128/academy
Use
10201321:studentcredentials to login
Check pages source code for CMS versions
Try to upload a picture - upload successful
Check the image URL - e.g. http://192.168.31.128/academy/studentphoto/peh-course-solo-icon.png
Try to upload a reverse shell, to abuse the file upload
Upload via PHP
Use GitHub - pentestmonkey/php-reverse-shell - copy the content of
php-reverse-shell.phpand create ashell.phpfile with that contentSet the
$ipequal to the Kali VM IP
Upload the
shell.phpfile using the web image uploaderThe file is already executed (if not navigate to its webpage)
Reverse shell working

Privilege Escalation LinPEAS
โก๏ธ LinPEAS

Check for interesting data
โก๏ธ pspy - Monitor linux processes without root permissions
Download
pspy64and move it into the~/toolsdir where Python HTTP server is running

Run a bash reverse shell one liner
Since the script will run as
rootuser's cronjob, root shell will be executed

Dev
O.S. - Debian 10
Credentials:
root:tcm
HTTP - Port 80/8080
Bolt
/var/www/html/

PHP info page - information disclosure
PHP Version 7.3.27-1~deb10u1

Navigate to each found directory
NFS - Port 2049
Crack ZIP
โก๏ธ fcrackzip
LFI
Navigate to the BoltWire application http://192.168.31.130:8080/dev/
Use the
Local File Inclusionvulnerability, that allows to expose files running on a serverLFI - Steps to Reproduce:
Using HTTP GET request browse to the following page, whilst being authenticated user.
Create and account and login

SSH
The user is
jeanpaul

Abuse
sudo /usr/bin/zipto escalate torootuser
Privesc GTFO Bins
โก๏ธ GTFO Bins
Check zip - GTFOBins
look for
Sudo- If the binary is allowed to run as superuser by sudo, it does not drop the elevated privileges and may be used to access the file system, escalate or maintain privileged access.

Butler
O.S. - Windows 10
Credentials:
Low Privilege User -
butler:JeNkIn5@44Admin -
administrator:A%rc!BcA!
HTTP - Port 8080
Navigate to http://192.168.31.133:8080
Jenkins
Focus on Login into the Jenkins app
try default credentials (
admin:password) - not workingbrute-force with Metasploit or BurpSuite
Intercept the login request and send it to the Intruder.
Use
Cluster bombattack typeSet the payloads lists and start the attack
jenkins:jenkins is a valid login.

Disable proxy
Reverse shell
Login with
jenkins:jenkinssearch for code execution attacks: e.g.
jenkins script console exploit
From the Manage Jenkins / Script Console, use Pure Groovy/Java Reverse Shell to get a reverse shell

Privesc WinPEAS
โก๏ธ WinPEAS
Look for useful (red color) information, quick wins for privilege escalation
Unquoted service paths
Abuse misconfigured services, possible when path the the service is not quoted and there are spaces in the path

Drop an exploit binary into the
C:\Program Files (x86)\Wise\directory
Reverse shell as
system

Blackpearl
O.S. - Debian 10
Credentials:
root:tcm
HTTP - Port 80
Navigate to http://192.168.31.129
nginx default page
Proceed with some directory busting
Download the http://192.168.31.129/secret file

DNS - Port 53
โก๏ธ dnsrecon
Add
blackpearl.tcmto Kali/etc/hosts
Navigate to http://blackpearl.tcm
phpinfo webpage

Navigate to http://blackpearl.tcm/navigate
Navigate CMS v2.8

Google for
navigate cms exploit
This module exploits insufficient sanitization in the database::protect method, of Navigate CMS versions 2.8 and prior, to bypass authentication. The module then uses a path traversal vulnerability in navigate_upload.php that allows authenticated users to upload PHP files to arbitrary locations. Together these vulnerabilities allow an unauthenticated attacker to execute arbitrary PHP code remotely. This module was tested against Navigate CMS 2.8.
TTY Shell
Generate a TTY Shell

Privesc LinPEAS
Look for username and password, bottom up (red, yellow stuff)

If the binary has the SUID bit set, it does not drop the elevated privileges and may be abused to access the file system, escalate or maintain privileged access as a SUID backdoor. If it is used to run sh -p, omit the -p argument on systems like Debian (<= Stretch) that allow the default sh shell to run with SUID privileges.
This example creates a local SUID copy of the binary and runs it to maintain elevated privileges. To interact with an existing SUID binary skip the first command and run the program using its original path.

๐ For more in depth Privilege Escalation, check TCM courses here:
Last updated
Was this helpful?