30 nov 2008

Escribiendo una presentacion con latex beamer

Para crear la presentacion usé como entorno de desarrollo a Kile, un editor de latex que se incluye en Kde, estuve usando lynx pero kile me pareció mas flexible.

Aqui les dejo el enlace a una presentacion hecha usando latex-beamer y aqui el codigo latex.
archivo pdf
codigo latex con las imagenes

Este es el codigo fuente:
\documentclass[12pt,t]{beamer}
%CambridgeUS,Madrid,AnnArbor,Rochester
%usar \' para tildes y \~ para la eñe, por la laptop teclado ingles :(
\usetheme{CambridgeUS}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}

%
%Incidir seguridad y tecnologías inalámbricas, 
%dejar preguntas para voip linux
%

\title[II Charla Telecomunicaciones]{Software Libre aplicada en el Campo de las Telecomunicaciones}
\subtitle{II Charlas de Telecomunicaciones ComSoc-UNI}
\author[Christian Quispe]{Christian Quispe Quispe \\ \texttt{ christian.quispe@ieee.org}}
\institute[UNI]{Universidad Nacional de Ingeniería}
\date{29 de Noviembre del 2008}

\begin{document}
\pgfdeclareimage[width=180pt,height=20pt]{test}{images/header.jpg}
\logo{\pgfuseimage{test}}

    \begin{frame}
        \titlepage
        %\includegraphics[width=45pt,height=50pt]{images/logo_debian.png}
        %\begin{figure}
        %\begin{center}
         %\includegraphics[width=300pt,height=40pt]{images/header.jpg}
         %\includegraphics[width=45pt,height=50pt]{images/header.jpg}
        %\end{center}
        %\end{figure}
    \end{frame}

    \begin{frame}
        \frametitle{Agenda}
        \tableofcontents
    \end{frame}

 \section{Introduccion}
  \begin{frame}
   \frametitle{Introduccion}
   \begin{alertblock}{Aclaraci\'on...} 
    En esta charla usaremos el termino linux para referirnos al sistema
    operativo en su totalidad GNU/Linux
   \end{alertblock}
   \begin{figure}
    %\begin{center}
    \includegraphics[width=300pt,height=133pt]{images/gnulinux.jpg}
    %\end{center}
   \end{figure}
  \end{frame}

 \section{Servidores y Gestion de Redes}
  \begin{frame}
   \frametitle{Servidores}
   Soporta multiples servicios tales como:
   \begin{columns}
    \begin{column}{5cm}
     \begin{itemize}
      \item Apache
      \item DNS
      \item DHCP
      \item OpenSSH
      \item SQuid
     \end{itemize} 
    \end{column}
    
    \begin{column}{5cm}
     \begin{itemize}
      \item OpenNMS
      \item MRTG
      \item Nagios
      \item Cacti
     \end{itemize} 
    \end{column}
   \end{columns}
  \end{frame}
  \begin{frame}
   \frametitle{Podemos instalar Linux en cualquier lugar de nuestras redes}
   \begin{figure}
    %\begin{center}
    \includegraphics[width=288pt,height=183pt]{images/red_linux.png}
    \vspace*{-1cm}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{Apache}
   Servidor web ampliamente usado
   \begin{figure}
    %\begin{center}
    \includegraphics[width=238pt,height=133pt]{images/apache.png}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{DNS}
   Resolucion de nombres
   \begin{figure}
    %\begin{center}
    \includegraphics[width=238pt,height=133pt]{images/dns.png}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{DHCP}
   Asigna dinamicamente IP a host
   \begin{figure}
    %\begin{center}
    \includegraphics[height=183pt]{images/dhcp.png}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{OpenSSH}
   Acceso remoto seguro
   \begin{figure}
    %\begin{center}
    \includegraphics[width=188pt,height=133pt]{images/ssh.png}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{Squid}
   Proxy Cache
   \begin{figure}
    %\begin{center}
    \includegraphics[width=188pt,height=133pt]{images/proxy.png}
    %\end{center}
   \end{figure}
  \end{frame}
 
 \section{VoIP}
  \begin{frame}
   \frametitle{VoIP}
   Voz sobre IP con linux IAX, SIP:
   \begin{itemize}
    \item Asterisk
    \item Freeswitch
    \item Gnu Gatekeeper
    \item OpenSER
   \end{itemize}
  \end{frame}
  \begin{frame}
   \frametitle{El mas conocido, pero no el unico: Asterisk}
   \begin{figure}
    %\begin{center}
    \includegraphics[width=288pt,height=183pt]{images/asterisk.jpg}
    \vspace*{-1cm}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{VoIP}
   
   Es el tema de proxima semana, los esperamos ;)
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=208pt,height=183pt]{images/expocomsoc.png}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
 \section{Seguridad}
  \begin{frame}
   \frametitle{Seguridad}
   Una de las herramientas mas empleadas:
   \begin{itemize}
    \item Wireshark
    \item Nmap
    \item Iptables
   \end{itemize}
  \end{frame}
  \begin{frame}
   \frametitle{Wireshark}
   Analisis de trafico
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=183pt]{images/wireshark.png}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{Nmap}
   Descubrimiento de puertos
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=183pt]{images/nmap.png}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{Iptables}
   Filtrado de paquetes
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=183pt]{images/iptables.jpg}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}

 \section{Simulacion de Redes}
  \begin{frame}
   \frametitle{Simuladores de Redes}
   \begin{itemize}
    \item ns-2
    \item ns-3
    \item nistnet
   \end{itemize}
  \end{frame}
  \begin{frame}
   \frametitle{ns-2}
   Simulacion de redes 2:\\
   Escrito en C++ y Otcl
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=238pt,height=133pt]{images/ns2.jpg}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{ns-3}
   Simulacion de redes 3\\
   Escrito en C++, soporte para python
  \end{frame}
  \begin{frame}
   \frametitle{nistnet}
   Desarrollado como m\'odulo para el kernel externo. Permite emular un amplio rango de de condiciones de red, performance, congeti\'on, etc.
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=133pt]{images/nisnet.jpg}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}

 \section{Finalmente}
  \begin{frame}
   \frametitle{Finalmente}
   ¿Donde encontramos a Linux?
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=158pt,height=103pt]{images/tux_preguntas.png}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{En casa}
   Routers con BusyBox 
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=183pt]{images/router.jpg}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{Inalambricos}
   DD-WRT Lynksys
   \begin{figure}
    %\begin{center}
    \includegraphics[width=70pt,height=50pt]{images/ddwrt.png}
    \includegraphics[width=208pt,height=133pt]{images/WRT54GL.jpg}
    %\end{center}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{celulares}
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=183pt]{images/movil.jpg}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
  \begin{frame}
   \frametitle{Clusters}
   \begin{figure}
    %\begin{left}
    %\left(
    \includegraphics[width=288pt,height=183pt]{images/top500.png}
    %\vspace*{-1cm}
    %\end{left}
   \end{figure}
  \end{frame}
 \section{Enlaces \'utiles}
  \begin{frame}[allowframebreaks]{Enlaces \'utiles}
   \begin{thebibliography}{2}
    \beamertemplatebookbibitems
    \bibitem{}Debian
    \newblock \emph{http://www.debian.org}
    \bibitem{}Documentacion en Ingles
    \newblock \emph{http://tldp.org/}
    \bibitem{}Documentacion en Español
    \newblock \emph{http://es.tldp.org/}
    \bibitem{}Documentacion Debian
    \newblock \emph{http://www.debian.org/doc/index.es.html}
    \bibitem{}NS 2
    \newblock \emph{http://nsnam.isi.edu/nsnam/index.php/User\_{}Information}
    \bibitem{}NS 3
    \newblock \emph{http://www.nsnam.org/}
    \bibitem{}Nistnet
    \newblock \emph{http://snad.ncsl.nist.gov/nistnet/}
    \bibitem{}Instalaci\'on de Nistnet es espa\~nol
    \newblock \emph{http://www.etl.it.uc3m.es/Instalaci\'on\_{}NIST\_{}Net}
    \bibitem{}Scientific Linux
    \newblock \emph{https://www.scientificlinux.org/}
    \bibitem{}Top 100 Network Security Tools
    \newblock \emph{http://sectools.org/}
    \bibitem{}TOP500 Project
    \newblock \emph{http://www.top500.org}
    \bibitem{}DD WRT Spported Devices
    \newblock \emph{http://www.dd-wrt.com/wiki/index.php/Supported\_{}Devices}
    \bibitem{}BusyBox products
    \newblock \emph{http://www.busybox.net/products.html}
    \bibitem{}C\'odigo fuente del DSL 320T
    \newblock \emph{ftp://ftp.dlink.co.uk/dsl\_{}routers\_{}modems/dsl\-{}320t/gpl\_{}source\_{}code/}
     \bibitem{}Linux Devices
    \newblock \emph{http://www.linuxdevices.com/}
    \bibitem{}Gnome Mobile
    \newblock \emph{http://www.gnome.org/mobile/}
    \bibitem{}Moblin
    \newblock \emph{http://moblin.org/node/179}
    \bibitem{}OpenMoko
    \newblock \emph{http://wiki.openmoko.org/wiki/Main\_{}Page}
    \bibitem{}Grupo de Usuarios de Linux Peru PLUG
    \newblock \emph{http://www.linux.org.pe/}
    \bibitem{}Debian Peru
    \newblock \emph{http://www.debianperu.org/}
   \end{thebibliography}
  \end{frame}

  \begin{frame}
   \frametitle{Antes de Terminar}
   \begin{alertblock}{Grupo de Linux} 
    Estan invitados a integrarse a nuestra lista
    \href{http://groups.google.com/group/reieee_linux}{http://groups.google.com/group/reieee\_{}linux}
    \href{mailto:reieee_linux@googlegroups.com}{reieee\_{}linux@googlegroups.com}
   \end{alertblock}
   \begin{center}
   \emph{¿Preguntas?} 
   \end{center}
  \end{frame}
  
  \begin{frame}
   \frametitle{Gracias por su atencion}
   %\titlepage
   \begin{figure}
    %\begin{center}
    \includegraphics[width=250pt,height=150pt]{images/grupo_linux.jpg}
    %\end{center}
   \end{figure}
  \end{frame}

\end{document}

21 nov 2008

Virtualizacion con KVM y virt-manager

Debemos asegurarnos si nuestra cpu soporta virtualizacion:
Intel CPUs:
cat /proc/cpuinfo | grep vmx
AMD CPUs:
cat /proc/cpuinfo | grep svm
Hay que entrar al BIOS de la PC y activar el soporte de virtualizacion.
Luego instalar
aptitude install virt-manager libvirt-bin kvm
Ejecutamos la herramienta grafica
virt-manager
Luego vamos a Archivo-->Abrir conexion

Y configuramos una maquina virtual para OpenBSD por ejemplo:

 
  
  
  
  
  
  
  
  
Yluego seguir el procedimiento de instalacion y einstalar el SO de manera normal
 


Y configuramos una maquina virtual

PD: En el ejemplo de OpenBSD hay que hacer unos trucos para que no aparesca el mensaje "watchdog timeout."
editamos /etc/libvirt/qemu/OpenBSD.xm y agregamos la linea model
<interface type='bridge'>
      <mac address='00:16:36:54:60:ed'/>
      <source bridge='br0'/>
      <model type='e1000'/>
    </interface>

Apagar la maquina virtual OpenBSD, aun no me funciona el apagado via ACPI:
halt -p
En un terminal hacer lo siguiente:
cd /etc/libvirt/qemu
virsh --connect qemu:///system
define OpenBSD.xml
start OpenBSD

16 nov 2008

Configuracion de ssmtp con gmail

aptitude install ssmtp

vi /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
root=usuario@gmail.com

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
#hostname=host.localdomain
hostname=usuario@gmail.com

UseTLS=YES
UseSTARTTLS=YES
AuthUser=usuario
AuthPass=password

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=NO
FromLineOverride=YES


vi /etc/ssmtp/revaliases
 # sSMTP aliases
#
# Format:   local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:usuario@gmail.com:smtp.gmail.com:587

13 nov 2008

Configuracion de Ruby para ejecutar Metasploit framework

Porque instalar a partir de codigo fuente y no a traves de los paquetes de la distribucion?
La distribucion que uso (Debian SID), viene con la version 1.8.7.72, la cual tiene varios problemas, tal como aparece en la imagen:
Una opcion es usar la version 1.8.6 que no esta disponible en debian sid o usar el ultimo snapshot stable, esto ultimo es lo que haremos:
Creamos nuestro directorio de trabajo
mkdir src
cd src
Instalamos las librerias necesarias para compilar ruby
apt-get build-dep ruby
apt-get build-dep gems

Descargar el metasploit framework
Bajamos la version en desarrollo, se va actualizando casi a diario
svn co http://metasploit.com/svn/framework3/trunk/ metasploit
Instalacion de Ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
tar zxvf stable-snapshot.tar.gz
cd ruby
./configure --prefix=/opt/ruby
make
make test
make install
cd ..
rubygems
http://rubyforge.org/projects/rubygems/
tar zxvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
export PATH=/opt/ruby/bin:$PATH
export GEM_HOME=/opt/ruby/lib/ruby/gems/1.8
export RUBYLIB=/opt/ruby/lib/ruby:/opt/ruby/lib/ruby/site_ruby/1.8:/opt/ruby/lib
/opt/ruby/bin/ruby setup.rb all --prefix=/opt/ruby
cd ..
Ejecutando Metasploit
Podemos usarlo desde el navegador:
cd metasploit
./msfweb
Luego, abrimos el explorador en http://127.0.0.1:55555/
Tambien podemos ejecutarlo en el terminal
./msfcli
enjoy !!!