{"id":3018,"date":"2025-06-30T08:00:00","date_gmt":"2025-06-30T08:00:00","guid":{"rendered":"https:\/\/myvlcsys.com\/?p=3018"},"modified":"2025-07-11T11:59:05","modified_gmt":"2025-07-11T11:59:05","slug":"ciberseguridad-vacaciones-dockerlabs-writeup","status":"publish","type":"post","link":"https:\/\/myvlcsys.com\/?p=3018","title":{"rendered":"Ciber: DockerLabs [Vacaciones-WriteUp]"},"content":{"rendered":"\n<p>En el siguiente WriteUp, vamos a resolver la m\u00e1quina de la plataforma de DockerLabs&nbsp;<strong>VACACIONES<\/strong>, clasificada con nivel de seguridad \u201cMuy F\u00e1cil\u201d.<\/p>\n\n\n\n<p>T\u00e9cnicas aplicadas para la resoluci\u00f3n de la m\u00e1quina:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Escaneo de Puertos<\/li><li>hydra -l<\/li><li>Metasploit<\/li><\/ul>\n\n\n\n<p>Descargar la m\u00e1quina docker<\/p>\n\n\n\n<p>megadl <a href=\"https:\/\/mega.nz\/file\/YCEGAISD#y6iWUG_auH4vUApClb9ix7H6JmOCKm4vAYS2TjQn59g\">https:\/\/mega.nz\/file\/YCEGAISD#y6iWUG_auH4vUApClb9ix7H6JmOCKm4vAYS2TjQn59g<\/a><\/p>\n\n\n\n<p><strong>Descomprimir la m\u00e1quina:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>unzip vacaciones.zip&nbsp;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeIuBXiMu4b8fnF-fQjIVQLtWl7-zR1povMSj1DnPqGbfQ-F_IvMXepFXNx2UAImLfKwrJpdwvUfAGofxH9bU1kKB3IDYhbHM7AqJ0Y68UQrrAluWqPDIh5t4LnhLYFDftfHscENA?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"839\" height=\"375\"\/><\/figure>\n\n\n\n<p><strong>Desplegamos el laboratorio:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>sudo bash auto_deploy.sh vacaciones.tar<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfVilHzSlUf2MrKaKX5k8ouL7tYkxzasPUrcnHV27vstSVXziz8Cm5eQk0HHxq6oaRmIocVzWIPLd8G8LpC5p_le5B-ByGBri81zer0_hXQ2fWbNLNjOzpAIJHm2YMiLx6o4lbq?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"829\" height=\"239\"\/><\/figure>\n\n\n\n<p>Comprobamos la conectividad de red con maquina objetivo :<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcyVG3scISF-qbMX8qcSt9aS2L1DK2Hm38j_HpjNTD4NQnfdaEABQJYkVTp5n1WX0ArPWIWRXQPbcfRWsVq7PM5yqTquTpfegnSbj4c4mQAoe_I___aLMyGDhUmJxSogHGB8V8EGg?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"839\" height=\"272\"\/><\/figure>\n\n\n\n<p>observamos que la respuesta del ttl es de 64, por lo que ya podemos deducir que la m\u00e1quina objetivo se trata de un sistema linux.<\/p>\n\n\n\n<p><strong>ESCANEO DE PUERTOS:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdCKDonMKKiakO4gOfZkebDww_5jm9mZuvxNt8pAm08rC2TstRYnS7JyE2XvEjr02BcV817-Tu2rJO5DWgkNKXPzno7C_wHLl23YIGGQrR3SIvIqDXXPjEMGkDJIuMk6M93mnkNpg?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"839\" height=\"517\"\/><\/figure>\n\n\n\n<p><strong>Lo que&nbsp; observamos tras el escaneo de puertos es que tiene el puerto 22 abierto, que corresponde al servicio ftp, y tambi\u00e9n el puerto 80 por el que corre el servicio Apache.<\/strong><\/p>\n\n\n\n<p><strong>Puerto 80:<\/strong><\/p>\n\n\n\n<p>Encontramos un web en sin contenido:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXc2YLWuFn7NoFX6GAbA2EV-rQNjDNwH8G5dbUEZ-9OJJqL6pVy8P40nfYNm1nzy4_Dvx3O5MAxIz1x__cF-6m-uPAIrnTnVOx4spvixc7twT1USxii0qS5jO9Sjiy9ryh-K_xMhMw?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"840\" height=\"1069\"\/><\/figure>\n\n\n\n<p>Tampoco encontramos nada destacable al inspeccionar el c\u00f3digo fuente de la misma.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeXdFr8V6IPwF7mZQPvAjKS8AK5t1OVaEtVqs4D51HOKRQUHMYQnhbopJA5Lpt57Wa19eR2h_a7CbD5iacxBmAW16j9RSTrZDCq7IqNazlMYuARWR48rrcEHShRMI9ePq4QZIrrHw?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"841\" height=\"1070\"\/><\/figure>\n\n\n\n<p><strong>EXPLOTACI\u00d3N:<\/strong><\/p>\n\n\n\n<p>Tr\u00e1s<strong> <\/strong>inspeccionar la web, vamos a intentar vulnerar la m\u00e1quina haciendo un ataque de fuerza bruta con los dos usuario que nos muestran la inspecci\u00f3n del c\u00f3digo fuente, \u201cjuan\u201d y \u201ccamilo\u201d.&nbsp;<\/p>\n\n\n\n<p>Para lo cual haremos lo siguiente.<\/p>\n\n\n\n<p>Crearemos un fichero de texto llamado users.txt con los dos usuarios-<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXetnLwyaqAxCWWZutHfXqt_hKnXQTsvPqdoXIH5Y9uH0Nl54Xn7OFAAQVI3QFrkkjsTOrQA7CMV4EXr7KBzTwmJE7wM0iH55CTnVVkzSnRM7Iql6Fo-xt6CFc6hcw0wUIqVQNYq?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"842\" height=\"271\"\/><\/figure>\n\n\n\n<p>y ahora&nbsp; con hydra y el poderoso rockyou para ver qu\u00e9 encontramos:<\/p>\n\n\n\n<p>hydra -l<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcz9cYDjJFTCefpxA3e4qe3hHteBNrze3J1_yVWxFmE1xojjz_NaAnlBuTJDSYqKjS81DFEZ-s5DozL2cQHlbybSyE4vBSGQcBPBNOO3OxC1YsRHN0NY74AH23dugh9oz_cpu70yA?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"841\" height=\"217\"\/><\/figure>\n\n\n\n<p>Con el login(camilo) y el password(password1) obtenido con hydra, haremos una intrusi\u00f3n a la m\u00e1quina mediante ssh, siendo exitoso el intento.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXclCMQVB5OJTsGV4IOb2kTTg5nvwRblsZvr7bnCI-bimEaa_SIgHrYWU7XMfEz2PWAWZDmItlYJsTZ2kszUQ-jObJbCFYiq5ChspGMPSGYH9yEiEPjWvnEnahxU_5LxtubIyw3C?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"841\" height=\"118\"\/><\/figure>\n\n\n\n<p>Tr\u00e1s la intrusi\u00f3n investigamos un poco y observamos que hay un tercer usuario llamado Pedro y que Camilo no puede ejecutar ning\u00fan comando como sudo. Recordamos que el mensaje del servidor mencionaba un mensaje importante, as\u00ed que&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXei2GinxASyoDViqSV4jrJlRCcQR7jwu1UjNpDNwfqTt9J8o30WPv3BTckDNXOvfHvjGF6X6JSyfXT3H256DkLtXmNuFIoOx7nJwuc2Cb8MOzHiG_lAmp0tNaIlb6BZGoGxCNgR?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"841\" height=\"273\"\/><\/figure>\n\n\n\n<p>Observamos que a la hora de intentar ejecutar comando con privilegios avanzados, nos indica que el usuario camilo, no tiene permisos para ello.<\/p>\n\n\n\n<p>Navegamos por los directorios que tenemos acceso y llegamos hasta el directorio mail de la ra\u00edz, en donde encontramos un directorio llamado \u201ccamilo\u201d, y dentro un archivo de texto llamado correo.txt<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdrh4_mOXlvyiR5IhHe_ZPGB9ot0s1NEJuw6XP0J5TWa0aWnsqryfcGBkYMAaMjlZ8hrVGYH31D8QCpFnBuI97ugCUW38gPA87F6S_zH8a_DtljzoavJXL3iEr5OoSIKznX0t7nmg?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"843\" height=\"258\"\/><\/figure>\n\n\n\n<p>Visualizamos la informaci\u00f3n de ese fichero para intentar obtener m\u00e1s informaci\u00f3n:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcVsTCQpY3whvJCcH6bntR3H_ZZ5tzF8UdJawpuY4Y7dEnuJXaYk0xMtGyf-dwsb_sZbfBcBDuqzULSvd4GmlaHNY6Jcl35GKaVoI6-m_kCWt1UrdSWr2mTLCXinEpY496IaH9S?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"838\" height=\"98\"\/><\/figure>\n\n\n\n<p>Vamos a intentar entrar al sistema con el usuario \u201cJuan\u201d y password \u201c2k84dicb\u201d que es lo que nos indica el fichero.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXc0y5U-5aPOrNpRJEcvCtkLsIvPicMcIW2xiltWAxNaoNw9C1Dl95APC4oJAuCovEplFEj4hdLddQmXjQt6x6kkJEasmlLwtp8TsnzpXravMYr944PJ8x_IkMgJ3vWASZN7xKD74g?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"835\" height=\"104\"\/><\/figure>\n\n\n\n<p>Como podemos observar tenemos acceso a la m\u00e1quina objetivo, y vamos a ver los permisos que tenemos sobre la misma con el usuario juan.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcqMMb-J7P_joqqu9uxsyNg8eI2xkLhbMd7fZ0u1goJ5Ry8K17Gqhsor7ZBU42shiZgEYf4dY4qlppMU7k2IhFR0YmGo93g0DgJ4UlSNPPJAimx15dZhmBj4XTtGp_O3n9LF7mNeg?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"840\" height=\"140\"\/><\/figure>\n\n\n\n<p>Ejecutaremos el comando <strong><em>sudo ruby -e &#8216;exec \u00ab\/bin\/sh\u00bb&#8216;.<\/em><\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p>Con este comando abre una shell (\/bin\/sh) con permisos de superusuario utilizando Ruby. Es una t\u00e9cnica com\u00fanmente utilizada para obtener acceso root en sistemas donde el usuario tiene permisos <strong>sudo <\/strong>para ejecutar Ruby, pero no acceso directo a una shell root.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXelBrvikKsN0NLTaBmOuy9kk63XMQUxp3rph5XKO87Lfz1F2YMi5TDivLiTPk9CI6A7Q1tVzU1sLKydJ9jBWl85ZLc8gIPJ13MnKr4PBdAZI5TFmt2C6xqlqwR7t6UyGwKMp_Kp?key=eN0W_XSUoMsDtqf_6Q9Sig\" alt=\"\" width=\"843\" height=\"103\"\/><\/figure>\n\n\n\n<p>Tras est\u00e9 procedimiento daremos la instrucci\u00f3n al m\u00e1quina por finalizada.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>En el siguiente WriteUp, vamos a resolver la m\u00e1quina de la plataforma de DockerLabs&nbsp;VACACIONES, clasificada con nivel de seguridad \u201cMuy F\u00e1cil\u201d. T\u00e9cnicas aplicadas para la resoluci\u00f3n de la m\u00e1quina: Escaneo&hellip; <\/p>\n","protected":false},"author":4,"featured_media":2974,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[60,74,10],"tags":[61,25,47,76],"class_list":["post-3018","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ciberseguridad","category-dockerlabs","category-linux","tag-ciberseguridad","tag-linux","tag-myvlcsys","tag-writeup"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts\/3018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3018"}],"version-history":[{"count":11,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts\/3018\/revisions"}],"predecessor-version":[{"id":3056,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/posts\/3018\/revisions\/3056"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=\/wp\/v2\/media\/2974"}],"wp:attachment":[{"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myvlcsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}