16 Win Information Goldmine Flashcards

1
Q

How get history in powershell ?

A

Get-History

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How save history of powershell in a file ?

A

(Get-PSReadlineOption).HistorySavePath

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How create PSCredential object (password: qwertqwertqwert123!! ) and connect on computer CLIENTWK220 ?

A

$password = ConvertTo-SecureString “qwertqwertqwert123!!” -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential(“daveadmin”, $password)
Enter-PSSession -ComputerName CLIENTWK220 -Credential $cred

whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to connect via WinRM on Kali (ip: XXXX, user:daveadmin, password: qwertqwertqwert123!! ) ?

A

evil-winrm -i 192.168.50.220 -u daveadmin -p “qwertqwertqwert123!!”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Use Event viewer to get action of a script

A

Start the app “Event Viewer”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why use evil-winrm instead of reverse shell via PS ?

A

Creating a PowerShell remoting session via WinRM in a bind shell can cause unexpected behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How use evil-winrm to connect as user “daveadmin” with pass “pass!!” on target <IP></IP>

A

kali@kali:~$ evil-winrm -i 192.168.50.220 -u daveadmin -p “pass!!”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How prevent PS to log history (alternative ? (1))

A

Set-PSReadLineOption -HistorySaveStyle SaveNothing
Alternative: delete manually the history file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In which env. var is stored the history file path of PS ?

A

$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly