Posts Tagged ‘python’

Introducing creepy …

February 3, 2011 5 comments

or “The birdy told me where you’ve been” .

Creepy – A geolocation information aggregator


Well, privacy concerns with regards to information shared across social networking platforms is not something new. At the same time it doesn’t get old also.  I will spare you the links session, google can fetch all the papers , articles you ll ever need. Location awareness is rolled out not only in platforms created for that reason ( foursquare, gowalla ) but also in facebook ( call me places ), twitter ( location feature(?)) . Moreover as was shown here , almost a year ago, by Johannes B. Ullrich (@johullrich) users tend to ( even unknowingly )  share their location via EXIF tags in the pictures they share with everyone on image hosting services.  Then came PleaseRobMe and iCanStalkYou which really helped to made the point clear.

What :

Creepy is a geolocation aggregator. It searches for a users geolocation information that he/she has shared publicly in the social networking platforms that he/she uses. In the version released , twitter, flickr, foursquare (through twitter ) and a list of image hosting services are supported. You feed creepy with the twitter username and/or flickr id of the user and it retrieves all the locations the user has shared. Locations are determined by

  • Location information on twitter
  • foursquare checkins
  • exif tags from pictures uploaded to a number of image hosting services and posted to twitter
  • geolocation information from photos posted on Flickr

Locations are presented as a list and are also shown in an embedded map ( courtesy of the awesome osmgpsmap widget) . For each location, the context is also presented ( i.e. the text that the user tweeted ) . Features include automatic caching of discovered information ( retrieved tweets, determined locations ) in order to minimize API calls to twitter and flickr, and a (not so nice) GUI in pygtk.

Why :

Well , I have had the idea since I first read the article by Dr . Ullrich. Then came icanstalkyou and pleaserobme , but it was not exactly what i was thinking about.

Ok, the goal is double. First , to raise awareness . By making the process of retrieving and analyzing all the shared location-specific information that users share , easy and automated , I hope to make clear how easy it is for someone to stalk you, rob you, find out where you ve been and why e.t.c. It’s not worth to rewrite how one can defend himself and control the information he is sharing so I ll provide a link to the instructions posted on icanstalkyou  about disabling geotagging in smartphones and see here about how to enable/disable the location feature in twitter.

The second goal is to create a tool to add in your social engineering toolbox.  The ethics are a bit blurry , so I just want to state that I do not endorse stalking or any other form of use of creepy for malicious purposes . What the app does is to aggregate information already publicly shared . If you find that useful, you’ re welcome to use it 🙂

Screenshots :

Here are some screenshots of creepy in use

This slideshow requires JavaScript.

Where :

You can find creepy on github . I can count on the fact that there are many bugs lurking around, so use the tool , find them, and I’ll promise I’ll fix them soon enough . Enjoy !

WE Protect not.

November 3, 2010 Leave a comment

Yes, WEP is deprecated , proved to have some really nasty flaws , old story right ? Searching for “wep crack” in Google brings some 1 million results.A very nice explanation of why WEP is insecure can be found in this book . There is really no interest in discussing the matter anymore.

The interesting part of the story is how many people are still using WEP despite all that. Reasons vary from users ignorance to vendors’ continuing support of WEP in home routers/AP products e.t.c . Moving around the last 2 years I was always surprised by how many WEP – “protected” wireless LANs one can find  in every city/neighborhood. The days when cracking into those was a challenging process are long behind , what I find interesting is having an overview of the amount of WEP usage in any given circumstance. Hence I came up with the following python script that takes advantage of the iwlist utility from the wireless-tools package and provides an overview of the usage of WPA/WPA2 and WEP in the wireless LANs that are detected.

It needs the pyparsing module (python-parsing package in debian/ubuntu)

#!/usr/bin/env python

import subprocess
from pyparsing import Literal, SkipTo, OneOrMore

def wepPercentage(output):
    last_line_a = Literal('Group')+SkipTo(Literal('\n').suppress())
    last_line_b = Literal('Authentication')+SkipTo(Literal('\n').suppress())
    start = Literal('Cell')+SkipTo(Literal('\n').suppress())
    end =OneOrMore(Literal('IE: ')+SkipTo(Literal('\n').suppress()))+~last_line_a|(last_line_b+~Literal('IE:'))
    line = ~end + SkipTo(Literal('\n').suppress())
    expr = start+OneOrMore(line)+end
    wpa_count = 0
    wep_count = 0
    unenc_count = 0
    for l in expr.searchString(output).asList():
        li = ''.join(l)
        if 'Encryption key:on' in l:
            if 'WPA' in li:
                wpa_count += 1
                wep_count += 1
            unenc_count += 1
    tot = wpa_count+wep_count+unenc_count
    print "WPA / WPA2 :%d   Percentage : %d %% " % (wpa_count, (wpa_count*100/tot))
    print "WEP :%d   Percentage : %d %% " % (wep_count, (wep_count*100/tot))
    print "Unencrypted :%d   Percentage : %d %% " % (unenc_count, (unenc_count*100/tot))
if __name__ == '__main__':
    process = subprocess.Popen('iwlist wlan0 scan', shell=True, stdout=subprocess.PIPE)
    output = process.communicate()[0]

I live in a rather densely populated student dorm in Stockholm and at the time my output is something like :

WPA / WPA2 :28   Percentage : 82 %
WEP :6   Percentage : 17 %
Unencrypted :0   Percentage : 0 %

almost 20% of all people here that use some kind of wireless router , chose WEP . Great 🙂

How about your neighborhood ? Feel free to share percentages .

ps. It would probably be easier to use python’s re module instead of pyparsing . But I needed to use pyparsing for a project so I thought i d get my hands dirty with it anyhow.

ps2. It can probably be done in 5-6 lines in a bash shell using awk too .

Categories: programming, python, wireless Tags: , ,