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 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.

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 cal...

CCDC 2022-23 Log #1

We've recently had our first CCDC meeting for the year. A small informational for interested students. It went well, we seem to have some good candidates already popping up. It's still too early to tell if they'll stick it out, but I'm hopeful we'll have a good team this year.  I'm planning on doing semi-regular updates on our team this year, mainly covering my perspective as co-captain and as a mentor. I'm also planning on dropping some of the tools and labs I'm creating for our team and my masters capstone. The first set of labs covers active directory configuration and object management. After finishing those, I'll work on labs for Linux incident response and systems hardening. I'm lucky to be in a position where my university has allowed me to use these labs to meet the capstone requirement, so long as I allow them to use the labs in undergrad courses. I'll also be releasing and updating my CCDC toolset for Windows servers and doing some ...