Skip to content

syedhnaqvi/activedirectory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 

Repository files navigation

Active Directory Lab

Objective

The purpose of utilizing the active directiry funcitinaly and attack vectors for detectiona & analysis .

Skills Learned

  • Active directory installtion.
  • Setting up Windows & Linux VM's.
  • Setting up Splunk Server .
  • Create detection & log analysis.

Tools Used

  • Security Information and Event Management (SIEM) system for log ingestion and analysis Wazuh
  • Kali Linux for attacking windows based victim machine
  • WIndows & Linux VM's. ( Target Win machine and Linux 22.05 LTS Ubuntu server) Win 2022 server trial
  • Darw.io for digramatic flow

Steps

  • Create 4 VM's For setting up these VM's watch Video-2 In Links & references section FOr VM's configurations watch Lab-3 Video.

  • Windows 10 Machine , Kali Linux machine , Ubuntu 20.04 LTS for Splunk deployment , Active Directory

  • Setup & Configuee VM's based on network diagram based on your system vailable resources (RAM)

    Links & References

  • Lab-1 Video

  • Lab-2 Video

  • Lab-3 Video

  • Lab-4 Video

Ref 1: Network Diagram* image

Setting Up VM's </b Configuring NAT settings Go to tools > Hamburger options > Network image

Select Tab NAT network > Create We selct CIDR range as per diagram 192.168.10.0/24 Then Apply Enable DHCP remain clicked

image

Assign created NAT to all VM Resources Make Sure to Assign Created NAT to All VM's

![image](https://github.com/syedhnaqvi/activedirectory/assets/39069507/1ec1d94a-4bfe-441c-b6fb-4f02448981a0)

Login to Splunk VM Linux Ubuntu 20.04 LTS machine Run command : ip a wil show you Ip adr as 912.168.10.4/24 as per our diagram we need to install IP 192.168.10.10. So we need to run command by setting up installer.config.yaml file image Configure File : image -After DHCP- NO line hit enter to add new line and hit tab 3 times -After addresses line hit Enter then hot Tab 3 times again -After nameservers line hit Enter for new line and then hit TAB 5 times to add DNS 8.8.8.8 (Google DNS)

  • After that nameserver line hit tab 3 times
  • After routes line hot TAB 5 times
  • Enter new line press Enter then hit TAB 6 times
  • CTRL+X then then Y Press Enter key If see warnings rewlaetd to vswitch use this link to resolve issue it worked for me ! https://stackoverflow.com/questions/77352932/ovsdb-server-service-from-no-where Run ip a command if see IP: 192.168.10.10/24 then it means netplan worked and configurations all setup . image Last check ping www.google.com if you see reply it means all working else revisit your netplan config file formatting and indentation then apply netplan fiel again until you see ping response from google.com After this step completed then we are ready to Install SPLUNK on our machine .

Splunk Installtion

After you sign up on splunk.com then click on

Step -1

image

Step -2

image

Step -3

Select Linux and Deb file as we are using Debian based Ubunt Distro for linux Downlaod and Save image

Step -4

Add on Virtual guest Add on to our VM image

Step -5

Add shared folder to access Splunk download file image

image

Step -6

Run comand sudo reboot to reboot VM

Step-7

Add user to vboxsf command : sudo adduser vboxsf If see error group vboxsf not exit then we need to install additional guest utility image

Step-8

sudo reboot

Step -9

Run Add user to vboxsf command : sudo adduser vboxsf This time user will be added to group - Done

Step-10

Create shared directory command mkdir share

Step-11

Mount the share directory/folder [Change your created folder name !] Command: image If successful must see : image

If see any error then try exit command reboot then try again !

Step -11

cd to share and must see Splunk downloaded file image

Step -12

Install splunk command : image Once see Complete means all good now !

Step -13

CD to /opt/splunk la -ls see all users are splunk image

run command :image

Step-14

CD to /bin all binaries files will be displayed here ls-la

Step -15

Run splunk installer using command : image
IF see error like folder not found then reboot splunk VM again run command : sudo -u splunk bash then run command : cd bin then ./splunk start read and accept and then select y choose admin name and password image

Step-16

Use command exit to exit splunk user Then cd bin run command : image
It will enable splunk servr to start everytime VM reboots or turns on! you will see init script is configured to run at startup .

Step -17 Setup Windows Target Machine

Change hostname to Target-PC image

Restart Machine.

image Check IP run : ipconfig from CMD Assign static IP 192.168.10.100 with defauly gateway 192.168.10.1 DNS 8.8.8.8 image

Step-17

Access Splunk server started at 192.168.10.10:8000

Step-18 Install Universal Forwarder

Go to splunk.com login with your account Go to Products > Free Trials & Downloads > Universal Forwarder image

Downlaod relevant OS file after downloading double click file from downlaods folder. image

image

image

image

Install SYSMON

Search Google sysmon

image

Use sysmon olaf config search o Google sysmon olaf config https://raw.githubusercontent.com/olafhartong/sysmon-modular/master/sysmonconfig.xml

image

image

Open powershell as Amdin after copying path of sysmon downloaded folder

image

Run command ./sysmon64.exe -i sysmonconfig.xml ( if you sysmon.conf fil ein other folder then give that path I copied mine to same sysmon folder) image

If all goes smooth see this . image

Step 19 Configure Splunk Forwarder

It will instruct what needs to be forwarded to our Splunk server Need to configure file inputs.conf Path to file : C:\Program Files\SplunkUniversalForwarder\etc\system\default Note : we need to copy inputs.conf file from default folder and then paste into \system\local folder do not modify master inouts.conf file in default folder. Modify inputs.conf file and paste contents from inputs.conf file to your /system/local inputs.conf file ( you can only modilfy it when select open notepad right click then select open as admin admin privileges then go to location of file open and paste then save"

Restart Splunk Universal Forwarder Go to services run ad admin find splunk forwarder right click then restart. image

image

IF see NETSRV account we need to change it to local system account image

image

Setting Up & Final Touches to Splunk Server

Login to Splunk sever with you credentials Since our inputs.conf file contains index=endpoint we need to create same index at splunk to collect logs Go to Setting > Indexes image

Enter Name : endpoint Click SAVE image

image

Enable Splunk Server To recive data : Settings > Forwarding and receiving image

image

image

To check if we are getting Data from endpoint to splunk server. image

image

image

Addiitionally use/install splunk sysmon APP for getting more enriched data/fields. Find more Apps image

image

Setting up & Configure Linux Universal Forwarder

Follow this detailed video for installing universal forwarder for linux and forwarding logs to splunk server Installing & Setting Up Linux Universal Splunk Forwarder
Other helpful article

Ingesting Windows Firewall Logs to Splunk

Make these chnages to inputs.conf file : [WinEventLog://Microsoft-Windows-Windows Firewall With Advanced Security/Firewall]

index = firewall

disabled = false

sourcetype = [WinEventLog://Security] Make sure to restart Splunk Universal Forwarder Service

Step -20 Configure AD Server

Assign Static IP to AD server image

image

Select IPV4 settings then add these settings . image

image

image

image

Click NEXT

image

Click NEXT

Click & Select Active Directory Domain Service a.k.a ADDS image

Click Add Feature. image

Keep Clikcing Next Unitil see this Screen and click Install. image

Will take sometine to install . image

image

Click Close. image

Check Notification.

image

image

image

Put Password and all defaults and Click NEXT.

image

Keep Clicking NEXT.

image

Click INSTALL.

image

Once all completed server will automatically restart.

image

After server reboots will see domain screen .

image

Login and Add users.

image

image

Expand domain & click Builtin will show you builtin groups created automatically

image

Users option will show users .

image

image

image

image

image

image

image

Click Finish.

Step -21 From Cleint Win10 Machine join domain

Search PC then click on Properties.

image

image

image

image

Chnage domain DNS server . Change it to our Domain server address 192.168.10.7

image

To validate settings.

image

image

image

After Clint machine logs back user jsmith user we created .

image

Adding users in bulk with Powershell script .

Create bulk Users

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published