Friday, August 10, 2012

Modifying Custom AD Attributes w/Powershell

Recently I needed to create a custom user attribute within our Active Directory environment.  Rather than manually edit each user with the new value, I thought of using Powershell to automate the process.  I began testing the process using set-aduser.  Generally you'd find the associated property and add the value:

set-aduser username -EmailAddress username@domain.com

The custom attribute I created was EmployeeDOB so I ran the same command but the property was not recognized.  After some research and help from the Technet forums, I was introduced to the following options:

set-aduser username -Add @{EmployeeDOB='5-1-1978'}

set-aduser username -Replace @{EmployeeDOB='4-1-1980'}

set-aduser username -Remove @{EmployeeDOB='4-1-1980'}

With this new knowledge, I can now hopefully save some time by not having to manually edit these values within ADUC!!

Wednesday, August 1, 2012

Brute Force Cracking of SSH

You can use Hydra to attempt a brute force attack of SSH.  You'll need a known user account and comprehensive password file.  Root is generally a known user account, but some system admins choose to disable the account from logging in via SSH.  Once you have the above prerequisites you can run the following command:

hydra -l <user> -P wordlist.txt 192.168.0.5 ssh

Happy Hunting!

Disclaimer - Only test this with systems you own and have permission to test!