Yaksas CSC

Your Guardian in the Cyber World

  • Yaksas CSC Home
  • Home
  • About Us
    • Overview
    • Why Yakṣas?
  • Got a Question?
    • Cyber Security Basics
    • Cyber Security Education & Career
    • How to stay safe?
  • Get Invloved
    • Write for Us
    • YCSC QnA Dialogue
    • Translate Articles
  • Contact Yakṣas
  • Press Release
    • NCSAM 2015 Champion
    • STOP. THINK. CONNECT. Partner
AD Exploitation using ADSI – Part 1 (Introduction)

Uday Mittal July 8, 2020 Leave a Comment

AD Exploitation using ADSI – Part 1 (Introduction)

Active Directory Service Interfaces (ADSI) – A set of Component Object Model (COM) interfaces for managing Active Directory services. It can be utilized in several scripting and programming languages.

  • Enables reading, adding and managing Active Directory Objects
  • Part of .NET framework:
    • System.DirectoryServices.DirectoryEntry (ADSI)
    • System.DirectoryServices.DirectorySearcher (ADSISearcher)
  • Can be accessed via PowerShell by creating objects for above classes
  • Example:
    • $domain = New-Object –TypeName System.DirectoryServices.DirectoryEntry

OR

    • $domain2 = [System.DirectoryServices.DirectoryEntry]”LDAP://dc=ycsccorp,dc=local”

OR

    • $domain3 = [ADSI]”LDAP://dc=ycsccorp,dc=local”

Using ADSI

  • Creating OU
    • $domainOU = $domain1.Create(“organizationalUnit”,”ou=YCSCTest”)
    • $domainOU.SetInfo()
  • Creating User
    • $domainUser = $domain1.Create(“user”,”cn=YCSCUser”)
    • $domainOU.SetInfo()

Pros and Cons

  • Pros
    • It is available on most Windows machines by default
    • Does not require AD-Module, RSAT or any other special libraries
    • Not easily detected
    • Can be used to create custom tools leveraging ADSI and ADSISearcher
  • Cons
    • Takes some time to learn
    • Lack of documentation

To learn about the Active Directory architecture used in this lab click here.

Watch the video

 

Related Posts

  • SPN Scanning using ADSI (Part 3)SPN Scanning using ADSI (Part 3)
  • ADSISearcher (Part 2)ADSISearcher (Part 2)
mm
Uday Mittal

Uday Mittal is a cybersecurity professional with rich working experience working with various industries including telecom, publishing, consulting and finance. He holds internationally recognized certifications such as CRTP, OSCE, OSCP, CISSP, CISA, CISM, CRISC among others. He speaks on cybersecurity awareness, offensive security research etc. and has authored various articles on topics related to cyber security and software development for a leading magazine on open source software.

Filed Under: ADSI Tagged With: active direcgtory, adsi, adsisearcher, enumeration, powershell

Optin Form

Search

Follow us on Twitter

My Tweets

Categories

Tags

Active directory adsecurity adsi adsisearcher adversary emulation Android attack active directory awareness blue whale challenge Certification CISSP Cloud security command and control crte crtp cyber-warfare Cyber Security Cybersecurity books Cybersecurity Cannon domain enumeration Edward Snowden forest enumeration hacker Information Security ISACA Kali Linux Mass Surveillance Mobile Security Narendra Modi NSA offensive security Online Safety Password Penetration Testing pentest poshc2 powersploit Powerview privacy red team red teaming Risk Management Social Media user enumeration Wifi

Top Posts

  • 7 Ways to Cover Your Device's Camera
    7 Ways to Cover Your Device's Camera
  • Mona.py for exploit devs: 6 must know commands
    Mona.py for exploit devs: 6 must know commands
  • Social-Engineer Toolkit: An Introduction
    Social-Engineer Toolkit: An Introduction
  • CISA: Everything You Need to Know
    CISA: Everything You Need to Know
  • Active Directory User Enumeration using PowerView
    Active Directory User Enumeration using PowerView
  • Red Team Operations Attack Lifecycle
    Red Team Operations Attack Lifecycle

© Copyright 2020 ElliteDevs · All Rights Reserved · Powered by WordPress