http://www.flickr.com/photos/noneck/

Dave from Security Ninja shows how you can easily bruteforce a certain parameter to allow access to any user’s Facebook photo album using Burp Suite. Here are the basics:

Access to albums in Facebook is controlled by three parameters of a URL, you can see them here:

http://www.facebook.com/album.php?aid=-3&id=1508034566&l=aad9c

aid=-3 (-3 for every public profile album)
id=0123456789 (Obtained by searching for the user and hovering over the add friend button)
l=? (all we know is its 5 characters from the 0123456789abcdef range)

Dave uses Burp Suite, but there are many ways you can go about it. I think a dictionary of possible values might be marginally faster (untested) so I’ll use that.

First is one of my favorite methods, w3af’s Fuzzy Requests and Clustered Response tools.

GET http://www.facebook.com/album.php?aid=-3&id=targetsid&l=$[l.strip() for l in file('fbhex.dic').readlines()]$ HTTP/1.0
Host: www.facebook.com
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312
Pragma: no-cache
Content-Type: application/x-www-form-urlencoded

Here’s the dictionary (1.1MB, zipped), extract it to your w3af directory.

After the run is finished, run the Cluster tool and wait. The valid page should show up far away from the rest of them.

Another tool that could be used for this is Edge Security’s WebSlayer:
URL:
http://www.facebook.com/album.php?aid=-3&id=targetsid&l=FUZZ
Set it to ignore lines so you can find your valid request faster. Currently, the error page contains 71 lines, but this may be different for you. Just run the scan for a few seconds and look at the number of lines that each error page contains, then stop the scan, enter the number in the ignore lines box and start again.

webslayer

Other useful features of WebSlayer are the ability to control the rate and set proxy options.

There are likely MANY other tools that you can use to accomplish this task, but these seem to be the simplest.
Good luck, and remember:

Check out Dave’s post for the Burp Suite method he uses to generate the needed parameter.

27 Responses to “Facebook Hack – Access Any Users Photo Albums”

  1. Dave (aka Security Ninja) says:

    Hi there!

    Thanks for the positive words. I like your approach using the cluster tool, I imagine any tool that could automate requests would be fine to use here.

    I wonder if there is a speed benefit to using a specific tool?

    I also like your gtfo image, if it wasn’t for the fact my original presentation was aimed at a professional audience I would have gone and found a lovely lady to have been my test user ;-)

    Dave

  2. nukeit says:

    Sometimes I pride myself in being the filter between the pros and the kiddies… and sometimes not ;)
    I didn’t really go through with the full scan for fear of being banned (and a lack of a good proxy), but it seemed to me that WebSlayer combined with the dictionary provided much faster results than w3af, though w3af is kind of shoehorned into working on windows whereas WebSlayer seems to be native across the board. Results may be better with something like psycho added to w3af running on a processor specific Linux compile.

  3. as says:

    Your dictionary file is an invalid zip archive…

  4. Andrés says:

    Where are you guys finding the slowness in w3af? In the clustering, or in the HTTP request sending?

  5. nukeit says:

    @as
    Sorry about that, should be fine now.

    @Andres
    HTTP requests seem to be about half the speed of WebSlayer and Clustering is slow because it’s processing over 1 million requests :)

  6. skipratt says:

    Great, another nosy Parker!!!

  7. yasin5582 says:

    your zip files can’t download

  8. nukeit says:

    fixed again… i hate wordpress sometimes

  9. yasin5582 says:

    thanks

  10. Yeck79 says:

    It seems Facebook now uses a 10-char width for the l=? parameter.. Is there an updated dictionary out there by any wild chance?

    And nukeit, as your mention of a lack of a good proxy, would you recommend against trying this out without one? Do you really think they’ll ban users for seeking out legitimate links?

  11. Yeck79 says:

    Ha, that’s what I figured. It would be like 16^10 right?

  12. Dave (aka Security Ninja) says:

    Hi Yeck79,

    I did post a follow up on my blog with regards to the change in the l= parameter (http://securityninja.co.uk/blog/?p=228). Basically Facebook took the old l= parameter and added 5 digits on the end.

    In short, if you exploited the flaw previously (i.e. you know the old l= number) you can run the same attack to brute force the new 5 digits. Its not that likely but hey, if you ran out when I first published it and found the profile of a lovely lady and still want to access those pictures…….

    Have fun!

    SN

  13. Dereck says:

    Good article. I’m not such FB fan but it might get handy.

  14. after says:

    Hi im looking to get into a facebook and hotmail account. can anyone help?

  15. nukeit says:

    wow, how lazy of them… ;)

  16. John says:

    Did u get any reply?

  17. joanhalo2 says:

    Hey, I was testing this method in websalyer, but when y tried to usea a payload that now has a width of 10 , in a permutation and y put the charset like 0123456789abcdef, the program does not create a temporal generator,(and instead it takes minutes to perform nothing), that we need in order to create a payload, i thought that maybe its for the width of the permutation, because I tried with a width of 5 and it just worked fine, but as you know FB now uses 10 chars in the “l” parameter, so i wanna ask somedy that uses web slayer if you know the reason of this problem, or maybe a way to solve it . thanks…and nukeit, thanks for the initial knowledge :D

  18. nukeit says:

    I’ve just about given up on webslayer support. I don’t think the devs are around anymore, and the fact that they never released source kinda makes me worried about the safety of their binaries.

  19. John says:

    Hi There

    i am not able to view any one’s photo album, if some can help me out to do so, is it possible to read photo comments also…Please help me..i need it on urgent basis

    John

  20. HydraH says:

    Now every facebook pic has a link address (pid number), and also an image address:
    http://profile.ak.facebook.com/v222/267/42/nXXXXXXXXX_4215.jpg

    I know of a person whose profile wasn’t private so I know the image address of her profile pic, then she made it all private so that now it doesn’t show up even in the search, but the old profile pic still opens.

    With Webslayer, you can find the photo or album part by forcing the pid or aid numbers. But with the image address, I don’t know how exactly to proceed ,there are so many numbers involved. Has anyone ever done this before, or does anyone know what all those numbers are?

  21. mohamed says:

    gooooooooooooood

  22. Rohit says:

    where is the download link

  23. victim101 says:

    can you help me?? pls i really need your help….
    how can i remove my photo from a facebook page?? they just grab my photo from my album and placed on their page. I don’t want my photo to be used in various facebook nonsense activities… that’s why i want it to be erased.. pls help me

  24. Blankson says:

    cool

  25. NOOB says:

    Sory people I’m sure i will get flamed for this but i still find this all unclear by no means am i a pro could u perhaps explain a little more what u doing? steps whould be great i keep gettign and invalid link when ever i try.

  26. nukeit says:

    The dictionary would be huge… and would take over a month if you were running it from the server itself :)

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

© 2010 nukeitdotorg Suffusion WordPress theme by Sayontan Sinha