After I started to use Wazuh, around June 2022, I came across many pain points. Here, I recorded and grouped some of them together. There is no specific order, neither alphabetical nor by importance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-Content -Path (Join-Path -Path $env:TEMP -ChildPath 'PsReadlineTest.txt') -Value 'Hello, world!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$environments = @([EnvironmentVariableTarget]::Machine, [EnvironmentVariableTarget]::User) | |
foreach ($e in $environments) | |
{ | |
$path = ([Environment]::GetEnvironmentVariable('Path', $e)).Split(';', [StringSplitOptions]::RemoveEmptyEntries) | |
$pathList = [System.Collections.Generic.List[string]]::new() | |
foreach ($p in $path) | |
{ | |
if(Test-Path -Path $p) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -RunAsAdministrator | |
<# | |
.Synopsis | |
Generates Sysmon Archive file quota for `File Delete` events to help managing the size. | |
.DESCRIPTION | |
Based on: https://blog.nviso.eu/2022/06/30/enforcing-a-sysmon-archive-quota/ | |
.INPUTS | |
None. Cmdlet does not accept pipe values. | |
.OUTPUTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$officeFolder = Get-ChildItem -Path 'C:\Program Files\Microsoft Office\' -Filter Office* | Select-Object -ExpandProperty Name | |
$currentPath = 'C:\Program Files\Microsoft Office\'+$officeFolder+'\OneNote' | |
$newPath = 'C:\Program Files\Microsoft Office\'+$officeFolder+'\OneNoteOLD' | |
Rename-Item $currentPath $newPath | |
$drivers = pnputil /enum-drivers | |
$drivers -split '\r?\n' | select-string -Pattern "prnms006.inf" -Context 1,0 | % { | |
$pubName = $_.Context.PreContext[0] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Personal .nanorc config | |
# Based on https://bash-prompt.net/guides/nanorc-settings/ | |
# Non-default settings | |
set atblanks # wrap line at blanks. | |
set cutfromcursor # CTRL+K cuts from cursor position to end of line. | |
#set nohelp # Disable the help information (CTRL+G to view the help screen). | |
set softwrap # Enable softwrap of lines. | |
set suspend # Enables CTRL+Z to suspend nano. | |
#set tabsize 4 # Sets tab-to-spaces size to 4. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Script for creating WMI Filters for use with Group Policy Manager. | |
.DESCRIPTION | |
The Script will create several WMI Filters for filtering based on: | |
- Processor Architecture. | |
- If the Hosts is a Virtual Machine | |
- Operating System Version. | |
- Type of Operating System. | |
- If Java is installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Time-based One-Time Password Algorithm (RFC 6238) | |
.DESCRIPTION | |
Based on the script of Jon Friesen - https://gist.github.com/jonfriesen/234c7471c3e3199f97d5 | |
.EXAMPLE | |
Get-OTP -Secret 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' # Default OTP length is 6 digits and period is 30 seconds | |
.EXAMPLE | |
totp -Secret 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' # you can use totp or otp alias | |
.EXAMPLE |
I hereby claim:
- I am zbalkan on github.
- I am zbalkan (https://keybase.io/zbalkan) on keybase.
- I have a public key ASBBqweJA8AtahYGZFH_5frCdso79FPav7P4qXIcoLlVMAo
To claim this, I am signing this object:
NewerOlder