05/02/2012

plugin en python para xchat : whois automatico

Un poco de código, es un script para xchat que hace que al momento de abrir un privado automáticamente muestra la información "whois" de la persona con quien se esta chateando. El script es muy simple y me sirve para encontrar otros canales que quizas puedan interesarme en Freenode. Lo he programado en ubuntu 11.10 y xchat 2.8.8.

Para mayor informacion de como extender las funcionalidades de xchat:
http://xchat.org/docs/ 


'''
Created on 04/02/2012
querywhois.py
@author: christian
cquispe.dev@gmail.com
'''
__module_name__ = "querywhois"
__module_version__ = "1.0"
__module_description__ = "muestra la informacion de whois del otro usuario cuando se abre o recibe un mensaje privado. Probado en xchat 2.8.8"
__module_author__ = "Christian "

import xchat #@UnresolvedImport

def mensaje_nuevo(word, word_eol, userdata):
    cntx = xchat.get_context()
    user = cntx.get_info("channel")
    if user[0] != "#":
        cntx.command("whois " + user)
    return xchat.EAT_NONE

def whois_info(word, word_eol, userdata):
    #print word
    cntx = xchat.find_context(channel = word[0])
    if cntx is None:
        #para cuando se hace whois sin abrir privado, lo envia a la salida normal
        cntx = xchat.get_context()
    cntx.prnt(" ".join(word))
    return xchat.EAT_XCHAT

#capturamos todos los eventos de whois 
WHOIS_EVENTS = [
                "WhoIs Authenticated",
                "WhoIs Away Line",
                "WhoIs Channel/Oper Line",
                "WhoIs End",
                "WhoIs Identified",
                "WhoIs Idle Line",
                "WhoIs Idle Line with Signon",
                "WhoIs Name Line",
                "WhoIs Real Host",
                "WhoIs Server Line",
                "WhoIs Special"
              ]
for whois_event in WHOIS_EVENTS:
    xchat.hook_print(whois_event, whois_info)

# xchat.hook_print("WhoIs Channel/Oper Line", whois_info)
# xchat.hook_print("WhoIs Authenticated", whois_info)
# xchat.hook_print("WhoIs Away Line", whois_info)
# xchat.hook_print("WhoIs End", whois_info)
# xchat.hook_print("WhoIs Identified", whois_info)
# xchat.hook_print("WhoIs Idle Line with Signon", whois_info)
# xchat.hook_print("WhoIs Idle Line", whois_info)
# xchat.hook_print("WhoIs Name Line", whois_info)
# xchat.hook_print("WhoIs Real Host", whois_info)
# xchat.hook_print("WhoIs Server Line", whois_info)
# xchat.hook_print("WhoIs Special", whois_info)

#captura los eventos de creacion de ventana, cuando se hace abre o recibe un privado
#Open Context esta mencionado en la documentacion de plugin de C++ pero no en la de python
xchat.hook_print("Open Context", mensaje_nuevo)

print "querywhois loaded"

07/08/2009

GNS3/Linux: Creando una VPN site to site usando CLI

Topologia:



R0
interface FastEthernet0/0
 ip address 192.168.169.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.2 255.255.255.0
 duplex auto
 speed auto

router rip
 network 192.168.1.0
 network 192.168.169.0

line con 0
 logging synchronous

R1
crypto isakmp policy 1
 encr aes
 authentication pre-share
 group 2
crypto isakmp key s3cr3t address 192.168.1.1
!
!
crypto ipsec transform-set TRANSFORM_VPN_TEST esp-aes esp-sha-hmac
!
crypto map VPN_R1_TO_R2 10 ipsec-isakmp
 set peer 192.168.1.1
 set transform-set TRANSFORM_VPN_TEST
 match address 101

interface FastEthernet0/0
 ip address 10.10.2.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.169.1 255.255.255.0
 duplex auto
 speed auto
 crypto map VPN_R1_TO_R2
!
router rip
 network 192.168.169.0

ip route 10.10.3.0 255.255.255.0 192.168.1.1
access-list 101 permit ip 10.10.2.0 0.0.0.255 10.10.3.0 0.0.0.255
line con 0
 logging synchronous

R2
!
crypto isakmp policy 1
 encr aes
 authentication pre-share
 group 2
crypto isakmp key s3cr3t address 192.168.169.1
!
!
crypto ipsec transform-set TRANSFORM_VPN_TEST esp-aes esp-sha-hmac
!
crypto map VPN_R2_TO_R1 10 ipsec-isakmp
 set peer 192.168.169.1
 set transform-set TRANSFORM_VPN_TEST
 match address 101

interface FastEthernet0/0
 ip address 10.10.3.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
 crypto map VPN_R2_TO_R1
!
router rip
 network 192.168.1.0

ip route 10.10.2.0 255.255.255.0 192.168.169.1
access-list 101 permit ip 10.10.3.0 0.0.0.255 10.10.2.0 0.0.0.255
line con 0
 logging synchronous

01/08/2009

GNS3/Linux: Instalacion de Cisco SDM desde Linux

Estar familiarizado con el uso del Cisco SDM (Security Device Manager) es necesario para rendir el examen 640-553 CCNA Security. Instalarlo desde windows es relativamente sencillo ya que dispone de un instalador. Sin embargo, desde Linux no lo es tanto; estos son los pasos que segui para instalarlo usando GNS3.


Creamos la Interfaz tap0 y le asignamos una direccion IP
tunctl
ifconfig tap0 10.10.2.2 netmask 255.255.255.0 up

Descargamos una version de java antigua

http://java.sun.com/products/archive/

Instalamos un servidor tftp
aptitude install atftpd

Descargamos el SDM v2.5 y copiamoslos siguientes archivos a /var/lib/tftpboot

cp 128MB.sdf /var/lib/tftpboot
cp attack-drop.sdf /var/lib/tftpboot
cp es.tar /var/lib/tftpboot
cp home.tar /var/lib/tftpboot
cp sdm.tar /var/lib/tftpboot
cp sslclient-win-1.1.4.176.pkg /var/lib/tftpboot
cp 256MB.sdf /var/lib/tftpboot
cp common.tar /var/lib/tftpboot
cp home.shtml /var/lib/tftpboot
cp sdmconfig-36xx-37xx.cfg /var/lib/tftpboot
cp securedesktop-ios-3.1.1.45-k9.pkg /var/lib/tftpboot
cp wlanui.tar /var/lib/tftpboot

Iniciamos elgns3 y abrimos una consola:

Formateamos la flash:

Router#erase flash:
Router#format flash:
Router#conf t

Logging syncronizado

Router(config)#hostname R0
R0(config)#line console 0
R0(config-line)#logging synchronous
R0(config-line)#exit
R0(config)#end

Habilitamos ssh

R0(config)#ip domain-name ccnasec
R0(config)#crypto key generate rsa general-keys modulus 1024

Habilitamos el servidor https

R0(config)#ip http server
R0(config)#ip http secure-server
R0(config)#ip http authentication local
R0(config)#ip http timeout-policy idle 600 life 86400 requests 10000
R0(config)#username cquispe privilege 15 secret 0 cquispe
R0(config)#do wr

Habilitamos el acceso mediante vty

R0(config)# line vty 0 4
R0(config-line)# privilege level 15
R0(config-line)# login local
R0(config-line)# transport input telnet ssh
R0(config-line)# end
R0#wr

Configuramos la interfaz

R0(config)#int fa0/0
R0(config-if)#ip addr 10.10.2.3 255.255.255.0
R0(config-if)#no shu

Copiamos los archivos del sdm a la memoria flash del router

R0#copy tftp://10.10.2.2:/128MB.sdf flash:
R0#copy tftp://10.10.2.2:/attack-drop.sdf flash:
R0#copy tftp://10.10.2.2:/es.tar flash:
R0#copy tftp://10.10.2.2:/home.tar flash:
R0#copy tftp://10.10.2.2:/sdm.tar flash:
R0#copy tftp://10.10.2.2:/sslclient-win-1.1.4.176.pkg flash:
R0#copy tftp://10.10.2.2:/256MB.sdf flash:
R0#copy tftp://10.10.2.2:/common.tar flash:
R0#copy tftp://10.10.2.2:/home.shtml flash:
R0#copy tftp://10.10.2.2:/sdmconfig-36xx-37xx.cfg flash:
R0#copy tftp://10.10.2.2:/securedesktop-ios-3.1.1.45-k9.pkg flash:
R0#copy tftp://10.10.2.2:/wlanui.tar flash:

Abrimos el navegador en https://10.10.2.3

 
Cargando el SDM
  
Login
  
Aceptamos
Cargando la interfaz
La interfaz del SDM

24/07/2009

Enlaces utiles para el CCNA Security

El libro oficial, me a gustado bastante y el cdrom viene con un banco de preguntas:
http://www.amazon.com/Security-Official-Certification-Guide-640-553/dp/1587202204

Videos recomendados, requiere registrarse pero es gratuito:
https://cisco.hosted.jivesoftware.com/community/certifications/security_ccna/iins?tab=studylearn

13/06/2009

Enlaces utiles para el CCNA

Bueno, despues de enterarme que habia quienes me leian !! ( jejeej) .. y respondiendo al pedido de uno de ellos por material para el examen CCNA, empezare a publicar enlaces, articulos y tutoriales sobre algunos de los temas que se incluyen en la curricula para obtener esta certificacion. En un post diferente tambien empezare a poner enlaces para el CCNA Security, una de las certificaciones que tengo como objetivo conseguir este año, aparte del BSCI.

Frame Relay:
http://www.cisco.com/en/US/tech/tk713/tk237/technologies_tech_note09186a008014f8a7.shtml

11/06/2009

Estudiando para el BSCI

Aqui estare posteando los links que considere utiles para rendir el examen 640-901 (BSCI)

Cisco Enterprise Architecture, IIN y SONA
http://www.cisco.com/web/about/ciscoitatwork/network_systems/cisco_sona_and_unified_comm_web.html
http://www.cisco.com/web/about/ciscoitatwork/downloads/ciscoitatwork/pdf/Cisco_IT_Case_Study_SONA.pdf
http://www.ciscopress.com/articles/article.asp?p=1073230
http://www.cisco.com/web/about/ciscoitatwork/downloads/ciscoitatwork/pdf/Cisco_IT_Case_Study_SONA_UC.pdf
http://www.cisco.com/en/US/solutions/collateral/ns340/ns629/sonaTOGAFwp072308.pdf


BGP
http://lacnic.net/documentos/lacnicxii/presentaciones/08_bgp.pdf
http://lacnic.net/documentos/lacnicxii/presentaciones/10_Seguridad_en_BGP.pdf

IPv6
http://www.6deploy.eu/e-learning/english/