Tag Archives: Scan

Show me your SSID’s, I’ll Tell Who You Are!

Wi-Fi

The idea of this article came from a colleague of mine. He wrote a first version of the script described below. I found it very useful and asked his permission to re-use it and to write this blog article. Thanks to him! In the mean time, during my researches, I also found that a friend, Didier Stevens, published on his blog the same kind of script but for an AirCap adapter. Mine uses any adapter capable to be switched to “monitor” mode.

All devices have Wi-Fi interfaces (laptops, tablets, mobile phones, consoles, etc) and their operating systems have features to easily manage the wireless networks you connect them to. When you connect for a first time to a new network, most users save the informations for later use (or the system stores it for you without notification). This small database will be used later by the operating system to discover which known network(s) is(are) available and automatically connect to them.

This database may contains a lot of interesting data. Some may reveal private information like your employer, your ISP, where you go to party, to eat, where you go on holidays or which security conference you attended. Why? Simply because networks are often configured with explicit names. Have a look at the screenshots below taken from a laptop running Ubuntu:

 

Ubuntu Wifi-Settings

(Click to enlarge)

Network Configuration

(Click to enlarge)

By default, when a new wireless network is configured, the flag “auto-connect” is enabled. This is the case on Ubuntu, MacOS and Windows 7. What does this mean? Each time you boot your computer or you reconfigure your Wireless card, the device will sent “Probe Request” management frame over the air. This can be compared to a message like “Hey! Network xxx are you there?“. Even if your network uses encryption, all those probes are sent in clear! In Wi-Fi technologies, they are several methods available to detect the available networks or SSIDs:

  • Beacon,
  • Probe Requests,
  • Probe Responses,
  • Association Requests,
  • Reassociation Requests

Probe Requests” are very interesting to be captured to detect the SSID’s already configured and used by people. To achieve this, we just need a BackTrack 5, a Wi-Fi network card that supports monitoring mode and some tools. To collect “Probe Requests“, just use the following commands:

  # iwconfig wlan0 mode monitor
  # iwconfig wlan0 channel <i>
  # tshark -i wlan0 subtype probereq

It’s easy but not very convenient! If you keep tshark running a few hours, you could miss data. The purpose of the script is to automate this process and keep some statistics about the detected probe requests (clients MAC addresses and SSID’s). It’s also important to scan all the available channels (1-14) to grab as much SSID’s as possible. This is called “channel hopping” and to achieve this, the script starts a child process which changes the Wi-Fi channel every 5 seconds within an infinite loop. The script syntax is the following:

  Usage: ./hoover.pl --interface=wlan0 [--help] [--verbose] [--iwconfig-path=/sbin/iwconfig]
                    [--ipconfig-path=/sbin/ifconfig]
                    [--dumpfile=result.txt]
  Where:
  --interface     : Specify the wireless interface to use
  --help          : This help
  --verbose       : Verbose output to STDOUT
  --ifconfig-path : Path to your ifconfig binary
  --iwconfig-path : Path to your iwconfig binary
  --tshark-path   : Path to your tshark binary
  --dumpfile      : Save found SSID's/MAC addresses in a flat file (SIGUSR1)

It will dump all detected SSID’s to the console in a completely passive way. No packets are sent over the air from the scanning host! When you kill the script or wake it up via a SIGUSR1 signal, it will dump all detected SSID’s, MAC addresses, packets count and the last time if was seen. The example below shows the result of one day of scan in my neighborhood. 40 SSID’s detected in my area is not bad (I’m leaving in the countryside).

 !! Dumping detected networks:
 !! MAC Address          SSID                           Count      Last Seen
 !! -------------------- ------------------------------ ---------- -------------------
 !! 7E-62-89-9E-C4-E4    Billi-Wifi                             43 2012/01/10 22:15:36
 !! 07-46-6E-4F-61-4E    Réseau de ******                     2732 2012/01/11 16:28:09
 !! 6F-B6-11-2E-AF-74    LA HAGOULLE                             1 2012/01/11 16:17:08
 !! 8F-9F-B1-5B-73-C8    Go-Away-Lamerz                         85 2012/01/11 16:28:09
 !! 00-ED-E1-3A-A9-1C    wifi94                                  6 2012/01/10 18:25:27
 !! E1-28-7F-6A-C6-44    3cles                                   1 2012/01/11 16:17:08
 !! 4E-CD-8A-BD-1C-EB    NOW-X-54                               10 2012/01/10 20:08:02
 !! 0B-8C-A1-1C-BB-51    CRAPS                                5598 2012/01/11 16:28:09
 !! 91-4A-F0-42-A6-63    bbox2-****                              1 2012/01/11 10:48:49
 !! 0B-A7-51-ED-E1-FA    SpeedTouchD4288C                        2 2012/01/11 16:17:08
 !! C09-C2-23-89-2D-E9   ISFS                                    4 2012/01/10 18:12:25
 !! CE-7C-B6-58-39-D3    HAYEZ                                   1 2012/01/11 10:48:49
 !! 44-45-60-E6-61-1B    Guest                                   1 2012/01/11 16:17:08
 !! 0B-A7-51-ED-E1-FA    bbox2-****                              8 2012/01/11 16:15:11
 !! 09-C2-23-89-2D-E9    biblio                                  1 2012/01/11 10:48:49
 !! CE-7C-B6-58-39-D3    free-hotspot.com                        2 2012/01/11 16:17:08
 !! 37-F3-65-28-35-0C    123EURO                                 1 2012/01/11 16:17:08
 !! E4-8F-02-9B-E8-3C    FREE_DELIRIUM                           1 2012/01/11 10:48:49
 !! 6E-2C-81-CE-13-E3    bbox2-****                              4 2012/01/10 18:25:27
 !! E9-4A-D6-4F-72-0C    chateau_magique                         1 2012/01/11 16:19:07
 !! A4-B4-B3-FC-B0-75    WiFi_FD                                 1 2012/01/11 16:17:08
 !! E3-9E-A3-9F-A1-F7    TP-LINK_******                        519 2012/01/11 16:10:51
 !! DA-6C-E2-D8-D8-A7    bbox2-****                              6 2012/01/10 18:25:27
 !! 03-94-41-21-6C-C2    bbox2-****                              3 2012/01/10 18:25:27
 !! 27-E3-1F-61-5A-69    linksys-n                               1 2012/01/11 10:48:49
 !! 81-8A-48-1B-DF-20    Philips WiFi                            1 2012/01/11 10:48:49
 !! 55-C3-BE-F9-63-60    SpeedTouch******                        1 2012/01/11 16:17:08
 !! F0-3D-CC-D3-16-A4    blanmont                               27 2012/01/11 16:28:09
 !! 7A-19-39-BC-3B-A6    chouchou                                1 2012/01/11 10:48:49
 !! 7E-62-89-9E-C4-E4    belgacom                                1 2012/01/11 10:48:49
 !! 07-46-6E-4F-61-4E    Réseau UAH                              4 2012/01/10 18:25:27
 !! 6F-B6-11-2E-AF-74    dlink                                   5 2012/01/11 10:48:49
 !! 8F-9F-B1-5B-73-C8    sagem-****                              1 2012/01/11 16:17:08
 !! 00-ED-E1-3A-A9-1C    bbox2-****                              1 2012/01/11 10:48:49
 !! E1-28-7F-6A-C6-44    bbox2-****                              2 2012/01/11 10:48:49
 !! 4E-CD-8A-BD-1C-EB    QuickWiFi                               1 2012/01/11 16:17:08
 !! 91-4A-F0-42-A6-63    bbox2-****                              1 2012/01/11 16:17:08
 !! 81-8A-48-1B-DF-20    linksys                                14 2012/01/11 16:19:07
 !! 27-E3-1F-61-5A-69    WiFi_6E                                 1 2012/01/11 16:17:08
 !! 82-94-05-84-30-ED    Sitecom                                 1 2012/01/11 16:17:08
 !! Total unique SSID: 40

Note: the MAC addresses have been randomized using the MAC Address Generator.

That’s all for the technical part. Now that you have a list of MAC addresses and SSID’s, what can you do with them? How can this script be useful from an attacker perspective?

First, use this as a “presence detection” mechanism. You can track the presence of people in a specific area. Being at home, I could detect when my neighbor is back at home and uses his laptop. Same for companies. Behind outside, you could detect the presence of employees in the office. More your antenna is powerful more you will be able to detect activity from a long way. Then, the detected SSID’s could help you to learn a lot about your potential victim. The goal is to “put a face” on the MAC address. You can learn the type of device/ISP they use. You can learn about the habits (and later to perform social engineering). hotel SSID’s, restaurant SSID’s etc.Some people defines SSID’s with personal data: pet names, street addresses, nick names. Always interesting stuff… If you know that your victim booked an room in a specific hotel, it’s a step forward to asking him to click on a rogue document coming from this hotel. But that’s another story!

The script is available here.

Suspicious WordPress Plugins Scan

Suspicious ActivityHere is an interesting example I would like to share with you. It proves how log management is important. If you read my blog, you already know that I’m addicted to logs. They can be very useful to trace incidents or suspicious activities.

Today I received several alerts from my OSSEC server with multiple HTTP 403 errors generated from a few IP addresses. From an OSSEC point of view, this is a very basic rule: If a identical event is detected x times during a period of y seconds and with the same source IP address, generate an alert.

The received alerts looked very suspicious to me. Web scans are very common but this time, it was different. All the  requests had the same format:

x.x.x.x - - [08/Jul/2011:18:17:35 +0200] "GET /wp-content/plugins/xxx HTTP/1.1" 403 406 "-" "-"

Where “xxx“  was a WordPress plugin name without any referer  or User-Agent logged. Hopefully all the GET requests were properly blocked by my Apache configuration.

Here is the list of all the 144 plugins tested:

all-in-one-seo-pack, gtranslate, wordpress-importer, contact-form-7,
si-contact-form, google-analytics-for-wordpress, yet-another-related-posts-plugin,
nextgen-gallery, ourstatsde-widget, google-sitemap-generator, akismet,
video-playlist-and-gallery-plugin, sexybookmarks, wp-super-cache, smart-youtube,
social-media-widget, wp-pagenavi, google-analyticator, tinymce-advanced,
wp-db-backup, wp-e-commerce, add-to-any, wordpress-seo, lightbox-gallery,
add-link-to-facebook, simple-tags, w3-total-cache, wp-tweet-button,
backupwordpress, wp-polls, facebook-comments-for-wordpress, feedburner-plugin,
category-posts, pretty-link, subscribe2, wordtwit, addthis, social-slider-2,
wp-postviews, really-simple-captcha, platinum-seo-pack, tubepress,
wp-google-fonts, seo-ultimate,breadcrumb-navxt, podpress, flash-album-gallery,
polldaddy, wp-postratings, page-links-to, wp-stats-dashboard,
contact-form-7-to-database-extension, backwpup, redirection,
ozh-admin-drop-down-menu, wordpress-facebook-like-plugin,custom-contact-forms,
wp-table-reloaded, tweetmeme, adrotate, share-and-follow, s2member, digg-digg,
maintenance-mode, seo-automatic-links, wp-to-twitter, simple-facebook-connect,
exclude-pages, link-library, broken-link-checker, visitor-maps, lightbox-2,
twitter-tools, powerpress, wp-dbmanager, commentluv, quick-cache, theme-my-login,
qtranslate, disqus-comment-system, eshop, wp-mail-smtp, share-this,audio-player,
wp-optimize, google-analytics-dashboard, wp-cumulus, blog-protector,
stream-video-player, feedwordpress, sidebar-login, wp-security-scan,
wordpress-mobile-pack, mappress-google-maps-for-wordpress,
all-in-one-adsense-and-ypn, vipers-video-quicktags, sitepress-multilingual-cms,
wickett-twitter-widget, exec-php, image-widget, sociable, wp-maintenance-mode,
regenerate-thumbnails, featured-content-gallery, my-page-order, events-calendar
wordpress-video-plugin, gd-star-rating, calendar, adminimize, tweet-this,
custom-field-template, mailchimp, sitemap-generator, statpress,
wordpress-23-related-posts-plugin, lightbox-plus, dynamic-content-gallery-plugin,
headspace2, global-translator, newsletter, my-category-order,
facebook-like-button, count-per-day, easy-adsenser, advertising-manager,
wp-recaptcha, twitter-widget-pro, wp-piwik, exploit-scanner, wp-jquery-lightbox,
sociable, wp-maintenance-mode, regenerate-thumbnails, featured-content-gallery,
my-page-order, events-calendar, wordpress-video-plugin, gd-star-rating, calendar,
adminimize, tweet-this, custom-field-template, mailchimp, sitemap-generator,
statpress, wordpress-23-related-posts-plugin, wassup, lightbox-plus,
dynamic-content-gallery-plugin, headspace2, global-translator, newsletter,
my-category-order, facebook-like-button, count-per-day, easy-adsenser,
advertising-manager, wp-recaptcha, twitter-widget-pro, wp-piwik, exploit-scanner,
wp-jquery-lightbox, hyper-cache, twitter-for-wordpress, robots-meta,
php-code-widget, wp125, all-in-one-webmaster, popularity-contest,
search-everything, wordpress-mobile-edition, wp-followme, wp-syntax, wp-email

Those GET requests originated from 11 different IP addresses from several locations:

  • DRTORNYC2, US
  • Universiteit van Tilburg (UvT), NL
  • CLIENT1360, CH
  • Ligne Web Services SARL, FR
  • OVH, FR,
  • Advitel Ltd, UK
  • Shaw Telecom G.P. BGPP, UK
  • Psychz Networks, US
  • Formless Networking, US
  • IQHost, RU
  • BLUTMAGIE, DE

Those requests were performed via the Tor network as described in this ARIN object. I tried to find a common point between all the tested plugins but nothing popped up in my mind. This looks clearly an enumeration attack to detect the presence of specific WordPress plugins but for which purpose? The selected plugins cover multiple domains. Some are very simple without DB backend or potential security hole.

Anybody already saw the same type of scan? Please share!

You said “Goolag”?

The Cult of the Death CowThe Cult of the Death Cow team is back with a new toy called Goolag.

One more time, the Google search engine power is diverted to help webmasters to find security breaches in their web site(s). Of course, as a good boy, you will always use Goolag against your own site! Isn’t it? :-] [1]

Goolag is a frontend (today, only available for Windows – via a mirror in Belgium) and uses the well known Google Hacking Database. The source code is also available.

About Goolag

Notice that the tool handle properly the Google scan protections! It allows you to open a browser, enter the captcha and resume the scan!

Let’s make some tests…

[1] If you combine Goolag with Tor, your anonymity will be preserved…