This file contains hidden or 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
| function Add-LazyProperty { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
| [PSObject] | |
| $InputObject, | |
| [Parameter(Mandatory=$true, Position=1)] | |
| [string] | |
| $Name, |
This file contains hidden or 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
| (gwmi win32_product -filter 'Name="name of application in Add/Remove Programs"').Uninstall() |
This file contains hidden or 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
| ([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword') |
This file contains hidden or 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
| Function Get-IISLogFileDirectory { | |
| [System.Collections.ArrayList]$x = @() | |
| Import-Module "WebAdministration" | |
| foreach($site in (dir IIS:\Sites\*)) { | |
| $x += [System.Environment]::ExpandEnvironmentVariables((Get-ItemProperty IIS:\Sites\$($site.Name) -name logFile.directory).value) | |
| } | |
| $x | select -Unique | |
| } |
This file contains hidden or 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 -Version 3 | |
| #Usage: | |
| #Invoke-command -computername $server -scriptblock {FunctionName -param1 -param2} | |
| # Author: Matt Graeber | |
| # @mattifestation | |
| # www.exploit-monday.com | |
| function Invoke-Command | |
| { | |
| [CmdletBinding(DefaultParameterSetName='InProcess', HelpUri='http://go.microsoft.com/fwlink/?LinkID=135225', RemotingCapability='OwnedByCommand')] |
This file contains hidden or 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
| #Get MOF File Method | |
| $mof = @' | |
| #PRAGMA AUTORECOVER | |
| [dynamic, provider("RegProv"), | |
| ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")] | |
| class SG_InstalledProducts { | |
| [key] string KeyName; | |
| [read, propertycontext("DisplayName")] string DisplayName; | |
| [read, propertycontext("DisplayVersion")] string DisplayVersion; |
This file contains hidden or 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
| #1 YMMV: | |
| #2 Depends on the number of modules loaded in your session. | |
| $allfunc = Get-Command | where {$_.CommandType -EQ "Function" -or $_.CommandType -eq "CmdLet"} | select -ExpandProperty Name | |
| foreach ($cmd in $allfunc) { | |
| (Get-Command $cmd).Definition | Out-File -Encoding ascii C:\scripts\$cmd-definition.txt | |
| Get-help $cmd -Full| Out-File -Encoding ascii C:\scripts\$cmd-help.txt | |
| } | |
| Get-Content C:\scripts\*.txt | where {$_ -like "*Steppable*"} | select * |
This file contains hidden or 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
| Source | Localport | Dest | |
|---|---|---|---|
| xenapp05 | 56410 | dc1 | |
| xenapp05 | 65387 | dc1 | |
| xenapp05 | 65388 | dc1 | |
| xenapp05 | 65389 | dc1 | |
| xenapp05 | 65390 | dc1 | |
| xenapp05 | 65397 | dc1 | |
| xenapp09 | 57776 | dc1 | |
| xenapp11 | 63367 | dc1 | |
| xenapp11 | 63369 | dc1 |
This file contains hidden or 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
| Lee Holmes http://www.leeholmes.com/blog/ | |
| Oisin G http://www.nivot.org/ | |
| Jaykul http://huddledmasses.org/ | |
| Vadim Podams http://sysadmins.lv/ | |
| Roman Kuzmin http://nightroman.wordpress.com/ | |
| Matt Graeber http://www.exploit-monday.com/ | |
| Joe Bialek http://clymb3r.wordpress.com/ | |
| Glenn Sizemore https://twitter.com/glnsize | |
| Bartek Bielawski http://becomelotr.wordpress.com/ | |
| Jim Christopher http://www.beefycode.com/default.aspx |
This file contains hidden or 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
| Function Get-RipeMDHash { | |
| [cmdletbinding()] | |
| Param( | |
| [Parameter(Mandatory = $True)] | |
| [ValidateScript({Test-Path $_ })] | |
| $file | |
| ) | |
| Process { | |
| $reader = [System.IO.File]::OpenText($file) | |
| $RIPEMD160 = [System.Security.Cryptography.RIPEMD160]::Create() |