← Volver al Inicio

Nivel 22

Introducción a tareas Cron

Descripción del Reto 💻

En este nivel, aprenderás a conectarte a un servidor remoto usando SSH. El objetivo es familiarizarte con el comando básico de conexión y explorar el entorno.

Información de Login 🔑

Pasos para Resolver el Nivel 🛠️

  1. Conéctate al servidor usando SSH:

    bash

    
    $ ssh bandit22@bandit.labs.overthewire.org -p 2220
    This is a OverTheWire game server. More information on http://www.overthewire.org/wargamesbandit0@bandit.labs.overthewire.org's password:
    tRae0UfB9v0UzbCdn9cY0gQnds9GF58Q
                        
  2. Buscamos la contraseña para el siguiente nivel:

    bash

    
    bandit22@bandit:~$ cd /etc/cron.d
    bandit22@bandit:/etc/cron.d$ ls
    cronjob_bandit22  cronjob_bandit23  cronjob_bandit24  e2scrub_all  otw-tmp-dir  sysstat
    bandit22@bandit:/etc/cron.d$ cat cronjob_bandit23
    @reboot bandit23 /usr/bin/cronjob_bandit23.sh  &> /dev/null
    * * * * * bandit23 /usr/bin/cronjob_bandit23.sh  &> /dev/null
    bandit22@bandit:/etc/cron.d$ cat /usr/bin/cronjob_bandit23.sh
    #!/bin/bash
    
    myname=$(whoami)
    mytarget=$(echo I am user $myname | md5sum | cut -d ' ' -f 1)
    
    echo "Copying passwordfile /etc/bandit_pass/$myname to /tmp/$mytarget"
    
    cat /etc/bandit_pass/$myname > /tmp/$mytarget
    bandit22@bandit:/etc/cron.d$ echo I am user bandit23 | md5sum | cut -d ' ' -f 1
    8ca319486bfbbc3663ea0fbe81326349
    bandit22@bandit:/etc/cron.d$ cat /tmp/8ca319486bfbbc3663ea0fbe81326349
    0Zf11ioIjMVN551jX3CmStKLYqjk54Ga
    bandit22@bandit:/etc/cron.d$ 
                        

Resultado Esperado 🎉

Sigue así y llegarás al final del juego. ¡Ánimo! 🚀