
















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















































































Question 1. What cmdlet is used to retrieve the current execution policy in PowerShell? A) Set-ExecutionPolicy B) Get-ExecutionPolicy C) Show-ExecutionPolicy D) Test-ExecutionPolicy Answer: B Explanation: Get-ExecutionPolicy returns the effective execution policy for the current session. Question 2. Which of the following objects represents a collection of PowerShell commands that can be piped together? A) Module B) ScriptBlock C) Pipeline D) Provider Answer: C Explanation: A pipeline connects cmdlets, functions, or scripts, allowing output of one to become input of the next. Question 3. In PowerShell, which .NET class provides access to the Windows Registry? A) System.IO.File B) Microsoft.Win32.RegistryKey C) System.Management.Automation.Registry D) System.Environment Answer: B Explanation: Microsoft.Win32.RegistryKey is the .NET class used to read, write, and delete registry keys.
Question 4. What is the default scope of a variable created with the syntax $var = 5 in a script file? A) Global B) Script C) Local D) Private Answer: C Explanation: Variables defined without a scope modifier are local to the current scope (function or script block). Question 5. Which PowerShell feature enables you to create custom objects with named properties? A) New-Object - TypeName PSObject B) Add-Member – MemberType NoteProperty C) [pscustomobject]@{…} D) All of the above Answer: D Explanation: All listed methods can be used to construct custom objects with specific properties. Question 6. What does the -Force parameter do when used with Set-ItemProperty on a registry key? A) Bypasses permission checks B) Creates the key if it does not exist C) Overwrites read‑only values D) Suppresses confirmation prompts only Answer: C
D) Get-ADUser – All Answer: A Explanation: Using -Properties Enabled returns the Enabled attribute, allowing you to see disabled accounts. Question 10. What is the purpose of the Invoke-Command cmdlet in a lateral movement scenario? A) To copy files between hosts B) To execute a script block on a remote computer C) To enumerate local groups D) To modify the remote registry Answer: B Explanation: Invoke‑Command runs PowerShell code on one or more remote machines, facilitating lateral execution. Question 11. Which Kerberos component issues the Ticket‑Granting Ticket (TGT)? A) KDC B) AS (Authentication Service) C) TGS (Ticket‑Granting Service) D) Both A and B Answer: B Explanation: The Authentication Service (AS) of the KDC validates credentials and issues the TGT. Question 12. In a Golden Ticket attack, which attribute of the forged ticket must match the domain’s KRBTGT account? A) SID B) Encryption type
C) Password hash (KRBTGT NTLM) D) Realm name Answer: C Explanation: The ticket must be encrypted using the KRBTGT account’s NTLM hash; otherwise, the KDC will reject it. Question 13. Which PowerShell module provides the Invoke-CheckLocalAdminAccess function used by BloodHound ingestors? A) PowerView B) SharpHound C) PowerSploit D) Invoke-AtomicRedTeam Answer: B Explanation: SharpHound, the BloodHound ingestor, includes Invoke-CheckLocalAdminAccess for privilege checks. Question 14. What does the -Unrestricted execution policy allow? A) Only signed scripts can run B) All scripts run, but warns on remote scripts C) No scripts can run D) Scripts run without any warnings or restrictions Answer: D Explanation: Unrestricted permits any script to run, ignoring all signature or origin checks. Question 15. Which PowerShell feature enables you to access .NET static methods directly? A) Invoke-Expression B) [type]::Method() syntax
Question 18. What is the effect of setting the HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA registry value to 0? A) Disables Windows Firewall B) Enables UAC prompts C) Disables User Account Control (UAC) D) Enables Remote Desktop Answer: C Explanation: Setting EnableLUA to 0 turns off UAC, allowing processes to run with elevated rights without prompts. Question 19. Which PowerShell cmdlet can be used to create a new AD group with a specific SIDHistory? A) New-ADGroup – SIDHistory B) New-ADObject – Type group – Add @{'sIDHistory'='…'} C) Set-ADGroup – AddSIDHistory D) New-ADGroup – AddSIDHistory Answer: B Explanation: New‑ADObject allows arbitrary attribute assignment, including sIDHistory, during creation. Question 20. In Kerberoasting, which ticket type is requested to obtain a service’s password hash? A) TGT B) TGS for a service account (SPN) C) PAC D) AS‑REQ Answer: B
Explanation: Requesting a TGS for a service principal name returns an encrypted ticket that can be cracked offline. Question 21. What does the -EncodedCommand parameter accept in PowerShell? A) Base64‑encoded UTF‑16LE string of a command line B) Hexadecimal representation of a script C) Plain‑text script block D) Encrypted binary payload Answer: A Explanation: -EncodedCommand expects a Base64 string representing a UTF‑16LE encoded command. Question 22. Which attribute of an AD user object stores the password last set timestamp? A) pwdLastSet B) lastLogonTimestamp C) whenCreated D) accountExpires Answer: A Explanation: pwdLastSet records the time the password was last changed. Question 23. What is the primary benefit of using CIM over traditional WMI cmdlets? A) CIM works only on Linux systems B) CIM provides a standardized, network‑optimized protocol (WS‑Management) C) CIM requires no administrative privileges D) CIM eliminates the need for PowerShell remoting Answer: B
D) None – Constrained Mode cannot be bypassed Answer: A Explanation: Add-Type can load arbitrary .NET code, which can break out of Constrained Language restrictions. Question 27. What does the -AsPlainText switch do when used with ConvertTo- SecureString? A) Stores the string in clear text in memory B) Encrypts the string with a reversible algorithm C) Marks the string as non‑editable D) Generates a random secure string Answer: A Explanation: -AsPlainText tells PowerShell to treat the input as plain text before converting it to a SecureString. Question 28. Which PowerShell cmdlet can be used to retrieve the SID of the current user? A) Get-CurrentUserSID B) [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value C) Get-ADUser – Identity $env:USERNAME – Properties SID D) Get-Process – Id $PID | Select‑Object – ExpandProperty SI Answer: B Explanation: The .NET WindowsIdentity class provides the SID via the User property. Question 29. In AD ACL abuse, which permission allows a user to read the msDS- AllowedToDelegateTo attribute? A) GenericRead B) WriteProperty
C) ReadProperty on msDS-AllowedToDelegateTo D) ExtendedRight “All Extended Rights” Answer: C Explanation: The ReadProperty permission on the specific attribute enables enumeration of delegation rights. Question 30. Which PowerShell function from PowerView can enumerate computers that have a specific OS version? A) Get-NetComputer – OperatingSystem “Windows Server 2016” B) Get-ADComputer – Filter {OperatingSystem - like "2016"} C) Find-ADComputer – OS “2016” D) Get-NetComputer – OS “2016” Answer: A Explanation: Get-NetComputer supports an -OperatingSystem filter to find computers by OS. Question 31. What is the effect of setting the -ExecutionPolicy Bypass flag when launching PowerShell? A) It temporarily disables all policy checks for the current session only B) It permanently changes the machine’s policy to Bypass C) It forces signed scripts to run only D) It blocks remote scripts from executing Answer: A Explanation: The Bypass flag overrides policy for that process instance without persisting changes. Question 32. Which of the following techniques can be used to extract credentials from the Windows Credential Manager via PowerShell?
Question 35. What is the primary purpose of the Invoke-Expression cmdlet in malicious PowerShell scripts? A) To download files from the internet B) To evaluate a string as PowerShell code at runtime C) To list all running processes D) To encrypt data before exfiltration Answer: B Explanation: Invoke-Expression parses and executes a string, enabling dynamic code execution. Question 36. Which PowerShell technique can be used to hide a malicious script in the Windows Event Log? A) Write-EventLog – EntryType Information – Message $script B) Out-File – FilePath $env:temp\log.evtx C) New-WinEvent – LogName Application – Message $script D) Register-ObjectEvent – SourceIdentifier “PowerShell” – Action $script Answer: A Explanation: Write-EventLog can embed arbitrary text (including scripts) into event log entries. Question 37. When using New-Object System.Net.WebClient to download a file, which method performs the download? A) DownloadFileAsync B) DownloadString C) DownloadFile D) GetFile Answer: C Explanation: DownloadFile synchronously retrieves a remote file and saves it locally.
Question 38. Which AD attribute stores the list of Service Principal Names (SPNs) for a computer account? A) servicePrincipalName B) userPrincipalName C) msDS-AllowedToDelegateTo D) objectSID Answer: A Explanation: The servicePrincipalName attribute contains SPNs used for Kerberos authentication. Question 39. What does the -NoProfile flag do when starting a new PowerShell process? A) It disables all modules B) It prevents loading of the user’s PowerShell profile scripts C) It forces the use of the default execution policy D) It runs PowerShell in safe mode Answer: B Explanation: -NoProfile skips executing profile scripts, providing a clean environment. Question 40. Which PowerShell cmdlet can be used to enumerate all Group Policy Objects (GPOs) applied to a computer? A) Get-GPO – All B) Get-GPResultantSetOfPolicy – ReportType Html C) Get-GPInheritance – Target “Computer” D) Get-GPLink – Domain “contoso.com” Answer: C Explanation: Get-GPInheritance shows the GPOs that affect a specific target (computer or user).
Explanation: SilentlyContinue suppresses error output while allowing the script to proceed. Question 44. Which PowerShell cmdlet can be used to retrieve the list of installed Windows updates? A) Get-HotFix B) Get-WindowsUpdateLog C) Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall* D) Get-WmiObject - Class Win32_QuickFixEngineering Answer: A Explanation: Get-HotFix queries the Win32_QuickFixEngineering class to list installed patches. Question 45. When performing a “Pass‑the‑Hash” attack via PowerShell, which module is commonly used? A) PowerSploit – Invoke-ReflectivePEInjection B) Invoke-Mimikatz – PassTheHash C) PowerView – Invoke-ShareFinder D) None – PowerShell cannot perform Pass‑the‑Hash Answer: B Explanation: The PowerSploit Invoke-Mimikatz function includes a PassTheHash capability. Question 46. Which attribute defines the “Domain SID” that is prefixed to all security principals in that domain? A) objectSid B) domainID C) objectGUID D) domainSID
Answer: A Explanation: objectSid contains the SID of the domain object; the domain SID is the prefix for all child objects. Question 47. What does the -Credential parameter accept in most PowerShell remoting cmdlets? A) Plain‑text username string B) PSCredential object C) SecureString only D) Hashtable of credentials Answer: B Explanation: -Credential expects a PSCredential object that stores username and a SecureString password. Question 48. Which PowerShell command can enumerate all scheduled tasks on a remote computer? A) Get-ScheduledTask – ComputerName B) schtasks.exe /Query /S Get-ScheduledTask works natively on PowerShell 5+, while schtasks.exe is a fallback. Question 49. In PowerShell, which operator is used for string concatenation? A) + B) &
D) New-LocalAccount Answer: A Explanation: New-LocalUser (available in PowerShell 5.1+) creates a local account. Question 53. What is the purpose of the -Force parameter when used with Import- Module? A) Overwrites existing functions with the same name B) Imports the module even if it is unsigned C) Loads the module into all sessions automatically D) Suppresses all warnings and errors Answer: B Explanation: -Force bypasses the signature verification requirement, allowing unsigned modules to be imported. Question 54. Which attribute of a computer object stores the list of DNS hostnames it registers? A) dNSHostName B) servicePrincipalName C) msDS-PrimaryComputer D) dNSDomain Answer: A Explanation: dNSHostName contains the primary DNS name for the computer. Question 55. In PowerShell, which cmdlet can be used to convert a SecureString back to plain text (for demonstration only)? A) ConvertFrom-SecureString – AsPlainText B) ConvertTo-SecureString – Force
StringToBSTR($sec)) D) None – PowerShell does not allow conversion back Answer: C Explanation: The .NET Marshal class can decrypt a SecureString, though it’s discouraged for production use. Question 56. Which of the following is a common indicator of PowerShell‑based fileless malware? A) Creation of .exe files in Temp folder B) Use of Invoke-Expression with Base64‑encoded payloads C) Large DLL drops on disk D) Modification of the hosts file Answer: B Explanation: Fileless attacks often execute Base64‑encoded commands via Invoke‑Expression without writing files. Question 57. What does the -Filter parameter accept in Get-ADUser? A) LDAP query string B) PowerShell script block C) Hashtable of attribute/value pairs D) Regular expression Answer: A Explanation: -Filter takes an LDAP‑style filter expression (e.g., Name - like "John*"). Question 58. Which PowerShell cmdlet can be used to enumerate all domain trusts?