I have put together a super simple tool to extract the last URL from a redirecting URL. Threat actors utilize redirections to deliver malicious payloads or hide phishing URLs. In some scenarios, the attackers would use URL shortening tools (such as bit.ly) to bypass detection algorithms in emails, SMS messages, or on web pages.
The tool is not available on my github page on this link:
It can be used in the command line to show the last URL as shown in this example:
python last-url.py https://tinyurl.com/285mdnbr
Or to show the whole history of redirections (if the link redirects more than once):
python last-url.py -h https://tinyurl.com/285mdnbr
If the URL contains “&” sign, you’ll need to put the URL in quotations
python last-url.py -h "https://tinyurl.com/285mdnbr"
Let me know in the comments if you face any trouble using the tool, or you have suggestions for improvements.