-
Enumeration
-
System
-
systeminfo
- Gets all possible version about system
- Hostname
-
wmic qfe
- windows management instrumentation:- Shows hotfixes
- wmic logicaldisk
-
User
-
whoami
- whoami /priv
- Whoami /groups
-
netuser username
- shows all user and their related info
-
net localgroup
- shows all groups present on a system
-
Network
-
route print
- shows Interface list, IPV4 route table and tons of other routing information
-
netstat -ino
- all open ports
-
Passwords
-
to find passwords everywhere
-
find /si password *.txt
- Search for phrase password in all the files ending with .txt
- searches in the directory you are in right now
-
AV FW detection
-
sc query windefend
- service control query windefend
-
sc query type= service
- tells about all the services running on a device
- netsh advfirewall firewall dump
- netsh firewall show state
- netsh firewall show config
-
Auto enumeration
-
Executables
-
Winpeas
- requires .net 4+ on target system
- seatbelt
- watson
- sharpup
-
If executable are not allowed then run powershell commands
- If none of them is working, run recon scan from meterpreter. post/multi/recon/local_exploit_suggester
-
powershell
- sherlock
- PowerUp.ps1
- jaws-enum
-
Msfconsole
-
run post/multi/recon/local_exploit_suggester
- Suggests all available xploits
- Manual
-
Passwords
-
Reg
-
Reg query HKLM /f password /t REG_SZ /s
- Local Machine
-
Reg query HKCU /f password /t REG_SZ /s
- Current USer
- runas /savecred /user:admin c:/pathtoreverseshell
-
Service Exploits
-
Enum
- sc.exe qc/query/config
- net /start/stop
- Winpeas
-
Insecure Service permissions
-
Signs:- CHANGE_CONFIG,ALL_ACCESS
- If logged in USER has permission to change config of a service running as root
- Should be able to start and stop the service
-
These things are shown by winpeas
- To check manually:- .\accesschk.exe /accepteula -uwcqv user servicename
-
To query Service configuration to check what its really doing
- sc qc servicename
-
To check Current state ,
- sc query servicename
-
If user has ability to modify binary path then he can change it to malicious exe file
- sc config servicename binpath=""
-
Unquoted Service Paths
- Ususally Shown by Winpeas
-
First Check what actions are allowed. If yes
- .\accesschk.exe /accepteula -ucqv user servicename
-
Now check for write permissions in each directory in existing binary
- .\accesschk.exe /accepteula -uwdq servicename
- If you find write permission then make a exe file in that directory with its name as first letter immediately after / of next directory
-
Weak Registry Permissions
- Winpeas Shows registry is modifiable
-
To verify , ancd check if we are able to edit
- cmd:- .\accesschk.exe /accepteula -uvwqk HKLM\registrypath
- PS:- Get-Acl HKLM/path | Format-List
-
To check current value of registry
- reg query HKLM/path
-
Now after verifying that it runs as system, Change ImagePath value to our exe path
- reg add HKLM\originalpath /v ImagePath /t REG_EXPAND_SZ /d maliciouspath /f
-
Insecure Service Executables
- IF YOU ARE DOING THIS ON REAL SYSTEM, CREATE BACKUP OF ORIGINAL EXE BEFORE EXPLOITING
- Check for service exe writable for everyone. Shown by winpeas
-
Verify withaccess check to see if we can start stop
- .\accesschk.exe /accepteula -quvw servicename
- If yes then copy malicious exe
- copy source destination
- DLL
-
Kernel Exploits
- Github/secWiki/Windows Kernel Exploits
- All depends on enumeration
- Identify kernel version and search for relevant exploits
-
-:Tools
-
Windows Exploit Suggestor
- Takes Sysinfo output file as input
- Watson
-
Scheduled Tasks
- cmd:- schtasks /query /fo LIST /v
- ps:- Get-ScheduledTask | where {$_.TaskPath -notlike "Microsoft* | ft Taskname,TaskPath,State"}
- Find scripts running every minuite. if found add shell command to it to get a shelll as Nt authority
- To check Permission:- .\accesschk.exe /accepteula -uqv user filename/scri[pt name
- Give it a path to malicious executable
-
Insecure GUI APPS
- Since parent process is run as admin, Child process will also run as admin
- To see privilages:-tasklist /v | findstr processname
-
StartUp Apps
-
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp :- All programs starting at boot are placd here
- If reverse shell is placed in this directory, then it will get executed once system starts
-
.\accesschk.exe /accepteula -d path
- To check access privilages
- Builtin Users Groups has write access to this directory by default
- USe a VB script available on net to make a shortcut in startup directory
-
Installed Apps
- Exploits can be foun specific to the apps running on the system. Simply search for them on Exploit-db
-
Hot Potato
- Works on win 7 8 and early win10
- It is a spoofing attack
- It involves authenticating Windows user to a fake HTTP server using NTLM
- Ntlm credentials are then used to get command execution using SMB
- Requires to have a shell as normal user, then privilages are escalated using potato.exe by giving arguments as IP and Reverse shell.exe generated with MSF Venom
-
Juicy Potato
- Takes advantage of service Accounts
- Intercepts System Tickets and uses it to impersonate System User
- Check if SetImpersonation Privilage is enabled or SeAssignPrimaryToken is enabled. IF YES THEN JUICY POTATO
- Hacktricks has awesome info about its usage
-
Port Forwarding
- Plink
-
Priv Esc Strategy
- Check Your user and Group you are into using netuser command
- Subtopic 2
- Download Tiberus Github Repo
-
Enumeration Scripts
-
Windows Exploit Suggestor
- ./wes --database --systeminfo
-
Winpeas
- x86,x64,bat file
-
By Kaustubh chude
- https://www.linkedin.com/in/kaustubh-chude-3124801a7