Skip to main content

Get-ADInfo Powershell Module

With the competition season mostly over, I've been able to spend some time catching up on write-ups, classwork, and projects. I'm also able to start releasing the materials I created for my team this year. Starting with Get-ADInfo, the first (sort of) Powershell module I've created. You can find it here https://www.powershellgallery.com/packages/Get-ADInfo/1.0.0. Additionally, you can also find it on my GitHub.

Module Information

Get-ADInfo is a module that was created to help facilitate Active Directory object enumeration. I spent a lot of time last year developing security tools for Windows servers, but I hadn't really done anything neat with basic enumeration stuff. So I wanted to create some enumeration tools for our Windows people this year. Get-ADInfo was the first tool I started working on, and probably the one that turned out the best, as I was quickly overwhelmed with relearning bash and some of the more advanced Linux skills I had forgotten after focusing on Windows for so long. Essentially, Get-ADInfo works by pulling critical information out of certain AD object cmdlets. In some cases, I had to make some custom objects, but in general, the cmdlets provided in the module are re-skins of the AD object cmdlets ordered in a slightly easier-to-understand way.

By default, all the commands will enumerate all objects. However, for each cmdlet, the object name can be specified with the -Name property. For example, Get-ADGroupInfo -Name Administrators will list all information about the Administrators group. I designed it to run through all objects if no property was given to speed up the enumeration process, as this module was originally designed for a competition environment. 

Function Get-UserInfo

The Get-UserInfo function provides critical information about the specified user (or all users) including membership status. For example, if user 'Test' is a member of the group 'Test-Group', this cmdlet will pull that information and display the membership. Additionally, it grabs logon information, display info, and other useful details. I personally find it more useful than Get-ADUser in terms of getting an overview of users.

Example Output of Get-UserInfo

Function Get-OUInfo

Unlike Get-UserInfo, Get-OUInfo has quite a bit of custom properties. When I was first writing this module, I had never done any kind of custom object creation or module creation, and this was the first cmdlet I started working on. I certainly learned a good bit while making this one. 

Get-OUInfo lists information about the specified (or all) organizational units. This information includes the linked users, groups, and computers. Aside from the linked objects, it also displays management and display information. 

Example Output of Get-OUInfo

Function Get-GroupInfo

This is the simplest of the cmdlets in this module. For every specified (or all) group, the group's members and the owners are listed alongside creation and display information. 

Example Output of Get-GroupInfo

Function Get-ADComputerInfo

This is the most complex cmdlet in the module. It provides a wealth of information on each connected computer in the domain. For example, it shows networking information such as DNS hostname, IPv4, and v6 address. It also displays the logon information like last logon date, password change dates, and expiration dates. Of course, it also gives the AD management information as well, like created dates, enabled status, and distinguished names. It will also show linked members and owners. 

Example Output of Get-ADComputerInfo



Comments

Popular posts from this blog

Using PGPy to encrypt and decrypt files and messages

 PGPy is a library for python that enables the creation, storage, and encryption/decryption of PGP keys and files in python. Recently, in a small project to reacquaint myself with python, I used PGPy for key generation and encryption and decryption. That project can be found in my github at  https://github.com/lpowell . The goal of the project was to use command-line switches to control the program, and to provide basic encryption and decryption capabilities, along with rot13 and base64 encoding.  First, to load in a key use key, _ = pgpy.PGPKey.from_file(keyfilename) . This loads the key from either a binary or ASCII armored file. You can swap out .from_file for .from_blob , if you plan on using a key stored in a string or bytes object rather than a file. In my example code, I pull the key from a file, as I found it to be the simpler method.  Next, you'll need to open a file or create a string or bytes object that contains the message you wish to encrypt. We'll call this file

Using the Ubertooth One to sniff and intercept Bluetooth packets

While researching for my individual video project I came across this tool which allows for the sniffing and interception of bluetooth packets. This article covers some of the basic functionality of an Ubertooth One.  It's really quite interesting to see all the possibilities with devices like these. The tech behind them is very interesting as well. Hopefully, I'll be able to integrate some of this technology into my project video and include a demo of some of the interesting things it can do.

Installing the Ubertooth on the Mac mini M1

 For my video project, one of the demonstrations included using an Ubertooth One to scan for Bluetooth and BLE packets. This blog post will cover the installation of the Ubertooth One on the Mac mini M1. The official install guide for Mac devices didn't work very well for me, and I had to install some extra tools in order to get it to work. The examples assume you are using Python 3, and have homebrew installed.  To begin, follow the instructions found here:  https://github.com/greatscottgadgets/ubertooth/wiki/Build-Guide . Additionally, you may find that you need to install pytq5, numpy, and qtpy. To do this, simply run Python3 pip install pyqt5, numpy, qtpy. This will install the required libraries needed to run the Ubertooth tools. There are multiple ways to install pip on an OS X device, but I suggest using homebrew to install python3, which should install pip as well. Next, you will need to update the firmware of the device. When downloading the tools, a firmware directory sh