noviembre 25, 2014

Recuperar contraseña de Super administrador en Joomla

Al olvidar la contraseña de nuestro sitio o al sufrir un ataque, tendremos que recuperar la contraseña de Super Administrador en Joomla!. Vemos cómo hacerlo.
En las primeras versiones de Joomla! 1.5, recuperar la contraseña de usuario era muy sencillo, tan sólo necesitábamos encriptarla con el método de MD5 y guardar el resultado en la base de datos. No obstante, en las últimas versiones de Joomla! 1.5 y por supuesto en Joomla! 2.5, la seguridad mejoró considerablemente y con ello la forma en la que podemos recuperar la contraseña.

Recuperación a través del email de administrador

Si tenemos acceso al email de registro del usuario, la opción más sencilla es utilizar la función de recordar contraseña que viene de serie con Joomla!. Para ello simplemente tenemos que acceder a la siguiente dirección de nuestro sitio:
http://tusitio.com/index.php?option=com_users&view=reset
Por supuesto debéis sustituir tusitio.com por la dirección de vuestro sitio. Esta opción también es compatible con Joomla! 1.5.

Recuperación a través de la base de datos

Si no recordamos el email del usuario o no tenemos acceso al mismo ¡que no cunda el pánico! Si tenemos acceso a la base de datos, podemos solucionarlo. Para ello acceded a vuestra base de datos (lo más común es utilizar phpMyAdmin a través del panel de control de vuestro servidor.
Una vez dentro de vuestra base de datos, tendréis que buscar la tabla XXX_users (donde XXX en vuestro caso serán letras diferentes ya que es una combinación aleatoria única para cada sitio) y buscar en esta tabla el usuario para el que queréis recuperar la contraseña. Una vez encontrado editáis el usuario, y cambiáis el contenido del campo password por el siguiente:
d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199
Guardáis y podréis acceder a vuestro sitio fácilmente con el usuario al que le acabáis de cambiar la contraseña y la contraseña secret.

Explicación detallada

¿Qué es lo que hemos hecho? ¿Por qué el método antiguo no sirve? Como apuntaba al comienzo del artículo, el mecanismo de encriptación del password en Joomla! ha cambiado ligeramente entre versiones. En un principio, se almacenaba con una simple encriptación MD5, pero este método es muy vulnerable a ataques como por ejemplo el de tabla arco iris.
Para mejorar esto, el método actual consiste en añadir una palabra aleatoria (llamada sal) a la contraseña antes de encriptarla, de forma que se guardan ambas en el campo contraseña en la forma:
Contraseña+Sal:Sal
por lo que aunque dos usuarios tengan la misma contraseña, nunca aparecerán iguales en la tabla de usuarios puesto que la sal es generada aleatoriamente en cada ocasión.
Podéis ver esto simplemente cambiando varias veces la contraseña y viendo el valor que aparece en la base de datos ;).
¿Habéis tenido que recurrir a estas técnicas alguna vez?

Referencias

Documentación oficial del wiki de Joomla! para recuperar el password de usuario (inglés)
Recuperar la contraseña del Super Administrador de Joomla! 1.5
Explicación de la generación de contraseñas en Joomla! 2.5 en StackOverflow (inglés)

Fuente: http://www.gnumla.com/joomla/tutoriales/recuperar-contrasena-de-super-administrador-en-joomla.html

[authz_core:error] client AH01630: client denied by server

I upgraded a copy of apache that was being used in work earlier and I ran in to some errors that were quite puzzling.
Every time I went to access the site, I was shown an error in the logs that read:
  [authz_core:error] [pid 26128:tid 2964360000] [client <IPADDRESS>:49688] AH01630: client denied by server configuration: /path/to/file.wsgi
Nothing had changed in the application so after consulting the great google, I found out that mod_authz_core was introduced in Apache2.3. This changes the way that access control is declared from
  Order allow, deny
  Allow from all
to :
  Require all granted
This means that the total configuration for a Directory is now something like:
  <Directory /path/to/directory>
    Options FollowSymlinks
    AllowOverride none
    Require all granted
  </Directory>
Restart apache and it'll all work nicely.

Fuente: https://mikegriffin.ie/blog/20140130-authz-core-error-client-denied-by-server-configuration/

mysqldump: Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’ when using LOCK TABLES

mysqldump: Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’ when using LOCK TABLES


I'm trying to make backups using the mysqldump command and getting the following error or warning:
mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES
How do I fix this problem?

You can pass the --single-transaction option to mysqldump command:
$ mysqldump --single-transaction -u user -p DBNAME > backup.sql

Another option is to grant LOCK TABLES to your user:
$ mysql -u root -p

And type:
mysql> GRANT SELECT,LOCK TABLES ON DBNAME.* TO 'username'@'localhost'; 

Fuente: http://www.cyberciti.biz/faq/linux-unix-mysqldump-got-error1044-access-denied/

noviembre 18, 2014

octubre 29, 2014

Encontrar que proceso está usando un archivo

How to Find Out Which Windows Process is Using a File

http://www.techsupportalert.com/content/how-find-out-which-windows-process-using-file.htm

How to Find Out Which Windows Process is Using a File

Ever try to delete, move, or rename a file only to get a Windows system warning with something like one of these messages?
  • "Cannot delete file: Access is denied"
  • "There has been a sharing violation"
  • "The source or destination file may be in use"
  • "The file is in use by another program or user".
  • "Make sure the disk is not full or write-protected and that the file is not currently in use"
One of the best ways to handle locked files or folders is to use the free Microsoft program Process Explorer. The program has been described in another article and here is how to use it to find out what program, DLL, or handle is using a file or folder. You will need to run as administrator.

How to find out what program is using a file

In Windows 7 or 8, the system message may tell you what program is using the file. If it doesn’t or if you are using Windows XP, there is a simple way to find the program:
  1. Open Process Explorer, running as administrator.
  2. On the toolbar, find the gunsight icon on the right (shown highlighted in the figure shown below).
  3. Drag the icon and drop it on the open file or folder that is locked.
  4. The executable that is using the file will be highlighted in the Process Explorer main display list.

How to find out which handle or DLL is using a file

  1. Open Process Explorer, running as administrator.
  2. Enter the keyboard shortcut Ctrl+F. Altenatively, click the “Find” menu and select “Find a Handle or DLL”.
  3. A search dialog box will open.
  4. Type in the name of the locked file or other file of interest. Partial names are usually sufficient.
  5. Click the button “Search”,
  6. A list will be generated. There may be a number of entries.
  7. An individual handle in the list can be killed by selecting it and pressing the delete key. However, care is necessary when deleting handles, as instabilities may occur. Often, just rebooting will free a locked file.
Process Explorer can be downloaded here.

octubre 09, 2014

Moodle questionnaire 1.9.1


https://moodle.org/plugins/view.php?plugin=mod_questionnaire

To Install version 1.9.1:

1. Load the questionnaire module directory into your "mod" subdirectory.
2. Visit your admin page to create all of the necessary data tables.
( http://url/admin )

¿Cómo poner el conteo de las filas en una consulta en MySql?

 ¿Cómo poner el conteo de las filas en una consulta en MySql? SELECT  @rownum := @rownum + 1 AS contador,  /*Contador*/ t.*  /* nombre d...