Expand Short URL using Powershell


Introduction:

A couple of URL shortening services like Google and TinyURL are available over the Internet, and I’m a big fan as Short or Tiny URLs as they are very useful to share contents on social media (Eg. Twitter with 140 Char limit), especially for bloggers,  but they can be used for malicious purposes by spammers and hackers because they guarantee a virtual anonymity to their user and the domain.

Don’t believe me? Please wear your headphone and try the Powershell command below with a Short URL. It’s FUN 🙂  but it could have been worst, may be a malicious file would have been downloaded on your computer.

Recently, I shared some Powershell code /r/PowerShell/  which had a link which was downloading a CSV file using a Short URL from IEEE.org website which was legit, but some people were bit skeptical to run the code. Can’t blame them.

The Idea and the Powershell Function:

So, I was thinking there are short URLs services then the opposite must also exist.

A simple google search resulted in lots of Short URL expander web services and APIs, and I wrapped one of them which does not require a subscription key in a quick Powershell function, to make it work.

Using this function I can also, scan for Downloaded scripts and Documents with Powershell and check if any Short URL is directing to some bad script, domain or malicious content.

Running the Function:

You can run the function like in the below animation.

gif

Hope you’ll find the script useful and Thanks for reading, Cheers! 🙂

signature

Advertisements

9 thoughts on “Expand Short URL using Powershell

  1. An outstanding share! I have just forwarded this onto a colleague who was doing a little homework on this.

    And he actually ordered me dinner simply because I stumbled upon it for him…

    lol. So allow me to reword this…. Thanks for the meal!!
    But yeah, thanks for spending some time to talk about this topic here on your internet site.

    Like

  2. The Xerox 8400 is a solid ink printer able to printing 85,
    000 pages at a rate which will keep the most impatient person happy.
    They walk served by the items purchased using your cash high aren’t as a result of
    latch on back. You can always take aid from a pal or perhaps
    a technical expert to use it this can not simply direct you towards comprehending the tool and can also
    result in the conversion carried out in a accurate manner.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s