Additional Microsoft Defender tools and services that provide security across various platforms and environments
What the hell is going on here? someone on my local WiFi is remote executing commands in powershell, even after reinstall.
K Frost
0
Reputation points
Here are just a couple of litterally thousand of remote executed powershell scripts being run today.
Creating Scriptblock text (7 of 7):
Wrapper = $script:ObjectModelWrapper::new()
$__cmdletization_objectModelWrapper.Initialize($PSCmdlet, $script:ClassName, $script:ClassVersion, $script:ModuleVersion, $script:PrivateData)
if ($__cmdletization_objectModelWrapper -is [System.Management.Automation.IDynamicParameters])
{
([System.Management.Automation.IDynamicParameters]$__cmdletization_objectModelWrapper).GetDynamicParameters()
}
}
}
catch
{
$__cmdletization_exceptionHasBeenThrown = $true
throw
}
}
Begin {
$__cmdletization_exceptionHasBeenThrown = $false
try
{
__cmdletization_BindCommonParameters $__cmdletization_objectModelWrapper $PSBoundParameters
$__cmdletization_objectModelWrapper.BeginProcessing()
}
catch
{
$__cmdletization_exceptionHasBeenThrown = $true
throw
}
}
Process {
try
{
if (-not $__cmdletization_exceptionHasBeenThrown)
{
$__cmdletization_queryBuilder = $__cmdletization_objectModelWrapper.GetQueryBuilder()
if ($PSBoundParameters.ContainsKey('ObjectId') -and (@('ById') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${ObjectId})
$__cmdletization_queryBuilder.FilterByProperty('ObjectId', $__cmdletization_values, $true, 'Default')
}
if ($PSBoundParameters.ContainsKey('Path') -and (@('ByPaths') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${Path})
$__cmdletization_queryBuilder.FilterByProperty('Path', $__cmdletization_values, $true, 'Default')
}
if ($PSBoundParameters.ContainsKey('FileSystemLabel') -and (@('ByLabel') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${FileSystemLabel})
$__cmdletization_queryBuilder.FilterByProperty('FileSystemLabel', $__cmdletization_values, $true, 'Default')
}
if ($PSBoundParameters.ContainsKey('DriveLetter') -and (@('ByDriveLetter') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${DriveLetter})
$__cmdletization_queryBuilder.FilterByProperty('DriveLetter', $__cmdletization_values, $false, 'Default')
}
$__cmdletization_methodParameters = [System.Collections.Generic.List[Microsoft.PowerShell.Cmdletization.MethodParameter]]::new()
switch -exact ($PSCmdlet.ParameterSetName) {
{ @('ById', 'ByPaths', 'ByLabel', 'ByDriveLetter', 'InputObject (cdxml)') -contains $_ } {
[object]$__cmdletization_defaultValue = [System.Management.Automation.LanguagePrimitives]::ConvertTo('Microsoft.PowerShell', 'System.String')
[object]$__cmdletization_defaultValueIsPresent = $true
$__cmdletization_methodParameter = [Microsoft.PowerShell.Cmdletization.MethodParameter]@{Name = 'cim:operationOption:SourceCaller'; ParameterType = 'System.String'; Bindings = '0'; Value = $__cmdletization_defaultValue; IsValuePresent = $__cmdletization_defaultValueIsPresent}
$__cmdletization_methodParameters.Add($__cmdletization_methodParameter)
$__cmdletization_returnValue = $null
$__cmdletization_methodInvocationInfo = [Microsoft.PowerShell.Cmdletization.MethodInvocationInfo]::new('Flush', $__cmdletization_methodParameters, $__cmdletization_returnValue)
$__cmdletization_passThru = $PSBoundParameters.ContainsKey('PassThru') -and $PassThru
if ($PSBoundParameters.ContainsKey('InputObject')) {
foreach ($x in $InputObject) { $__cmdletization_objectModelWrapper.ProcessRecord($x, $__cmdletization_methodInvocationInfo, $__cmdletization_PassThru) }
} else {
$__cmdletization_objectModelWrapper.ProcessRecord($__cmdletization_queryBuilder, $__cmdletization_methodInvocationInfo, $__cmdletization_PassThru)
}
}
}
}
}
catch
{
$__cmdletization_exceptionHasBeenThrown = $true
throw
}
}
End {
try
{
if (-not $__cmdletization_exceptionHasBeenThrown)
{
$__cmdletization_objectModelWrapper.EndProcessing()
}
}
catch
{
throw
}
}
# .EXTERNALHELP Volume.cdxml-Help.xml
}
Microsoft.PowerShell.Core\Export-ModuleMember -Function 'Write-VolumeCache' -Alias '*'
function Get-DedupProperties
{
[CmdletBinding(DefaultParameterSetName='ByDriveLetter', PositionalBinding=$false)]
[OutputType([Microsoft.Management.Infrastructure.CimInstance])]
param(
[Parameter(ParameterSetName='ById', Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias('Id')]
[ValidateNotNull()]
[string[]]
${ObjectId},
[Parameter(ParameterSetName='ByPaths', Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[ValidateNotNull()]
[string[]]
${Path},
[Parameter(ParameterSetName='ByLabel', Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias('FriendlyName')]
[ValidateNotNull()]
[string[]]
${FileSystemLabel},
[Parameter(ParameterSetName='ByDriveLetter', Mandatory=$true, Position=0, ValueFromPipelineByPropertyName=$true)]
[ValidateNotNull()]
[char[]]
${DriveLetter},
[Parameter(ParameterSetName='InputObject (cdxml)', Mandatory=$true, ValueFromPipeline=$true)]
[PSTypeName('Microsoft.Management.Infrastructure.CimInstance#MSFT_Volume')]
[ValidateNotNull()]
[ciminstance[]]
${InputObject},
[Parameter(ParameterSetName='ById')]
[Parameter(ParameterSetName='ByPaths')]
[Parameter(ParameterSetName='ByLabel')]
[Parameter(ParameterSetName='ByDriveLetter')]
[Parameter(ParameterSetName='InputObject (cdxml)')]
[Alias('Session')]
[ValidateNotNullOrEmpty()]
[CimSession[]]
${CimSession},
[Parameter(ParameterSetName='ById')]
[Parameter(ParameterSetName='ByPaths')]
[Parameter(ParameterSetName='ByLabel')]
[Parameter(ParameterSetName='ByDriveLetter')]
[Parameter(ParameterSetName='InputObject (cdxml)')]
[int]
${ThrottleLimit},
[Parameter(ParameterSetName='ById')]
[Parameter(ParameterSetName='ByPaths')]
[Parameter(ParameterSetName='ByLabel')]
[Parameter(ParameterSetName='ByDriveLetter')]
[Parameter(ParameterSetName='InputObject (cdxml)')]
[switch]
${AsJob})
DynamicParam {
try
{
if (-not $__cmdletization_exceptionHasBeenThrown)
{
$__cmdletization_objectModelWrapper = $script:ObjectModelWrapper::new()
$__cmdletization_objectModelWrapper.Initialize($PSCmdlet, $script:ClassName, $script:ClassVersion, $script:ModuleVersion, $script:PrivateData)
if ($__cmdletization_objectModelWrapper -is [System.Management.Automation.IDynamicParameters])
{
([System.Management.Automation.IDynamicParameters]$__cmdletization_objectModelWrapper).GetDynamicParameters()
}
}
}
catch
{
$__cmdletization_exceptionHasBeenThrown = $true
throw
}
}
Begin {
$__cmdletization_exceptionHasBeenThrown = $false
try
{
__cmdletization_BindCommonParameters $__cmdletization_objectModelWrapper $PSBoundParameters
$__cmdletization_objectModelWrapper.BeginProcessing()
}
catch
{
$__cmdletization_exceptionHasBeenThrown = $true
throw
}
}
Process {
try
{
if (-not $__cmdletization_exceptionHasBeenThrown)
{
$__cmdletization_queryBuilder = $__cmdletization_objectModelWrapper.GetQueryBuilder()
if ($PSBoundParameters.ContainsKey('ObjectId') -and (@('ById') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${ObjectId})
$__cmdletization_queryBuilder.FilterByProperty('ObjectId', $__cmdletization_values, $true, 'Default')
}
if ($PSBoundParameters.ContainsKey('Path') -and (@('ByPaths') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${Path})
$__cmdletization_queryBuilder.FilterByProperty('Path', $__cmdletization_values, $true, 'Default')
}
if ($PSBoundParameters.ContainsKey('FileSystemLabel') -and (@('ByLabel') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${FileSystemLabel})
$__cmdletization_queryBuilder.FilterByProperty('FileSystemLabel', $__cmdletization_values, $true, 'Default')
}
if ($PSBoundParameters.ContainsKey('DriveLetter') -and (@('ByDriveLetter') -contains $PSCmdlet.ParameterSetName )) {
$__cmdletization_values = @(${DriveLetter})
$__cmdletization_queryBuilder.FilterByProperty('DriveLetter', $__cmdletization_values, $false, 'Default')
}
$__cmdletization_methodParameters = [System.Collections.Generic.List[Microsoft.PowerShell.Cmdletization.MethodParameter]]::new()
switch -exact ($PSCmdlet.ParameterSetName) {
{ @('ById', 'ByPaths', 'ByLabel', 'ByDriveLetter', 'InputObject (cdxml)') -contains $_ } {
[object]$__cmdletization_defaultValue = $null
[object]$__cmdletization_defaultValueIsPresent = $false
$__cmdletization_methodParameter = [Microsoft.PowerShell.Cmdletization.MethodParameter]@{Name = 'DedupProperties'; ParameterType = 'Microsoft.Management.Infrastructure.CimInstance'; Bindings = 'Out'; Value = $__cmdletization_defaultValue; IsValuePresent = $__cmdletization_defaultValueIsPresent}
$__cmdletization_methodParameters.Add($__cmdletization_methodParameter)
[object]$__cmdletization_defaultValue = [System.Management.Automation.LanguagePrimitives]::ConvertTo('Microsoft.PowerShell', 'System.String')
[object]$__cmdletization_defaultValueIsPresent = $true
$__cmdletization_methodParameter = [Microsoft.PowerShell.Cmdletization.MethodParameter]@{Name = 'cim:operationOption:SourceCaller'; ParameterType = 'System.String'; Bindings = '0'; Value = $__cmdletization_defaultValue; IsValuePresent = $__cmdletization_defaultValueIsPresent}
$__cmdletization_methodParameters.Add($__cmdletization_methodParameter)
$__cmdletization_returnValue = $null
$__cmdletization_methodInvocationInfo = [Microsoft.PowerShell.Cmdletization.MethodInvocationInfo]::new('GetDedupProperties', $__cmdletization_methodParameters, $__cmdletization_returnValue)
$__cmdletization_passThru = $false
if ($PSBoundParameters.ContainsKey('InputObject')) {
foreach ($x in $InputObject) { $__cmdletization_objectModelWrapper.ProcessRecord($x, $__cmdletization_methodInvocationInfo, $__cmdletization_PassThru) }
} else {
$__cmdletization_objectModelWrapper.ProcessRecord($__cmdletization_queryBuilder, $__cmdletization_methodInvocationInfo, $__cmdletization_PassThru)
}
}
}
}
}
catch
{
$__cmdletization_exceptionHasBeenThrown = $true
throw
}
}
End {
try
{
if (-not $__cmdletization_exceptionHasBeenThrown)
{
$__cmdletization_objectModelWrapper.EndProcessing()
}
}
catch
{
throw
}
}
# .EXTERNALHELP Volume.cdxml-Help.xml
}
Microsoft.PowerShell.Core\Export-ModuleMember -Function 'Get-DedupProperties' -Alias '*'
ScriptBlock ID: 24743b75-91c1-4a0d-b4ef-839815a2a3c7
Path:
Microsoft Security | Microsoft Defender | Other
Microsoft Security | Microsoft Defender | Other
Sign in to answer