Skip to content

Instantly share code, notes, and snippets.

View rjt's full-sized avatar

Robert Townley rjt

View GitHub Profile
@iloveitaly
iloveitaly / copy-default-directory.bash
Created February 18, 2012 20:44
Some tools for managing polycom phones + asterisk systems
# this assumes you have a default directory defined
find /tftpboot/logs/ | ack 'logs/([^-]+)' --output '$1' | sed '/^$/d' | while read mac
do
cp -f "000000000000-directory.xml" "$mac-directory.xml"
done
@jhannah
jhannah / gist:6393686
Created August 30, 2013 19:55
git rebase after changing files which the base branch has MOVED
https://twitter.com/deafferret/status/373530616655917057
Mind. Blown.
Did you know when rebasing in git it even correctly patches files that were MOVED in the base branch? I...
Wow.
<3 git
Here, let me show you:
Dell Scrutinizer 11.01 several vulnerabilities
http://www.mysonicwall.com has a trial available.
Dell Sonicwall Scrutinizer suffers from several SQL injections, many of which can end up with
remote code execution. An attacker needs to be authenticated, but not as an administrator.
However, that wouldn’t stop anyone since there is also a privilege escalation vulnerability in that
any authenticated user can change any other user’s password, including the admin. One SQL
injection, which a Metasploit module was provided for, requires this privilege escalation to reach
since it exists in the new user mechanism only available to admins.
@rjt
rjt / Strings
Last active August 29, 2015 14:04
#Unexpected token '3c-0c' in expression or statement.
#You must provide a value expression following the '-' operator.
[string]$Mac3='00-16-d4-08-3c-0c';
$Mac3.GetType() #returns string.
$dhcpEntry.Item("ClientId")
#Get-DhcpS does not find the entry some of the time. If i put in the number directly, it will work.
Get-DhcpServerv4Reservation -ClientId $Mac3 -ScodeID 10.0.100.0
@lazywinadmin
lazywinadmin / RecycleBin.ps1
Created April 20, 2015 14:37
RecycleBin PowerShell script
<#
This script creates object which correctly works with ntfs streams and reparse points
Usage samples:
'.\*.bak' | recycle -WipeOut -> multiplies objects by zero
recycle -Path '.\*.ini' -> sends objects to Recycle Bin
$RecycleBin.Measure() -> returns true size of all items in Recycle Bin
$RecycleBin.Clear() -> this is obvious
$RecycleBin.List() -> returns friendly items list
@Jaykul
Jaykul / Get-ParameterValues.ps1
Created April 27, 2016 06:41
Rather better than `$PSBoundParameters`
function Get-ParameterValues {
<#
.Synopsis
Get the actual values of parameters which have manually set (non-null) default values or values passed in the call
.Description
Unlike $PSBoundParameters, the hashtable returned from Get-ParameterValues includes non-empty default parameter values.
NOTE: Default values that are the same as the implied values are ignored (e.g.: empty strings, zero numbers, nulls).
.Example
function Test-Parameters {
[CmdletBinding()]
<#
.Synopsis
Scans a host or network for the MS17-010 vulnerability and output results as a
table that you can pipe to other PowerShell functions such as Invoke-Command or
Export-CSV.
.DESCRIPTION
This script will use a custom NMap NSE script to scan a destination host on
port 445 for the MS17-010 vulnerability. If the host is not online or is blocking
@rjt
rjt / RecycleBin.ps1
Created October 23, 2017 02:21 — forked from lazywinadmin/RecycleBin.ps1
RecycleBin PowerShell script
<#
This script creates object which correctly works with ntfs streams and reparse points
Usage samples:
'.\*.bak' | recycle -WipeOut -> multiplies objects by zero
recycle -Path '.\*.ini' -> sends objects to Recycle Bin
$RecycleBin.Measure() -> returns true size of all items in Recycle Bin
$RecycleBin.Clear() -> this is obvious
$RecycleBin.List() -> returns friendly items list
@elovelan
elovelan / Get-ParameterValues.ps1
Created October 10, 2018 19:05 — forked from Jaykul/Get-ParameterValues.ps1
Rather better than `$PSBoundParameters`
function Get-ParameterValues {
<#
.Synopsis
Get the actual values of parameters which have manually set (non-null) default values or values passed in the call
.Description
Unlike $PSBoundParameters, the hashtable returned from Get-ParameterValues includes non-empty default parameter values.
NOTE: Default values that are the same as the implied values are ignored (e.g.: empty strings, zero numbers, nulls).
.Link
https://gist.github.com/Jaykul/72f30dce2cca55e8cd73e97670db0b09/
.Link
@desbest
desbest / Reset-WindowsUpdate.ps1
Last active February 18, 2024 17:03
Reset Windows Update Client Settings Script
<#
.SYNOPSIS
Reset-WindowsUpdate.ps1 - Resets the Windows Update components
.DESCRIPTION
This script will reset all of the Windows Updates components to DEFAULT SETTINGS.
.OUTPUTS
Results are printed to the console. Future releases will support outputting to a log file.