Cómo proteger nuestro amule/emule contra intrusiones anti P2P y servidores falsos (fakes)
30 06 2008 Visto 2157 veces, 1 hoyPor lo visto se está poniendo de moda los servidores en el emule/amule que lo que hacen es convertir nuestras búsquedas infructuosas. Son servidores fakes puestos por empresas que se dedican a entorpecer el intercambio de archivos mediante P2P: no logras encontrar lo que buscas y llenan tus búsquedas de archivos inservibles.
La solución viene por una aplicación llamada Peerguardian. En este tutorial veremos cómo instalarlo y hacerlo funcionar en el inicio del sistema.
Instalación:
- Primero nos aseguramos que tenemos instalado el paquete libstdc++5. Para ello vamos al Gestos de Paquetes Sinaptic y lo instalamos.
- Nos bajamos el .deb de la siguiente dirección.
- Lo instalamos con sudo dpkg -i peerguardnf-1.5beta.i386.deb
Para hacer que se ejecute al inicio del sistema:
- sudo mkdir /etc/peerguardian
- sudo gedit /etc/init.d/peerguardian.sh
Y pegamos lo siguiente:
#########################################################
# version for bluetack.co.uk lists!
#!/bin/sh
# Update new blocklists and start/stop/restart PeerGuardian
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# testdescription
#
#CONFIGURATION
# Make sure PG_ETC points to the directory where
# you want to put your downloaded blocklists.
PG_ETC=/etc/peerguardian/
# Remove the lists you don’t want to download and
# use from BLOCKLISTS.
BLOCKLISTS=”level1″
PG_CONF=/etc/PG.conf
PG_LOG=/var/log/PG.log
PG_LIST=/etc/p2p.p2b.p2p
#The URL where the blocklists reside
URL=http://www.bluetack.co.uk/config
#The format of the lists to download
SUFFIX=gz
#The format after unpacking
SUFFIX2=txt
endscript () {
date +”———— “%F” “%X” “%Z” End PeerGuardian Script”
exit $1
}
date +”———— “%F” “%X” “%Z” Begin PeerGuardian $1″
case “$1″ in
’start’)
cd “$PG_ETC”
# check if blockfiles were updated:
UPDATED=”"
for i in $BLOCKLISTS ; do
TIMESTAMP=0
if [ -e $i.$SUFFIX ] ; then
TIMESTAMP=`stat –format=%y $i.$SUFFIX`
echo “File $i.$SUFFIX last updated $TIMESTAMP”
TIMESTAMP=`stat –format=%Y $i.$SUFFIX`
fi
wget -N $URL/$i.$SUFFIX
if [ `stat --format=%Y $i.$SUFFIX` -gt $TIMESTAMP ] ; then
UPDATED=$i
fi
done
# if none of the blockfiles were updated:
if [ -z $UPDATED ] ; then
echo “No blocklists needed updating.”
echo “Starting PeerGuardian”
mv $PG_LOG $PG_LOG.backup
peerguardnf -h -m -d -c “$PG_CONF” -l “$PG_LOG”
endscript 0
fi
# if any blockfiles were updated:
for i in $BLOCKLISTS ; do
gunzip -c $i.$SUFFIX > $i.$SUFFIX2
BLOCKLISTSCAT=”$BLOCKLISTSCAT $i.$SUFFIX2″
done
cat $BLOCKLISTSCAT | peerguardnf -f merged.p2b.p2p
for i in $BLOCKLISTS ; do
rm $i.$SUFFIX2
done
# uncomment below to unblock Yahoo! Mail and whatever
# else needs unblocking here. Do this also in the
# restart section.
grep -v -i “yahoo\!” merged.p2b.p2p | grep -v -i “Microsoft” | grep -v “Google” > merged.p2b.p2p.tmp
mv merged.p2b.p2p.tmp merged.p2b.p2p
mv $PG_LIST $PG_LIST.backup
mv merged.p2b.p2p $PG_LIST
mv $PG_LOG $PG_LOG.backup
echo “Starting PeerGuardian”
peerguardnf -h -m -d -c “$PG_CONF” -l “$PG_LOG”
endscript 0
;;
’stop’)
echo “Stopping PeerGuardian”
killall peerguardnf > /dev/null 2>&1
endscript 0
;;
‘restart’)
cd “$PG_ETC”
# check if blockfiles were updated:
UPDATED=”"
for i in $BLOCKLISTS ; do
TIMESTAMP=0
if [ -e $i.$SUFFIX ] ; then
TIMESTAMP=`stat –format=%y $i.$SUFFIX`
echo “File $i.$SUFFIX last updated $TIMESTAMP”
TIMESTAMP=`stat –format=%Y $i.$SUFFIX`
fi
wget -N $URL/$i.$SUFFIX
if [ `stat --format=%Y $i.$SUFFIX` -gt $TIMESTAMP ] ; then
UPDATED=$i
fi
done
# if none of the blockfiles were updated:
if [ -z $UPDATED ] ; then
echo “No blocklists needed updating.”
echo “Stopping PeerGuardian”
killall peerguardnf > /dev/null 2>&1
mv $PG_LOG $PG_LOG.backup
sleep 4
echo “Starting PeerGuardian”
peerguardnf -h -m -d -c “$PG_CONF” -l “$PG_LOG”
endscript 0
fi
# if any blockfiles were updated:
for i in $BLOCKLISTS ; do
gunzip -c $i.$SUFFIX > $i.$SUFFIX2
BLOCKLISTSCAT=”$BLOCKLISTSCAT $i.$SUFFIX2″
done
cat $BLOCKLISTSCAT | peerguardnf -f merged.p2b.p2p
for i in $BLOCKLISTS ; do
rm $i.$SUFFIX2
done
# uncomment below to unblock Yahoo! Mail and whatever
# else needs unblocking here. Do this also in the
# restart section.
grep -v -i “yahoo\!” merged.p2b.p2p | grep -v -i “Microsoft” | grep -v “Google” > merged.p2b.p2p.tmp
mv merged.p2b.p2p.tmp merged.p2b.p2p
echo “Stopping PeerGuardian”
killall peerguardnf > /dev/null 2>&1
mv $PG_LIST $PG_LIST.backup
mv merged.p2b.p2p $PG_LIST
mv $PG_LOG $PG_LOG.backup
sleep 4
echo “Starting PeerGuardian”
peerguardnf -h -m -d -c “$PG_CONF” -l “$PG_LOG”
endscript 0
;;
*)
echo “Usage: $0 { start | stop | restart }”
;;
esac
exit 0
#########################################################
- Le damos permisos de ejecución: sudo chmod -c 755 /etc/init.d/peerguardian.sh
- Lo añadimos al inicio: sudo update-rc.d peerguardian.sh defaults
Ahora ya se arranca al inicio, pero para pararlo, rearrancarlo,…
- sudo peerguardian.sh start
- sudo peerguardian.sh restart
- sudo peerguardian.sh stop
Para ver las IPs que bloquea, pararlo, rearrancarlo,… ponemos el comando pgtext en una terminal
y nos aparecerá un menú como este en el que podremos hacer modificaciones en la configuración y monitorear y ver los paquetes que va filtrando.
Si no filtra nada al de un rato, es raro. Aseguraros que si entrais con pgtext y luego en Edit blocklist, os salga algo similar a esto:
Este es el listado de IPs que filtra y está como véis en /etc/p2p.p2b.p2p. Como digo, aseguraros que no está en blanco.
Además, deberíais hacer lo siguiente para mayor seguridad de vuestra mulita:
1. Verificar el modo de actualización de la lista de servidores :
- preferencias
- carpeta servidores
- desactivar “Actualizar lista de servidores al conectar a un servidor”
- desactivar “Actualizar lista de servidores al conectar un cliente”
- activar “Auto-actualizar lista de servidores al iniciar”
- pulsar “Editar” y añadir en el fichero addresses.dat la dirección siguiente : “http://www.gruk.org/server.met.gz” (actualmente esta dirección no funciona, probar con esta otra http://corpo.free.fr/server.met http://www.emulespana.net/server.met) y cerrar el fichero.
- Obtener servidores de confianza:preferencias > Seguridad >Activar “Filtrar servidores” y en “Actualizar desde URL:” introducir el enlace siguiente: http://switch.dl.sourceforge.net/sourceforge/emulepawcio/ipfilter.dat .Pulsad “Cargar” y cerrad la ventana.
- Suprimir todos los servidores de vuestra lista: Carpeta servidores, seleccionarlos todos y suprimirlos
- Volver a arrancar la mulita
Espero que os sirva.
Un saludo,


















¡Genial! Arrastraba este problema desde hacía un tiempo y no sabía cómo solucionarlo. Ahora, perfecto. ¡Muchas gracias!
Gracias por comentar. Me agrada que te haya podido ayudar.
Un saludo,
Que tal GU?
Pues me he liado a instalar el peerguardian este y fijate
He llegado hasta que tengo que poner:
sudo peerguardian.sh start
y me dice command not found
y ahora no me arranca el ubuntu porque llega a una línea que me dice
/etc/rd2.d/S20peerguardian.sh: 157: restart: not faound
¿Qué estoy haciendo mal? ¿Cómo poder arrancar ahora en cristiano el ubuntu?
A ver si me hechas una mano
Thankx
Entiendo que lo que pasa es que has puesto el link pero no has instalado bien el peerguardian.
¿Has seguido bien los pasos?
El directorio /etc/rd2.d contiene los links simbólicos a los archivos que se ejecutan al entrar en Ubuntu (estos se encuentran en /etc/init.d/). Si está dando un error es porque no está bien instalado.
Yo intentaría eliminar /etc/rd2.d/S20peerguardian.sh. Primero arrancas y pulsas escape. Seleccionas modo recuperación y luego administrador.
Entra e intenta eliminar el link.
Ya me contarás.