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
## string reverse | |
## You can replace the IP with a variable which you get from a variable, or read from nslookup | |
$ip = "192.168.1.10" | |
$reverseIP = ($ip.split("."))[3..0] | |
$newIP = [string]::join(".",$reverseIP) | |
$newIP |
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
# Author: @mattifestation. | |
# Link:http://www.exploit-monday.com/2012/12/list-all-win32native-functions.html | |
## Comment: | |
# My experience running on V3.0 has been slow so far. I will try on other workstations and test v3.0 | |
# Matt's screenshot look impressive. | |
# To QCall or Not to QCall. | |
$PinvokeMethods = [AppDomain]::CurrentDomain.GetAssemblies().GetTypes().GetMethods('NonPublic, Public, Static, Instance') | | |
? { $_.Attributes.HasFlag([Reflection.MethodAttributes]::PinvokeImpl) } | % { $CurrentMethod = $_; $_.CustomAttributes } | | |
? { $_.AttributeType -eq [Runtime.InteropServices.DllImportAttribute] } | ? { $_.ConstructorArguments.Value -ne 'QCall' } | |
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
#Original Doug Finke's gist - https://gist.github.com/4467657 | |
#download all scripting games code by Rohn Edwards | |
$url="http://2012sg.poshcode.org/Scripts/By/862" | |
(Invoke-WebRequest $url).links | where{$_.innerHTML -eq "Download"} | ForEach { | |
$outFile = "c:\temp\$($_.outerText)" | |
#"Downloading $($_.InnerHtml) -> $($outFile)" | |
$callstring = "http://2012sg.poshcode.org"+$_.href | |
$callstring | |
Invoke-WebRequest $callstring -OutFile $outFile |
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
<# | |
web.config.xml | |
<configuration> | |
<applicationSettings> | |
<add key="machineName" value="Prod" /> | |
<add key="anotherMachineName" value="Test" /> | |
<add key="EnvTypeDefault" value="Dev" /> | |
<add key="RootURLProd" value="http://domain.com/app/" /> | |
<add key="RootURLTest" value="http://test.domain.com/app/" /> |
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 -version 3.0 | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[string] | |
$Path | |
) | |
function Sort-NodeArray { | |
param ( |
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
Configuration AspNet45WebServer { | |
WindowsFeature WebAspNet45 { | |
Name = 'Web-Asp-Net45' | |
Ensure = 'Present' | |
} | |
WindowsFeature WebWindowsAuth { | |
Name = 'Web-Windows-Auth' | |
Ensure = 'Present' |
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
winrm.cmd g winrm/config/service/auth -r:$env:computername -a:kerberos | |
winrm.cmd s winrm/config/service/auth -r:$env:computername -a:kerberos @{CredSSP="true"} |
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$ComputerName, | |
[int] | |
$Port = 443 | |
) |
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 -version 3 | |
[CmdletBinding()] | |
param () | |
$DatabasePath = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter 'DatabasePath is not null' -Property DatabasePath | | |
Select-Object -ExpandProperty DatabasePath -First 1 | |
$DatabasePath = [Environment]::ExpandEnvironmentVariables($DatabasePath) | |
$HostsFilePath = Join-Path -Path $DatabasePath -ChildPath HOSTS |
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
function ConvertFrom-IISW3CLog { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[Alias('PSPath')] | |
[string[]] | |
$Path | |
) | |
process { |
OlderNewer