🪬
Gzzcoo Pentest Notes
HomeWalkthroughs
  • Home
  • ACTIVE DIRECTORY PENTESTING
    • Initial Enumeration
      • Enumerating users
    • Abusing Active Directory ACLs/ACEs
      • Shadow Credentials
      • GenericWrite
      • ForceChangePassword
    • Active Directory Certificate Services (ADCS)
    • Attacking Kerberos
    • BloodHound
    • Tools
      • bloodyAD
      • Kerbrute
      • Impacket
      • ldapsearch
      • PowerView.py
  • WINDOWS PENTESTING
    • Windows Privilege Escalation
      • Abusing Tokens
      • AD Recycle Bin Group
      • DnsAdmins to DomainAdmin
      • Dumping credentials
        • Credential Hunting
        • LSASS
        • NTDS.dit
        • SAM and SYSTEM
      • Server Operators Group
  • Windows Lateral Movement
    • Pass the Hash (PtH)
    • Pass the Ticket (PtT)
      • From Windows
      • From Linux
    • Pass the Cert (PtC)
  • File Transfer
    • PowerShell
    • Remote Desktop Protocol (RDP)
    • LOLBAS
    • Protected File Transfers
    • Catching Files over HTTP/S
    • Detection and Evading Detection
  • Reverse Shell
  • PowerShell
  • LINUX PENTESTING
    • Basic Enumeration
    • Linux Privilege Escalation
  • File Transfer
    • Protected File Transfers
    • Catching Files over HTTP/S
    • GTFOBins
  • Shells
  • Reverse Shell
  • Credential Hunting
  • Passwd, Shadow & Opasswd
  • NETWORK SERVICES PENTESTING
    • FTP Port (21)
    • SSH Port (22)
    • DNS Port (53)
    • SMB Port (139, 445)
    • MSSQL Port (1433)
    • MySQL Port (3306)
    • RDP Port (3389)
  • PostgreSQL Port (5432, 5433)
  • Attacking Email Services
  • Pivoting, Tunneling and Port Forwarding
  • WEB PENTESTING
    • Local File Inclusion (LFI)
  • LaTeX Injection
  • Cypher Injection
  • Cross-Site Scripting (XSS)
  • TOOLS
    • John The Ripper
    • NetExec
    • Smbmap
    • Evil-WinRM
  • REVERSING
    • Windows executables and DLL's
    • Android APK
Con tecnología de GitBook
LogoLogo

© 2025 Gzzcoo Corp.

En esta página
  • Running Commands as Another User with ScriptBlock
  • Encode a file with Base64 to transfer original file
  • PowerShell History commands

¿Te fue útil?

Exportar como PDF

PowerShell

Running Commands as Another User with ScriptBlock

Crear objeto para jugar con ScriptBlock con las credenciales de otro usuario en otro equipo.

$SecPassword = ConvertTo-SecureString 'Password' -AsPlainText -Force

$Cred = New-Object System.Management.Automation.PSCredential('domain\user',$SecPassword)

Invoke-Command -ComputerName computer -Credential $Cred -ScriptBlock { whoami }

Encode a file with Base64 to transfer original file

# Desde el equipo victima convertimos el archivo 'file.bin' que no es legible a Base64
powershell -c "[convert]::ToBase64String((cat C:\\Temp\\file.bin -Encoding byte))"

[convert]::ToBase64String((cat C:\\Temp\\file.bin -Encoding byte))

# Desde el equipo atacante, descodificamos el contenido y obtenemos el archivo original. Nos hemos pasado el archivo solamente codificando en Base64.
echo '<BASE64_CODE>' | base64 -d > file.bin

PowerShell History commands

type $env:USERPROFILE\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
AnteriorReverse ShellSiguienteBasic Enumeration

Última actualización hace 3 meses

¿Te fue útil?