Archive for septiembre 2009

h1

Error The file to which the capture would be saved («capture.cap») could not be opened: Permission denied.

28/09/2009

Al ejecutar Tshark (la versión de consola de Wireshark) puede ocurrir el siguiente error:


carlos@maquina17:~$ sudo tshark -i eth0 -w captura.trafico.20090928.cap
Running as user "root" and group "root". This could be dangerous.
Capturing on eth0
tshark: The file to which the capture would be saved ("captura.trafico.20090928.cap") could not be opened: Permission denied.

Esto ocurre por una cuestión de diseño basada en la seguridad del software (Bug Debian #453292).

Se soluciona de dos formas distintas:

a) Creando previamente el fichero:
carlos@maquina17:~$ sudo touch captura.trafico.20090928.cap

a) Cambiando la ruta donde salvar el fichero a otra donde no haya problemas de UID.
carlos@maquina17:~$ sudo tshark -i eth0 -w /root/captura.trafico.20090928.cap

h1

Error Firefox: Could not find compatible GRE between version 1.9.0.1 and 1.9.0.*.

22/09/2009

Si al ejecutar Firefox se produce este error en la consola:

carlos@WhenIGrowUp:~/personal$ firefox
Could not find compatible GRE between version 1.9.0.1 and 1.9.0.*.

Es necesario realizar los siguientes pasos:

1º) Comprobar paquete «xulrunner»

$ dpkg -l xulrunner-1.9
(...)
ii xulrunner-1.9 1.9.0.3+nobinonly- XUL + XPCOM application runner

2º) Instalarlo si no se dispone de él:

$ sudo apt-get install xulrunner

3º) Ejecutar:

$ xulrunner --register-global

Y volver a ejecutar Firefox.

Fuente: Launchpad Ubuntu

h1

Web-Shell exception happened SocketServer.py

14/09/2009

Si al ejecutar la utilidad Web-Shell se producen trazas similares a éstas:

Exception happened during processing of request from ('172.26.0.4', 35859)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 312, in handle_one_request
self.raw_requestline = self.rfile.readline()
File "/usr/lib/python2.6/socket.py", line 404, in readline
data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('172.26.0.4', 35860)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 312, in handle_one_request
self.raw_requestline = self.rfile.readline()
File "/usr/lib/python2.6/socket.py", line 404, in readline
data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('172.26.0.4', 35861)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 312, in handle_one_request
self.raw_requestline = self.rfile.readline()
File "/usr/lib/python2.6/socket.py", line 404, in readline
data = self._sock.recv(self._rbufsize)
Error: [('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'http request')]
----------------------------------------

Se debe sencillamente a un uso incorrecto de la aplicación. La web se ha accedido por http cuando debe ser por https.
http://172.26.0.5:8022/
https://172.26.0.5:8022/

Además, si se desea monitorizar con Monit, es necesario añadir las siguientes líneas al fichero de configuración

#sudo nano /etc/monit/monitrc
(...)
check host WebShell_8022 with address 127.0.0.1
start program = "/usr/bin/python /etc/WebShell/webshell.py &"
stop program = "/usr/bin/killall -9 python /etc/WebShell/webshell.py"
if failed port 8022 then restart
(...)

adaptando las rutas, y reiniciar Monit

#sudo /etc/init.d/monit restart

h1

Error installing Xplico 0.5.2 deb package: chown: cannot access `/opt/xplico/xi’: No such file or directory

14/09/2009

[ Update]:Newer versions of Xplico have solved this problem.

During the installation of Xplico, network traffic analyzer and sniffer (pcap compatible), may happen this error:

#dpkg -i xplico_0.5.2_i386.deb
After this operation, 0B of additional disk space will be used.
Setting up xplico (0.5.2) ...
chown: cannot access `/opt/xplico/xi': No such file or directory
dpkg: error processing xplico (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
xplico
E: Sub-process /usr/bin/dpkg returned an error code (1)

If you create that missing directory by yourself and try to reinstall, another error will be prompted:

root@ubuntu:/home/adminuser/Desktop# apt-get install xplico
chmod: cannot access `/opt/xplico/xplico.db': No such file or directory

Till next package version, the current solution is uninstall and reinstall using this method:

1º) Uninstall:
# sudo dpkg -r xplico


2º) Manually delete the lines which mention port 9876
# nano etc/apache2/ports.conf


3º) Install the package with gdebi:
adminuser@ubuntu:~/Desktop$ sudo apt-get install gdebi

adminuser@ubuntu:~/Desktop$ sudo gdebi xplico_0.5.2_i386.deb
Reading package lists: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
Xplico is a Network Forensic Analysis Tool (NFAT)
The goal of Xplico is extract from an internet traffic capture the applications data contained.
For example, from a pcap file Xplico extracts each email (POP, IMAP, and SMTP protocols), all HTTP contents, each VoIP call (SIP), FTP, TFTP, and so on. Xplico is not a network protocol analyzer.
Do you want to install the software package? [y/N]:Y
Selecting previously deselected package xplico.
(Reading database ... 136557 files and directories currently installed.)
Unpacking xplico (from xplico_0.5.2_i386.deb) ...
Setting up xplico (0.5.2) ...
Module php5 already enabled
Module rewrite already enabled

Thanks to Gianluca Costa

h1

Como descomprimir una backup de Plesk en Linux

08/09/2009

El formato de backups de Plesk es distinto al habitual tar.gz, por lo que hay que utilizar una herramienta específica para, posteriormente si, conseguir un tar.gz

1º) Bajar, descomprimir e instalar ripmime

2º) Procesar el fichero con ripmine:
# ripmime -i backup-20090908-mi-dominio.com -d directorioBackupRestaurada

3º) Descomprimir el contenido:
# tar -ztvf directorioBackupRestaurada/*

Fuente: http://forums.deftechgroup.com/showthread.php?t=1087

h1

/usr/bin/msgmerge not found

08/09/2009

Si a la hora de realizar una compilación se produce un error similar al siguiente:

/usr/bin/msgmerge --update ar.po amule.pot
/bin/sh: /usr/bin/msgmerge: not found

Es facilmente solucionable instalando el paquete gettext:

carlos@WhenIGrowUp:~/amule/amule$ sudo apt-get install gettext
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
Paquetes sugeridos:
cvs gettext-doc
Se instalarán los siguientes paquetes NUEVOS:
gettext
0 actualizados, 1 se instalarán, 0 para eliminar y 81 no actualizados.
Necesito descargar 2067kB de archivos.
Se utilizarán 8221kB de espacio de disco adicional después de desempaquetar.
Des:1 http://archive.ubuntu.com hardy/main gettext 0.17-2ubuntu1 [2067kB]
Descargados 2067kB en 1s (1182kB/s)
Seleccionando el paquete gettext previamente no seleccionado.
(Leyendo la base de datos ...
152201 ficheros y directorios instalados actualmente.)
Desempaquetando gettext (de .../gettext_0.17-2ubuntu1_amd64.deb) ...
Configurando gettext (0.17-2ubuntu1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place

h1

Activar módulo rewrite en Apache / Error «auth/login was not found on this server»

08/09/2009

Al ejecutar una aplicación php en un Apache, puede suceder el siguiente error:

The requested URL /var/www/aplicacion1/mysite/public/index.php/auth/login was not found on this server.

Esto probablemente se deba a una directiva especificada en el archivo .htaccess, que solicita al servidor web un determinado comportamiento.

RewriteEngine on
RewriteCond %{REQUEST_URI} !/public/.*
RewriteCond %{REQUEST_URI} !/images/.*
RewriteCond %{REQUEST_URI} !/layout/.*
RewriteRule .* index.php
php_flag magic_quotes_gpc off
php_flag register_globals off
php_value max_execution_time 120

Generalmente el problema es debido a la ausencia del módulo rewrite en la configuración de Apache. Para ello es necesario realizar tres pasos:

1º) Activar el módulo rewrite en Apache2.

ubuntu@ubuntu:/$ sudo a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!

2º) Modificar la configuración de Apache para indicar a qué sites alojados debe aplicarse el módulo «rewrite», sustituyendo «AllowOverride none» por AllowOverride All«.
ubuntu@ubuntu:/$ sudo nano /etc/apache2/sites-enabled/000-default

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
(…)

Realizar este cambio por tanto en las entradas en las que se quiera aplicar el módulo rewrite, generalmente en todas.

3º) Reiniciar Apache

root@ubuntu:/etc/apache2/sites-enabled# /etc/init.d/apache2 restart
* Restarting web server htcacheclean                                                                                                               ...not running
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]

Y de esta manera se consigue activar y configurar el módulo mod_rewrite en Apache2.