Category Archives: Windows

logo active directory

Migrating User and Password Objects between Active Directory Forests

As part of some internal lab work, I had to move the user objects with their passwords to a new forest. It was key to migrate the passwords to ensure that disruption to the users was minimized.

To migrate the users, I used the Microsoft Active Direction Migration Tool (ADMT + documentation) alongside the Password Migration Service.

migrate users between forests overview

In this blog post I am going to cover;

  • Create connectivity between both AD Forests
  • Installing the ADMT software + Password Migration Service
  • Creating a user list for migration
  • Migrating User objects + Passwords between AD Forests

Create connectivity between both AD Forests

There must be IP network connectivity between the DC’s in your Forests.

DNS setup

You need to configure conditional forwarders between your forests, so they can resolve one another.

On the source domain controller;

  1. Open up the DNS console, and right click the Conditional Forwarder folder to create a new record.
  2. Enter your target domain name and IP address/es of your domain controllers in the target domain. Select “store this conditional forwarder in active directory”, to replicate to other DCs in the source domain.

MIgrate users between a forests create conditional forwarder MIgrate users between a forests create conditional forwarder 2 Continue reading Migrating User and Password Objects between Active Directory Forests

windows server

Windows Server 2019 Evaluation – Activation fails

I had issues converting one of my evaluation installations of Windows Server 2019 to a fully licensed copy. I’d extended the evaluation a few times using “slgmr /rearm” a few times, but had finally decided I was going to move this setup into production.

The issue

When going through the settings UI to activate, I could see an error message as below, and clicking the “Change product key” option did nothing.

Windows Activation 0x87E10BC6 veducate.co .uk

Running through the CLI using “slmgr.vbs” also returned errors;

CMD: 

Cscript.exe %windir%\system32\slmgr.vbs /ipk {key}

Error: 

0xC004F069 On a computer running Microsoft Windows non-core edition, run 'slui.exe 0x2a 0xC004F069' to display the error text.

Following the rabbit down the hole;

CMD: 

slui.exe 0x2a 0xC004F069 

Error: 

Code: 0xC004F069
Description:
The Software Licensing Service reported that the product SKU is not found.
The fix

Continue reading Windows Server 2019 Evaluation – Activation fails

pentest left1

Notes from the field – Penetration tests

This blog post is by no means a comprehensive guide from an expert in the cyber security area. However my previous role meant I had the pleasure of reviewing a number of customer penetration tests and from this, pretty much all of them were all exploited in the same way. So I put together some basic information for any of my customers to review and think about before they had a penetration booked.

After all, might as well make it a challenge for the people you are hiring to hack your network 😉

Methodology

Ok, so I’m only going to cover the basics, as there are far better articles out there on this.

  • Reconnaissance
    • Information gathering before attending the targets site
      • IP addresses of websites and MX record details
      • Details of email addresses (shared mailboxes, employees direct)
      • Social networks (details shared on LinkedIn by Employees, the companies twitter posts etc)
        • Consider the below twitter post by a company, what information can you glean from seeing a picture of their racks and other equipment.
        • If we know the company name, we can enumerate the various domain names they own to public IP addresses, and just plug that into a website like http://shodan.io and maybe look for that Sonicwall and find out if its running the latest firmware.
        • Below when zooming in on the image, we can find details of an ADSL line
        • twitter post edited
      • Job websites; are they hiring, especially in IT, what skills do they want? Looking for an engineer that knows a particular accountancy package?
  • Enumeration/Identification
    • Assessment of devices found and the search for vulnerabilities
      • Tools in use such as, but not limited to; nmap, Nessus, Metasploit, unicornscan, nikto, dotdotpwn, gobuster.
  • Exploitation
    • Create a plan of action/attack based on the information gathered.
    • Perform the attack/exploitation itself to achieve the end goal, usually access to systems from zero, escalation with the end goal being access to private/sensitive/restricted systems and data.
    • Tools in use such as, but not limited to; Kali Linux (OS and contains a lot of tooling), Nmap, Metasploit, BurpSuite, SQLMap, padbuster, custom exploit scripts
Common exploits to gain access

Ok so first, lets review how multiple networks were exploited or hacked.

Below is the common summary of issues found at many sites I reviewed, and this is what I will cover in this blog post ;

  • Null session authentication on Domain Controllers
  • Devices configured to use NBT-NS / LLMNR
  • SMB Signing
  • NTLMv1 in use for network authentication
  • Domain Users have Local Admin permissions to their machines
  • Poor password policy
  • No split accounts for Domain Admins
  • Poor patching on systems
Null Session Authentication

By default null sessions (unauthenticated) are enabled on Windows 2000 & 2003 servers. Therefore anyone can use these NULL connections to enumerate potentially sensitive information from the servers, read this as information from your Active Directory.

Therefore anyone with a legacy domain which has been upgraded through the years, will find that Null Session Authentication is enabled on their environments.

Seeing it in action Continue reading Notes from the field – Penetration tests

lrn trnvideo ms azure aws

vBrownBag Session – Microsoft Azure for vSphere Admins

At VMworld 2018 I was invited to speak on the vBrownbag platform, which is a great community focused and run resource. Below is my session “Microsoft Azure for vSphere Admins”

You can find the presentation here – http://vexpert.me/azure

Regards

Dean


PowerShell logo

Powershell – Get-ADuser and output the homedrives to CSV file

I had a customer with around 27 file servers used as locations for AD home drives. We needed to do some analysis on which users used which server, as things like DFS or a strategy of where to place users were not in place. So PowerShell to the rescue.

A simple version of this script is;

get-aduser -Filter * -properties * | select DisplayName,Enabled,HomeDirectory,LastLogonDate,CanonicalName | Export-csv -path c:\scripts\userhomefolder.csv

I created this more complex script after the amount of unique objects exceeded the maximum filter within excel, so by splitting into a file per server fixed this.

First off, create an array with the multiple file servers, then used the “foreach” command to loop a PowerShell command with each file server name.

We look into all user’s in AD and output to a CSV file any users with file server X into a CSV file.

#Add the AD module into the Powershell session
Import-module ActiveDirectory

#Array containing each File Server, can be FQDN or short name
$fileservers = 'FS1','FS2','FS3'

#Loop to run a script for each object in the array against all AD users, outputs in CSV to C:\ folder
Foreach ($fileserver in $Fileservers)
{
get-aduser -Filter * -properties * | select DisplayName,Enabled,HomeDirectory,LastLogonDate,CanonicalName | Where {$_.HomeDirectory -like "*$fileserver*"} |Export-csv -path c:\scripts\userhomefolder2-$fileserver.csv
}

 

Regards

 

Dean