r/programming • • Mar 27 '23

Twitter Source Code Leaked on GitHub

https://www.cyberkendra.com/2023/03/twitter-source-code-leaked-on-github.html
8.0k Upvotes

717 comments sorted by

View all comments

31

u/FuzzYetDeadly Mar 27 '23 edited Mar 27 '23

I'm actually curious to know how their algorithm that detects that someone created a new account after getting suspended (and re-suspends them) works. Like what regex or method do they use? Unfortunately I have no idea where to even start looking to find out how this works.

Edit: thanks for the responses everyone, it's been very informative and gives me many options to explore to find a solution

83

u/myringotomy Mar 27 '23

The same way reddit does it. Browser fingerprinting.

3

u/FuzzYetDeadly Mar 27 '23

Thanks for the knowledge, I need to read up on this as I don't really understand how it works (haven't worked with web/mobile technology much)

20

u/schmuelio Mar 27 '23

Long and short of it is your web browser tells you a lot of information about:

  • What extensions it has installed

  • What version it's running

  • What OS it's on

  • What human-interface devices are available (mouse, keyboard etc.)

  • What resolution your screen is

  • What hardware capabilities you have (for things like canvas/webGL)

  • What system fonts you have installed

  • Etc.

All of this can be combined together to make a fingerprint of your browser that is nearly unique. It's possible to share a browser fingerprint with other people by happenstance, but generally speaking it's very rare.

You can see a breakdown of the stuff you can get from a browser to fingerprint it here.

1

u/Xerxero Mar 27 '23

Since this is via the browser api I would think it would be possible to randomize all these values somehow.

2

u/schmuelio Mar 27 '23

It's possible, it does pose some challenges though, faking the user agent would be fine but things like webGL capabilities or transfer format capabilities (or browser version) get complicated when you lie about them since it means the site you're visiting doesn't know what your browser supports anymore

1

u/Xerxero Mar 27 '23

Switching agent and resolution every couple of page reloads should give you already quite some entropy to stop sites from tracking you.

→ More replies (3)