jeudi 3 février 2011

WifiZoo

Introduction

Wifizoo est un outil de capture d'informations à partir de réseau wifi ouvert.

Configuration dans BT3 beta

Editez: /usr/local/etc/kismet.conf
ligne 27 : indiquez votre interface wifi. ex :
source = rt73,rausb0,Ralink
Lancez Kismet
kismet -x
Editez: /pentest/wireless/wifizoo/scapy.py
ligne 13215 : AJOUTEZ la ligne et indiquez votre interface wifi. ex :
conf.iface = 'rt73,rausb0,Ralink'
Editez: /pentest/wireless/wifizoo/wifizoo.py
ligne 49 : indiquez votre interface wifi. ex :
conf.iface = 'rausb0'
Ensuite il ne reste plus qu'à lancer wifizoo.py dans un shell.

Usage

Wifizoo en mode live

version 1.3 et 1.4

démarrage

placez vous dans le répertoire de wifizoo et tappez :
python wifizoo.py
Image:wifizoo1.jpg
Choix du mode Live ou Pcap
Image:wifizoo2.jpg
sélectionnez votre interface
Image:wifizoo3.jpg
Scan aléatoire ou fixé sur un seul channel
Image:wifizoo4.jpg
Choix de la bande (A/BG/ABG)
Image:wifizoo5.jpg
Choix du server local pour afficher le gui html : LO
Image:wifizoo6.jpg

Interface graphique

Nous allons utiliser les onglets pour accéder aux différents types d'information capturés (cookies, ftp data, etc...)
Image:wifizoo7.jpg
Exemple de capture de données ftp, ip, user pass :)
Image:wifizoo8.jpg
Exemple de captures de cookies, punbb et gmail :)
Image:wifizoo9.jpg
Cliquer sur le lien afin de forger le cookie
Image:wifizoo9b.jpg
Une fois le cookie forgé, il faut cliquer sur l'ip pour accéder à la page que la victime est en train de consulter
Image:wifizoo10.jpg
On arrive sur la page "d'accueil" et comme on l'a vu précédemment, la personne surfait sur gmail, donc on va cliquer sur gmail, logique.
Image:wifizoo11.jpg
Et voila, nous nous trouvons dans la session gmail.
Image:wifizoo12.jpg

Wifizoo en mode Pcap

ATTENTION : seulement disponible avec la version 1.4 (version 1.3 + patch)

Récuperation d'un fichier cap

Suite à un scan avec airodump, nous nous retrouvons avec un fichier cap. Au lieu de s'amuser à l'analyser avec wireshark pour en tirer des infos intéressantes, nous allons utiliser wifizoo qui va s'occuper de nous trouver le meilleur :)

Décryptage du fichier

Il peut arriver que notre fichier soit cryptà par une protection ultra résistante comme le WEP. Dans ce as nous allons utliser l'outil decrypt pour les décrypter.
dans un shell tappez :
bt wiscan # decrypt -p MA:KE:YW:EP:00 -m MA:ST:AT:IO:N! -e capture-01.cap -d capture.cap

démarrage

placez vous dans le répertoire de wifizoo et tapez :
python wifizoo.py
Image:wifizoo1.jpg
Choix du mode Live ou Pcap
Image:wifizoo1p.jpg
Entrez le chemin du fichier de capture
Image:wifizoo2p.jpg
Ca fonctionne
Image:wifizoo3p.jpg
Choix du server local pour afficher le gui html : LO
Image:wifizoo4p.jpg
On constate que les données sont bien interpretées
Image:wifizoo5p.jpg

Interface graphique

Nous allons utiliser les onglets pour accéder aux différents types d'information capturés (cookies, ftp data, etc...)
Image:wifizoo6p.jpg
Exemple de captures de cookies, punbb :) Cliquer sur le lien afin de forger le cookie
Image:wifizoo7p.jpg
Une fois le cookie forgé, il faut cliquer sur l'ip pour accéder à la page que la victime est en train de consulter
Image:wifizoo8p.jpg
Et voila, nous nous trouvons loggué dans la session de la victime.
Image:wifizoo9p.jpg

bonne capture

Image:wifizooEND.jpg

Vidéo

Wifizoo 1.3, vol de session gmail : http://backtrack-fr.net/test/wifizoo13.ogv

Liens externes 

Wifizoo 1.3, vol de session gmail : http://backtrack-fr.net/test/wifizoo13.ogv

 

Tuto Xplico internet decodeur

la première partie présente l'installation d'xplico et son web ui, la seconde partie montre son utilisation en live sur du Wep (video + texte); la troisième partie montre son utilisation réelle c'est à dire en forensics sur un fichier pcap (video + texte), et la partie 4 en cli.

Alors, Xplico permet quoi ? il permet d'avoir une vision "humaine" du contenu de votre pcap, si vous prenez wireshark, vous voyez trucs muche tcp icmp etc, vous pouvez extraire l'intégralité via follow tcp stream, mais pour une visualisation rapide du contenu cela n'est pas l'idéal.

C'est là qu'intervient xplico, il va permettre de voir directement les images videos etc.

Let's go on installe le cool tool, je pars sur une base ubuntu, mais pour les autres ca montre bien les dépendances et ne devrait pas poser de problèmes majeurs.


sudo su
#libpcap est nécessaire, mais on va foutre des trucs en plus pour les scripts.

apt-get install sqlite tcpdump tshark
libx11-dev libxt-dev libxi-dev apache2 php5 php5-sqlite build-essential perl zlib1g-dev libpcap-dev libsqlite0-dev libmysqlclient15-dev python2.5-minimal python2.5 python-all
#sqlite car il nous faut la version 2 d'sqlite + la lib-dev
#(nommé sqlite dans les dépots ubuntu)
#apache2 ca c'est pour la web ui (interface web) pas
#obigé php5-sqilte idem
#tcpdump tshark pour les scripts et de toute manière
#libpcap nécessaire (tshark peut ne pas etre utilisé ou rempacé
#par wireshark qui le contient)
#zlib1g ca c'est pour geoip
#libx* pour pcl6 (option)


cd /tmp
wget http://downloads.sourceforge.net/project/xplico/xplico/version%200.5.2/xplico-0.5.2.tgz

tar zxvf xplico-0.5.2.tgz
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gztar zxvf GeoIP-1.4.5.tar.gz
cd GeoIP-1.4.5
./configure
make
make install
rm -f *.tar.gz
cd /tmp/xplico
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gzip -d GeoLiteCity.dat.gz
rm -f *dat.gz
make
cd ..
wget http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/ghostpdl/ghostpdl-8.70.tar.bz2
tar jxvf ghostpdl-8.70.tar.bz2
#de ghostpcl on a juste besoin de pcl6 c'est necessaire pour "network printer job"
rm -f *.bz2
cd ghostpdl-8.70
make
#ca ca prend du temps...
cd ..
cp /tmp/ghostpdl-8.70/main/obj/pcl6 /tmp/xplico/
rm -rf
ghostpdl-8.70
cd /tmp/xplico
make install

#Ça c'était la part 1 de l'installation, maintenant on installe la web ui
#(interface web)

cd /var/www
wget http://downloads.sourceforge.net/project/xplico/xplico/version%200.5.2/xplico_interface-0.5.2.tgz
tar zxvf xplico_interface-0.5.2.tgz
rm -f *2.tgz

#le chmod recursif en 777 c'est si vous avez un problème d'accès,
#attention ca offre les droits max,
#lecture écriture exécution pour tous les fichiers groupes utilisateurs.

chmod -R 777 /gui.xplico.org

On continue ?
Ok il faut que l'interface web soit accessible pour apache avec toutes les options activées et allow override allow.

Pour plus de simplicité vous pouvez directement télécharger la conf (ca ne touche en rien apache, ça active tout pour xplico et uniquement xplico.

cd /etc/apache2/sites-enabled
wget http://bricowifi.free.fr/xplico

Ensuite dans /etc/apache2/ports.conf vous devez ajouter xplico et son port
Voici un extrait du mien avec l'ajout en rouge:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
# xplico Host port
NameVirtualHost *:9876
Listen 9876
NameVirtualHost *:80
Listen 80

Il faut aussi éditer php.ini pour le down, l'upload max:

nano /etc/php5/apache2/php.ini

post_max_size = 100M

upload_max_filesize = 100M

On oublie pas d'activer le mode rewrite sur apache !!!!
a2enmod rewrite

Terminé, on relance apache:
/etc/init.d/apache2 restart

///////////////Pour le tutoriel d'instalation c'est terminé///////////// ouf... (merci de préciser si y a une coquille)

  • Phase 2 Demo live Wep sniffing avec airodump-ng et airtun-ng; décodage avec Xplico


Détail des commandes:

airmon-ng
airmon-ng start wlan1
airodump-ng -w /root/Bureau/s -c 11 --bssid 00:11:22:33:44:55 mon0

(airmon-ng pour passer a carte en monitor)
(airodump-ng pour enregistrer; -w "écrire" -c "canal" --bssid "@ mac de l'ap")

|-------------------------------------------------------------------

|--[3] Launch airtun-ng with the Wep key and mount your tun/tap at0

airtun-ng -a 00:11:22:33:44:55 -w 55:44:33:22:11 mon0
ifconfig at0 up

(airtun-ng -a "@mac ap" -w "clé wep" interface wifi)

|-------------------------------------------------------------------

|--[4] Hack Xplico

| a] enlevez /opt/xplico/xplico.db
| b] enlevez tous /opt/xplico/pol
| c] exec:
| cd /opt/xplico/script/db/sqlite2
| ./create_xplico_db.sh
| d] avec la web ui, réalisez une seul case
| c] dans cette case créez seulement une session d'écoute (sol) listening sessions
| ici /opt/xplico/script vous trouverez
| rt_demo.sh. éditez l'interface par la votre



cd /opt/xplico/script/ && ./sqlite_demo.sh
|#abort

|-------------------------------------------------------------------

|--[5] Run Xplico in live, 1337

cd /opt/xplico/script/ && ./rt_demo.sh


  • Phase 3 demo forensics sur un pcap avec xplico, airdecap-ng pour decrypter le Wep et décoder son contenu


Détail des commandes:

|--[1] First decrypt your wep packet

airdecap-ng -w 55:44:33:22:11 s-01.cap

(airdecap-ng -w "clé wep" "emplacement pcap"

|-------------------------------------------------------------------

|--[2] Run Xplico demo sqlite

cd /opt/xplico/script/ && ./sqlite_demo.sh

|-------------------------------------------------------------------

|--[3] Jump to the web ui, create case & sol, upload your pcap (*dec*)
http://127.0.0.1:9876
  • Phase 4 Xplico en cli (sans l'interface web)
On se place dans notre répertoire de binaire:

./xplico -m pcap -f s-01.cap

pour un dossier de pcap:

./xplico -m pcap -d ~/wardrive/

En temps reel sur eth0:

./xplico -m rltm -i eth0

Voila qui boucle le tuto sur xplico, site web: xplico


Troubleshotings : 

Activate the verbose mode. So, edit /opt/xplico/xi/app/config/core.php, look for

Code:
        Configure::write('debug', 0);

and change the value for '2'. Reload the web and tell us what outputs.


Installing THC-Hydra6.1 on Ubuntu 10.10 (Maverick Meerkat) with SSL support

Wikipedia describes THC-Hydra as “… software … that uses a dictionary attack to test for weak or simple passwords on one or many remote hosts running a variety of different services.” Its useful for doing quick tests against your servers to make sure that your users are not using simple passwords. In pen tester speak, this is called a brute-force attack.
Here are the steps needed for installing it on the 32-bit version of Ubuntu 10.10 (Maverick Meerkat).
Make sure you have all the necessary development tools (i.e. libraries, compilers, headers) and the source files for GTK:

sudo apt-get install build-essential linux-headers-$(uname -r) libgtk2.0-dev libssl-dev cmake

Before we compile Hydra, we need to install libssh. For some odd reason, hydra does not like the libssh-dev package that comes with Ubuntu.

wget -c http://www.libssh.org/files/0.4/libssh-0.4.6.tar.gz
tar -xvzf libssh-0.4.6.tar.gz
cd libssh-0.4.6
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
make
sudo make install
cd ../..
 
Download and extract the THC-Hydra tarball
 
wget -c http://edwincastillo.com/wp-content/uploads/2010/12/hydra-6.1-src.tar.gz
tar -xvzf hydra-6.1-src.tar.gz
cd hydra-6.1-src
 
Now you are ready to compile:
./configure
make
sudo make install
 
You are now ready to use Hydra. Type ./hydra -h to get syntax help. The GUI version can be started by running xhydra.
If you have a GMail account with IMAP enabled, you can use the following example to test hydra:
 
hydra -S -l email@gmail.com -p your_password -V imap.gmail.com imap

 
 

jeudi 27 janvier 2011

Problèmes de signature de paquets / Ubuntu / APT

Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY 8771ADB0816950D8


Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY 386400DFB4C4219E

Solution :

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8771ADB0816950D8

jeudi 20 janvier 2011

Capturing with dumpcap for viewing with Wireshark

Dumpcap is a network traffic dump tool. It captures packet data from a live network and writes the packets to a file. Dumpcap's native capture file format is libpcap format, which is also the format used by Wireshark, tcpdump and various other tools.
Without any options set it will use the pcap library to capture traffic from the first available network interface and write the received raw packet data, along with the packets' time stamps into a libpcap file.
Packet capturing is performed with the pcap library. The capture filter syntax follows the rules of the pcap library.



Example  Help information available from dumpcap
dumpcap -h
Dumpcap 1.4.0
Capture network packets and dump them into a libpcap file.
See http://www.wireshark.org for more information.

Usage: dumpcap [options] ...

Capture interface:
  -i <interface>           name or idx of interface (def: first non-loopback)
  -f <capture filter>      packet filter in libpcap filter syntax
  -s <snaplen>             packet snapshot length (def: 65535)
  -p                       don't capture in promiscuous mode
  -B <buffer size>         size of kernel buffer (def: 1MB)
  -y <link type>           link layer type (def: first appropriate)
  -D                       print list of interfaces and exit
  -L                       print list of link-layer types of iface and exit
  -S                       print statistics for each interface once every second
  -M                       for -D, -L, and -S produce machine-readable output

Stop conditions:
  -c <packet count>        stop after n packets (def: infinite)
  -a <autostop cond.> ...  duration:NUM - stop after NUM seconds
                           filesize:NUM - stop this file after NUM KB
                              files:NUM - stop after NUM files
Output (files):
  -w <filename>            name of file to save (def: tempfile)
  -b <ringbuffer opt.> ... duration:NUM - switch to next file after NUM secs
                           filesize:NUM - switch to next file after NUM KB
                              files:NUM - ringbuffer: replace after NUM files
  -n                       use pcapng format instead of pcap
Miscellaneous:
  -q                       don't report packet capture counts
  -v                       print version information and exit
  -h                       display this help and exit

Example: dumpcap -i eth0 -a duration:60 -w output.pcap
"Capture network packets from interface eth0 until 60s passed into output.pcap"

Use Ctrl-C to stop capturing at any time.
      

Capturing with tcpdump for viewing with Wireshark

There are occasions when you want to capture packets using tcpdump rather than wireshark, especially when you want to do a remote capture and do not want the network load associated with running Wireshark remotely (not to mention all the X traffic polluting your capture).
However, the default tcpdump parameters result in a capture file where each packet is truncated, because most versions of tcpdump, will, by default, only capture the first 68 or 96 bytes of each packet.
To ensure that you capture complete packets, use the following command:
 
tcpdump -i <interface> -s 65535 -w <some-file>
      
You will have to specify the correct interface and the name of a file to save into. In addition, you will have to terminate the capture with ^C when you believe you have captured enough packets.
[Note]Note!
tcpdump is not part of the Wireshark distribution. You can get it from: http://www.tcpdump.org for various platforms.

mardi 11 janvier 2011

Mediaroom Troubleshooting Tools: Client Trace Log Viewer

Mediaroom Troubleshooting Tools: Client Trace Log Viewer



Microsoft MediaroomDuring my previous blog posts we have discussed what Microsoft Mediaroom is and some of its features which help differentiate it from standard television providers. In my next set of posts we’ll discuss some of the tools that Mediaroom support personnel can use to troubleshoot various aspects of the Mediaroom environment. Over the last couple of months, I’ve had occasion to work with a customer that is new to the Mediaroom environment, and the one tool that we are constantly using is called the Client Trace Log Viewer, so I figured it would be a great place to start our Mediaroom tools discussions.
Often times, we are asked to investigate why end user set top boxes (STBs) are not performing as expected; slow performance, missing guide information, VOD playback, etc. All of these issues are visible to the end users eye but are hard to quantify without any real data from the components themselves, this is where the Client Trace Log Viewer (CTL Viewer) comes into play. In the next couple of sections we’ll discuss CTLs features and how to configure, view, and filter the captured events.

Features

The CTL Viewer allows support personnel to gather real-time debugging information from any STB in the Mediaroom environment. We can easily enable CTL viewing on any specific STB we choose. This ability to drill down to individual devices is particularly useful as often times end users have multiple units. Once CTL viewing is enabled, it changes the logging state of the STB and tells the device to start collecting trace logging of the actions it performs and to pass this information to the Mediaroom servers. Nothing is physically connected to the STB nor is there any additional tracing software needed (all logging is implemented server-side). This means that the operator can have multiple sinks and filters running without fear of performance impact.

Configuring Client Trace Log Viewer

The first step is to configure the CTL Viewer (generally the executable will be located in the Mediaroom Resource Kit)
  1. Run ClientTraceLogViewer.exe
  2. Select Connection > Open Serverlayout
  3. Navigate to the serverlayout.xml file (the path C:\Program Files\Microsoft IPTV Services\config\serverLayout.xml)
Mediaroom Client Trace Event Viewer

Enabling Logging

  1. From the Menu bar, select Connection > Set Client Log State
  2. You uniquely identify the STB using the external client ID. This information can found in the Branch SMT
  3. Select the length of time for the STB to log
  4. Click “Client Filter”. You can set up your filters based on the type of event as well as the severity of the event
  5. Click OK twice. Now select the “Start Retrieving Events” icon. The STB will begin logging the events and push them forward to the server
Mediaroom STB Logging Settings
6. To stop logging, select the “Stop Retrieving Events” icon from the Menu bar.
7. If you wish to save the events for future viewing, click the Save button from the Menu bar

Viewing Events

  1. If you saved the events as per Step 7 above, they can be viewed as a text file. Otherwise you can use the CTL Viewer to review the events captured
  2. Select Events > Retrieve Events
  3. Ensure the information in the Connect dialog box is correct and select OK
  4. If you wish to further filter the information, choose View > Options
  5. Select the Filters tab, filter based upon your needs
  6. In the CTL Viewer, all information in the left pane represents Web Service calls and TV2 events. The right pane is for logging message. If you select an individual message, the details will be presented Details pane in the bottom third of the viewer
Hopefully this overview gives you at least a basic understanding of the Client Trace Log Viewer and its usage. In the following months we’ll continue to investigate more troubleshooting tools and how they relate to Mediaroom. If you wish to learn more about the Mediaroom platform, please visit http://www.microsoft.com/Mediaroom/

Thansk to  Warren Johns from http://www.opsvault.com/mediaroom-troubleshooting-tools-client-trace-log-viewer/