elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Hacking (Moderador: toxeek)
| | |-+  Hack my server II
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 16 17 18 19 Ir Abajo Respuesta Imprimir
Autor Tema: Hack my server II  (Leído 80,911 veces)
dimitrix


Desconectado Desconectado

Mensajes: 4.847



Ver Perfil WWW
Re: Hack my server II
« Respuesta #70 en: 1 Agosto 2014, 18:36 pm »

Yo ya me quede como la mayoría, no hay dir con permisos para subir shell por SQLi el SSH no tiene nada por defecto y por el puerto 10000 no mire mucho pero a saber si tiene algo...

Esta noche activo los permisos (como tendria un WP real) en las carpetas...

10000... webmin os espera...



!drvy puedes confirmar?



xustyx un deface es algo facil... se busca el root...
En línea




MinusFour
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.529


I'm fourth.


Ver Perfil WWW
Re: Hack my server II
« Respuesta #71 en: 1 Agosto 2014, 18:42 pm »

Por cierto para el que haya encontrado alguna vulnerabilidad de wordpress, si viene con permisos por default el proceso de apache no va a permitir escribir a la carpeta de www así que si intentan subir una shell por ahí ni lo intenten. Lo que podrían hacer si encontraron una vulnerabilidad es usar shell_exec...

Para el que no se haya dado cuenta O.o esto es wordpress 2.0... estoy seguro que debe haber muchas vulnerabilidades....

WordPress
Version 2.0
En línea

#!drvy


Desconectado Desconectado

Mensajes: 5.850



Ver Perfil WWW
Re: Hack my server II
« Respuesta #72 en: 1 Agosto 2014, 18:48 pm »

Que Lammer urruina juego! No siguió las reglas.

pffffffffff...

Fui yo por hacer la gracia xD No he rooteado ni nada, fue inyeccion de HTML en uno de los post..

Saludos
En línea

Baal_30

Desconectado Desconectado

Mensajes: 248



Ver Perfil
Re: Hack my server II
« Respuesta #73 en: 1 Agosto 2014, 18:51 pm »

¿Como podría averiguar la versión del webmin? :P
En línea

«La suerte es el cuidado de los detalles». -Winston Churchill
#!drvy


Desconectado Desconectado

Mensajes: 5.850



Ver Perfil WWW
Re: Hack my server II
« Respuesta #74 en: 1 Agosto 2014, 18:52 pm »

Código
  1. → nmap -sV  ###########
  2.  
  3. Starting Nmap 6.00 ( http://nmap.org ) at 2014-08-01 16:07 CEST
  4. Nmap scan report for #########  (#########)
  5. Host is up (0.18s latency).
  6. rDNS record for ######: #######
  7. Not shown: 995 closed ports
  8. PORT      STATE    SERVICE      VERSION
  9. 22/tcp    open     ssh          (protocol 2.0)
  10. 53/tcp    open     domain
  11. 80/tcp    open     http         Apache httpd 2.4.6 ((Ubuntu))
  12. 445/tcp   filtered microsoft-ds
  13. 10000/tcp open     http         MiniServ 1.690 (Webmin httpd)

Saludos
En línea

dimitrix


Desconectado Desconectado

Mensajes: 4.847



Ver Perfil WWW
Re: Hack my server II
« Respuesta #75 en: 1 Agosto 2014, 19:05 pm »

WordPress
Version 2.0

Exacto, la 2.0 con la ayuda de Peibol consegui una lista de versiones viejas xD

Ganate unos puntitos explicado como sabes que es la 2.0.
En línea




dRak0

Desconectado Desconectado

Mensajes: 234


Ver Perfil WWW
Re: Hack my server II
« Respuesta #76 en: 1 Agosto 2014, 19:09 pm »

http://WEB/wp-includes/ FPD


Código
  1. function wp_handle_upload(&$file, $overrides = false) {
  2. // The default error handler.
  3. if (! function_exists('wp_handle_upload_error') ) {
  4. function wp_handle_upload_error(&$file, $message) {
  5. return array('error'=>$message);
  6. }
  7. }
  8.  
  9. // You may define your own function and pass the name in $overrides['upload_error_handler']
  10. $upload_error_handler = 'wp_handle_upload_error';
  11.  
  12. // $_POST['action'] must be set and its value must equal $overrides['action'] or this:
  13. $action = 'wp_handle_upload';
  14.  
  15. // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
  16. $upload_error_strings = array(false,
  17. __("The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>."),
  18. __("The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."),
  19. __("The uploaded file was only partially uploaded."),
  20. __("No file was uploaded."),
  21. __("Missing a temporary folder."),
  22. __("Failed to write file to disk."));
  23.  
  24. // Accepted MIME types are set here as PCRE. Override with $override['mimes'].
  25. $mimes = apply_filters('upload_mimes', array (
  26. 'jpg|jpeg|jpe' => 'image/jpeg',
  27. 'gif' => 'image/gif',
  28. 'png' => 'image/png',
  29. 'bmp' => 'image/bmp',
  30. 'tif|tiff' => 'image/tiff',
  31. 'ico' => 'image/x-icon',
  32. 'asf|asx|wax|wmv|wmx' => 'video/asf',
  33. 'avi' => 'video/avi',
  34. 'mov|qt' => 'video/quicktime',
  35. 'mpeg|mpg|mpe' => 'video/mpeg',
  36. 'txt|c|cc|h' => 'text/plain',
  37. 'rtx' => 'text/richtext',
  38. 'css' => 'text/css',
  39. 'htm|html' => 'text/html',
  40. 'mp3|mp4' => 'audio/mpeg',
  41. 'ra|ram' => 'audio/x-realaudio',
  42. 'wav' => 'audio/wav',
  43. 'ogg' => 'audio/ogg',
  44. 'mid|midi' => 'audio/midi',
  45. 'wma' => 'audio/wma',
  46. 'rtf' => 'application/rtf',
  47. 'js' => 'application/javascript',
  48. 'pdf' => 'application/pdf',
  49. 'doc' => 'application/msword',
  50. 'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
  51. 'wri' => 'application/vnd.ms-write',
  52. 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
  53. 'mdb' => 'application/vnd.ms-access',
  54. 'mpp' => 'application/vnd.ms-project',
  55. 'swf' => 'application/x-shockwave-flash',
  56. 'class' => 'application/java',
  57. 'tar' => 'application/x-tar',
  58. 'zip' => 'application/zip',
  59. 'gz|gzip' => 'application/x-gzip',
  60. 'exe' => 'application/x-msdownload'
  61. ));
  62.  
  63. // All tests are on by default. Most can be turned off by $override[{test_name}] = false;
  64. $test_form = true;
  65. $test_size = true;
  66.  
  67. // If you override this, you must provide $ext and $type!!!!
  68. $test_type = true;
  69.  
  70. // Install user overrides. Did we mention that this voids your warranty?
  71. if ( is_array($overrides) )
  72. extract($overrides, EXTR_OVERWRITE);
  73.  
  74. // A correct form post will pass this test.
  75. if ( $test_form && (!isset($_POST['action']) || ($_POST['action'] != $action)) )
  76. return $upload_error_handler($file, __('Invalid form submission.'));
  77.  
  78. // A successful upload will pass this test. It makes no sense to override this one.
  79. if ( $file['error'] > 0 )
  80. return $upload_error_handler($file, $upload_error_strings[$file['error']]);
  81.  
  82. // A non-empty file will pass this test.
  83. if ( $test_size && !($file['size'] > 0) )
  84. return $upload_error_handler($file, __('File is empty. Please upload something more substantial.'));
  85.  
  86. // A properly uploaded file will pass this test. There should be no reason to override this one.
  87. if (! @ is_uploaded_file($file['tmp_name']) )
  88. return $upload_error_handler($file, __('Specified file failed upload test.'));
  89.  
  90. // A correct MIME type will pass this test.
  91. if ( $test_type ) {
  92. $type = false;
  93. $ext = false;
  94. foreach ($mimes as $ext_preg => $mime_match) {
  95. $ext_preg = '![^.]\.(' . $ext_preg . ')$!i';
  96. if ( preg_match($ext_preg, $file['name'], $ext_matches) ) {
  97. $type = $mime_match;
  98. $ext = $ext_matches[1];
  99. }
  100. }
  101.  
  102. if ( !$type || !$ext )
  103. return $upload_error_handler($file, __('File type does not meet security guidelines. Try another.'));
  104. }
  105.  
  106. // A writable uploads dir will pass this test. Again, there's no point overriding this one.
  107. if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
  108. return $upload_error_handler($file, $uploads['error']);
  109.  
  110. // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
  111. if ( isset($unique_filename_callback) && function_exists($unique_filename_callback) ) {
  112. $filename = $unique_filename_callback($uploads['path'], $file['name']);
  113. } else {
  114. $number = '';
  115. $filename = str_replace('#', '_', $file['name']);
  116. $filename = str_replace(array('\\', "'"), '', $filename);
  117. if ( empty($ext) )
  118. $ext = '';
  119. else
  120. $ext = ".$ext";
  121. while ( file_exists($uploads['path'] . "/$filename") ) {
  122. if ( '' == "$number$ext" )
  123. $filename = $filename . ++$number . $ext;
  124. else
  125. $filename = str_replace("$number$ext", ++$number . $ext, $filename);
  126. }
  127. }
  128.  
  129. // Move the file to the uploads dir
  130. $new_file = $uploads['path'] . "/$filename";
  131. if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) )
  132. die(printf(__('The uploaded file could not be moved to %s.'), $file['path']));
  133.  
  134. // Set correct file permissions
  135. $stat = stat(dirname($new_file));
  136. $perms = $stat['mode'] & 0000777;
  137. @ chmod($new_file, $perms);
  138.  
  139. // Compute the URL
  140. $url = $uploads['url'] . "/$filename";
  141.  
  142. return array('file' => $new_file, 'url' => $url, 'type' => $type);
  143. }
  144.  
  145.  
  146.  


Mi upload muere en : die(printf(__('The uploaded file could not be moved to %s.'),$file['path']));

Devolviendo como string un .
Es decir : "The uploaded file could not be moved to  ."

Intento desde /wp-admin/link-import.php

Modifico el MAX_FILE_SIZE ,que es un input type="hidden",para poder subir mi shell que tiene mas tamaño.

A ver si alguno se le cae alguna idea de como pasar desde ahi , y tendriamos un bypass al uploader de wordpress.
« Última modificación: 1 Agosto 2014, 19:17 pm por ret2libc » En línea

MinusFour
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.529


I'm fourth.


Ver Perfil WWW
Re: Hack my server II
« Respuesta #77 en: 1 Agosto 2014, 19:17 pm »

Exacto, la 2.0 con la ayuda de Peibol consegui una lista de versiones viejas xD

Ganate unos puntitos explicado como sabes que es la 2.0.

http://ipdelserver/readme.html

Y si necesitas saber exactamente la versión de wordpress, necesitas meterte como admin... pongo aquí como hacerlo pero estoy seguro que a alguien ya se le ocurrio... estoy casi seguro.

Para meterte como admin, basta con volver a setear la password del admin en phpmyadmin, esta en la tabla wp_users. Para poner la password, solo basta con remplazar el hash por nuestra contraseña en hash...

http://www.miraclesalad.com/webtools/md5.php

Copias el hash y lo pegas y listo, te puedes loguear como admin xD.

En el footer tenemos una versión exacta de Wordpress...



Por cierto a mi no fue el primero que se me ocurrio lo de cambiar la password, pero que cabron el que lo hizo porque ya me habia puesto a crackear el hash >.> y ahora se que no me va a decir nada LOL.

Otra cosa, ya que puse aquí como ganar privilegios de admin en el wordpress, sería bueno que lo dejaramos en una sola password.
En línea

#!drvy


Desconectado Desconectado

Mensajes: 5.850



Ver Perfil WWW
Re: Hack my server II
« Respuesta #78 en: 1 Agosto 2014, 19:19 pm »

el WP parece vulnerable por todos lados pero dado que no tiene permisos ni para editarse a si mismo, es un poco inutil intentar subir algo por ahi..

Via el PHPMyAdmin se puede subir mediante dumpfile al directorio /tmp .. si solo pudieramos encontrar un LFI, la shell estaria subida.

Saludos
En línea

MinusFour
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.529


I'm fourth.


Ver Perfil WWW
Re: Hack my server II
« Respuesta #79 en: 1 Agosto 2014, 19:21 pm »

http://WEB/wp-includes/ FPD


Código
  1. function wp_handle_upload(&$file, $overrides = false) {
  2. // The default error handler.
  3. if (! function_exists('wp_handle_upload_error') ) {
  4. function wp_handle_upload_error(&$file, $message) {
  5. return array('error'=>$message);
  6. }
  7. }
  8.  
  9. // You may define your own function and pass the name in $overrides['upload_error_handler']
  10. $upload_error_handler = 'wp_handle_upload_error';
  11.  
  12. // $_POST['action'] must be set and its value must equal $overrides['action'] or this:
  13. $action = 'wp_handle_upload';
  14.  
  15. // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
  16. $upload_error_strings = array(false,
  17. __("The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>."),
  18. __("The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."),
  19. __("The uploaded file was only partially uploaded."),
  20. __("No file was uploaded."),
  21. __("Missing a temporary folder."),
  22. __("Failed to write file to disk."));
  23.  
  24. // Accepted MIME types are set here as PCRE. Override with $override['mimes'].
  25. $mimes = apply_filters('upload_mimes', array (
  26. 'jpg|jpeg|jpe' => 'image/jpeg',
  27. 'gif' => 'image/gif',
  28. 'png' => 'image/png',
  29. 'bmp' => 'image/bmp',
  30. 'tif|tiff' => 'image/tiff',
  31. 'ico' => 'image/x-icon',
  32. 'asf|asx|wax|wmv|wmx' => 'video/asf',
  33. 'avi' => 'video/avi',
  34. 'mov|qt' => 'video/quicktime',
  35. 'mpeg|mpg|mpe' => 'video/mpeg',
  36. 'txt|c|cc|h' => 'text/plain',
  37. 'rtx' => 'text/richtext',
  38. 'css' => 'text/css',
  39. 'htm|html' => 'text/html',
  40. 'mp3|mp4' => 'audio/mpeg',
  41. 'ra|ram' => 'audio/x-realaudio',
  42. 'wav' => 'audio/wav',
  43. 'ogg' => 'audio/ogg',
  44. 'mid|midi' => 'audio/midi',
  45. 'wma' => 'audio/wma',
  46. 'rtf' => 'application/rtf',
  47. 'js' => 'application/javascript',
  48. 'pdf' => 'application/pdf',
  49. 'doc' => 'application/msword',
  50. 'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
  51. 'wri' => 'application/vnd.ms-write',
  52. 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
  53. 'mdb' => 'application/vnd.ms-access',
  54. 'mpp' => 'application/vnd.ms-project',
  55. 'swf' => 'application/x-shockwave-flash',
  56. 'class' => 'application/java',
  57. 'tar' => 'application/x-tar',
  58. 'zip' => 'application/zip',
  59. 'gz|gzip' => 'application/x-gzip',
  60. 'exe' => 'application/x-msdownload'
  61. ));
  62.  
  63. // All tests are on by default. Most can be turned off by $override[{test_name}] = false;
  64. $test_form = true;
  65. $test_size = true;
  66.  
  67. // If you override this, you must provide $ext and $type!!!!
  68. $test_type = true;
  69.  
  70. // Install user overrides. Did we mention that this voids your warranty?
  71. if ( is_array($overrides) )
  72. extract($overrides, EXTR_OVERWRITE);
  73.  
  74. // A correct form post will pass this test.
  75. if ( $test_form && (!isset($_POST['action']) || ($_POST['action'] != $action)) )
  76. return $upload_error_handler($file, __('Invalid form submission.'));
  77.  
  78. // A successful upload will pass this test. It makes no sense to override this one.
  79. if ( $file['error'] > 0 )
  80. return $upload_error_handler($file, $upload_error_strings[$file['error']]);
  81.  
  82. // A non-empty file will pass this test.
  83. if ( $test_size && !($file['size'] > 0) )
  84. return $upload_error_handler($file, __('File is empty. Please upload something more substantial.'));
  85.  
  86. // A properly uploaded file will pass this test. There should be no reason to override this one.
  87. if (! @ is_uploaded_file($file['tmp_name']) )
  88. return $upload_error_handler($file, __('Specified file failed upload test.'));
  89.  
  90. // A correct MIME type will pass this test.
  91. if ( $test_type ) {
  92. $type = false;
  93. $ext = false;
  94. foreach ($mimes as $ext_preg => $mime_match) {
  95. $ext_preg = '![^.]\.(' . $ext_preg . ')$!i';
  96. if ( preg_match($ext_preg, $file['name'], $ext_matches) ) {
  97. $type = $mime_match;
  98. $ext = $ext_matches[1];
  99. }
  100. }
  101.  
  102. if ( !$type || !$ext )
  103. return $upload_error_handler($file, __('File type does not meet security guidelines. Try another.'));
  104. }
  105.  
  106. // A writable uploads dir will pass this test. Again, there's no point overriding this one.
  107. if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
  108. return $upload_error_handler($file, $uploads['error']);
  109.  
  110. // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
  111. if ( isset($unique_filename_callback) && function_exists($unique_filename_callback) ) {
  112. $filename = $unique_filename_callback($uploads['path'], $file['name']);
  113. } else {
  114. $number = '';
  115. $filename = str_replace('#', '_', $file['name']);
  116. $filename = str_replace(array('\\', "'"), '', $filename);
  117. if ( empty($ext) )
  118. $ext = '';
  119. else
  120. $ext = ".$ext";
  121. while ( file_exists($uploads['path'] . "/$filename") ) {
  122. if ( '' == "$number$ext" )
  123. $filename = $filename . ++$number . $ext;
  124. else
  125. $filename = str_replace("$number$ext", ++$number . $ext, $filename);
  126. }
  127. }
  128.  
  129. // Move the file to the uploads dir
  130. $new_file = $uploads['path'] . "/$filename";
  131. if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) )
  132. die(printf(__('The uploaded file could not be moved to %s.'), $file['path']));
  133.  
  134. // Set correct file permissions
  135. $stat = stat(dirname($new_file));
  136. $perms = $stat['mode'] & 0000777;
  137. @ chmod($new_file, $perms);
  138.  
  139. // Compute the URL
  140. $url = $uploads['url'] . "/$filename";
  141.  
  142. return array('file' => $new_file, 'url' => $url, 'type' => $type);
  143. }
  144.  
  145.  
  146.  


Mi upload muere en : die(printf(__('The uploaded file could not be moved to %s.'),$file['path']));

Devolviendo como string un .
Es decir : "The uploaded file could not be moved to  ."

Intento desde /wp-admin/link-import.php

Modifico el MAX_FILE_SIZE ,que es un input type="hidden",para poder subir mi shell que tiene mas tamaño.

A ver si alguno se le cae alguna idea de como pasar desde ahi , y tendriamos un bypass al uploader de wordpress.


¿No creo que haya permisos en la carpeta de upload o si? Si es así creo que puedo poner una shell. Según tengo entendido todo el directorio de www esta sin permisos de escritura, solo de lectura y ejecución.
En línea

Páginas: 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 16 17 18 19 Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Counter Strike 1.5 Hack Server
Juegos y Consolas
*StoW* 0 3,480 Último mensaje 19 Octubre 2006, 22:22 pm
por *StoW*
Internal Server Error(hack web cross)
WarZone
Angbroda 5 6,070 Último mensaje 3 Marzo 2009, 17:39 pm
por © Shadoweps ツ
Torneo Hack my Server « 1 2 ... 6 7 »
Foro Libre
dimitrix 62 21,051 Último mensaje 1 Agosto 2014, 03:04 am
por dimitrix
Hack My Server III « 1 2 »
Foro Libre
dimitrix 16 5,987 Último mensaje 30 Marzo 2015, 18:47 pm
por elmatador2
Hack my server 2018 « 1 2 »
Hacking
dimitrix 16 18,954 Último mensaje 28 Mayo 2018, 22:06 pm
por hitori batusai
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines