September 22, 2015 · websec bruteforce

Abusing URL Shortners to discover sensitive resources or assets

As of late, a fair few companies and startups have been using dedicated URL shortner services to use for tracking and social media purposes. An example link from such URL shortners look like this or Note that both custom words and generated random letters+numbers can be used when shortening a URL.

While I was looking at some domains with @0xkitty for bug bounties, we found an interesting attack vector to extract internal or sensitive URLs from URL shortners.

The specific method describes how its possible to salvage a bunch of potentially sensitive/or confidential URLs via the SaaS used by a large number of corporations (and those who offer bounties).

X corporation uses the URL shortner domain We can check whether or not it's a Bitly URL shortner service by visiting

This will return the following if the URL shortner is powered by Bitly:

We can now run a directory/file bruteforce on this URL shortner service in order to find links that have been generated by staff at said company through the shortner.

For example, by using the dirs3arch tool we can brute this Bitly endpoint in order to find URLs that could potentially be sensitive.

I ran the following command for only 2-5 minutes.

Note: is merely an example of a Bitly powered URL shortner, it's not an acutal Bitly shortner. It has been used to avoid listing any companies that actually do use Bitly's shortner.

root@vulnscanningyo:~/pentest/dirs3arch# python3 -u -e php,html -t 5 -w db/dirbuster/directory-list-2.3-medium.txt -x 403 2>&1 | tee results1.txt

To then filter out all the valid results, we can use this simple python script:

with open("results1.txt","r") as fp:  
    for line in fp:
        if "106B" not in line:
            print line

Running the above script returned the following results:

[03:31:05] 302 -  189B  - /10  ->
[03:31:06] 410 -    9KB - /login.php
[03:31:06] 302 -  124B  - /events  ->
[03:31:11] 302 -  123B  - /copyright  ->
[03:31:11] 302 -  165B  - /subscribe  ->
[03:31:13] 302 -  183B  - /library  ->
[03:31:16] 302 -  113B  - /mobile  ->
[03:31:16] 302 -  123B  - /policy  ->
[03:31:21] 302 -  116B  - /post  ->
[03:31:22] 302 -  119B  - /FAQ  ->
[03:31:25] 302 -  113B  - /local  ->
[03:31:28] 302 -  173B  - /policies  ->
[03:31:28] 410 -    9KB - /wp-login.php
[03:31:29] 302 -  145B  - /development  ->

From this simple abuse method we've been able to expand our attack scope and gain some knowledge about XYZ corp's internal URLs. Some URLs that were found in the quick 3-5 min bruteforce also included Google Doc forms and potentially other hard to find/sensitive links.

Applying this same method over other URL shortners will also work, however they may rate limit you so you may need to use proxies in order to extract as much as possible, blindly.

I thought this was just another cool trick/way of expanding an attack scope so I felt like it was worthy of a blog post. If you like this post, say hi to @infosec_au and @0xkitty on twitter :)