Skip to content

Instantly share code, notes, and snippets.

$map = Invoke-MapDomainTrust
$domains = (($map | select -ExpandProperty sourcename) + ($map | select -ExpandProperty targetname)) | Select-Object -Unique
ForEach ($computer in (gc computers.txt | Sort-Object -Unique)) {
ForEach ($domain in $domains) {
$fqdn = Get-DomainComputer -SearchBase "GC://$domain" -LDAPFilter "(name=$computer)" -Properties dnshostname
if ($fqdn -ne $null) {
$fqdn
break
}
@crypticgeek
crypticgeek / pwrtest.rb
Last active January 14, 2016 23:02
Some ruby code demoing how NetIQ SSPR (v3.2 tested) hashing works
require 'digest/sha1'
plain = 'password'
salt = 'MBS9ZgZ5r7IGU8O1hfVyajXZkaoSZPbu'
answer = 'FxHUyOPwsrulLoacXlrkHN2qJ3M='
i = 100000
sha1 = Digest::SHA1.new
sha1.update(salt+plain)
(i-1).times do
@crypticgeek
crypticgeek / SSPR.ps1
Last active January 14, 2016 22:47
PS Script To Dump NetIQ SSPR attributes (ie: hashes) from active directory
function Get-pwmResponseSet
{
<#
.SYNOPSIS
This function retrieves and decodes the pwmResponseSet attribute for user(s) in Active Directory
.DESCRIPTION
NetIQ Self Service Password Reset is a user self service password application. Users configure challenege/response
questions and answers then later use them to reset their forgotton password. SSPR can be configured to store the
user's config as part of the Active Directory schema. The schema is extended and a pwmResponseSet attribute is
created and added to user accounts. The attribute is ASCII bytes encoding XML containing the challenge questions