PT0-002 · Question #261
The following PowerShell snippet was extracted from a log of an attacker machine: A penetration tester would like to identify the presence of an array. Which of the following line numbers would…
The correct answer is A. Line 8. In PowerShell, arrays are defined using the @() syntax (e.g., $array = @('item1','item2')) or by assigning a comma-separated list of values to a variable (e.g., $array = 1,2,3). Line 8 contains this array declaration syntax. The other lines (13, 19, 20) would contain other…
Question
The following PowerShell snippet was extracted from a log of an attacker machine:
A penetration tester would like to identify the presence of an array. Which of the following line numbers would define the array?
Exhibit
Options
- ALine 8
- BLine 13
- CLine 19
- DLine 20
How the community answered
(30 responses)- A93% (28)
- C3% (1)
- D3% (1)
Explanation
In PowerShell, arrays are defined using the @() syntax (e.g., $array = @('item1','item2')) or by assigning a comma-separated list of values to a variable (e.g., $array = 1,2,3). Line 8 contains this array declaration syntax. The other lines (13, 19, 20) would contain other constructs such as loops, conditionals, or variable assignments that operate on the array rather than defining it.
Topics
Community Discussion
No community discussion yet for this question.
