News for hackers. Stuff that matters.
Re:Personal and social information of 1.2B people discovered... by Havoc on Friday November 22, 2019 @11:11AM (#21606857)
Out of curiosity how do you guys think they managed to scrape LinkedIn on such a large scale?

I've been wanting to do some social graph experimentation on it (small scale - say 1000 people near me) but concluded I probably couldn't scrape enough via raw scraping without freaking out their anti-scraping. (And API is a non-starter since that basically says everything is verboten).

Re:Personal and social information of 1.2B people discovered... by kaivi on Friday November 22, 2019 @12:19PM (#21607627)
I've crawled a popular social network on a large scale, currently doing the same for dating services as a hobby. God, wish I'd still got paid for webscraping.

Here are some tricks which may or may not work today:

- Have an app where user logs in through said website, then scrape their friends using this user's token. That way you get exponential leverage on the number of API calls you can make, with just a handful of users.

- Call their API through ipv6, because they may not yet have a proper, ipv6 subnet-based rate limiter.

- Scrape the mobile website. Even Facebook still has a non-js mobile version. This single WAP/mobile website defeats every anti-scraping measure they may have.

- From a purely practical perspective, start with a baremetal transaction-isolation-less database like Cassandra/ScyllaDB. Don't rely on googling "postgres vs mongodb" or "sql vs nosql", those articles will all end in "YMMV". What you really need is massive IOPS, and a multi-node ring-based index with ScyllaDB will achieve that easily. Or just use MongoDB on one machine if you're not in hurry.

- Don't be too kind on the big websites. They can afford to keep all their data in hot pages, and as a one man you will never exhaust them.

Re:Personal and social information of 1.2B people discovered... by hitpointdrew on Friday November 22, 2019 @12:26PM (#21607711)
> - Call their API through ipv6, because they may not yet have a proper, ipv6 subnet-based rate limiter.

Nice tip!!

> -- From a purely practical perspective, start with a baremetal transaction-isolation-less database like Cassandra/ScyllaDB. Don't rely on googling "postgres vs mongodb" or "sql vs nosql", those articles will all end in "YMMV". What you really need is massive IOPS, and a multi-node ring-based index with ScyllaDB will achieve that easily. Or just use MongoDB on one machine if you're not in hurry.

Somewhat ironically Elasticsearch would probably work really well for this too (just make sure your elasticsearch isn't open to the world on the internet!).

Re:Personal and social information of 1.2B people discovered... by kaivi on Friday November 22, 2019 @12:36PM (#21607827)
>Somewhat ironically Elasticsearch would probably work really well for this too (just make sure your elasticsearch isn't open to the world on the internet!).

Sure it will work, but I personally don't like Elasticsearch for anything high-intensity because of its HTTP REST API and the overhead it carries. Take a look at Cassandra's [1] "CQL binary protocol", it simple and always on point.

[1] https://github.com/apache/cassandra/blob/trunk/doc/native_pr...

Re:Personal and social information of 1.2B people discovered... by davidhyde on Friday November 22, 2019 @01:22PM (#21608339)
You forgot the part about exposing your finished database to unprotected elasticsearch http endpoint ;)

In all seriousness does anyone know why you can even host an elasticsearch database as http and without credentials? Seems to be the default. What is the use case for this?

Re:Personal and social information of 1.2B people discovered... by kaivi on Friday November 22, 2019 @02:17PM (#21608979)
Tbh I'm still selling that data.

For a while I've had reoccurring nightmares that my DB had been stolen and published together with an article on how stupid and incompetent I am.

Re:Personal and social information of 1.2B people discovered... by prawnsalad on Friday November 22, 2019 @08:48PM (#21611875)
If I've understood you right, you break the TOS on other websites to collect users personal info, and then you have nightmares about people taking that data from you? Doesn't that raise ethical concerns in your eyes?
Re:Personal and social information of 1.2B people discovered... by Havoc on Friday November 22, 2019 @04:42PM (#21610408)
>You forgot the part about exposing your finished database to unprotected elasticsearch http endpoint ;)

I'll cut straight to the chase and post it on hn. This intermediate step of waiting for someone to discover it takes too long

Re:Personal and social information of 1.2B people discovered... by tomc1985 on Friday November 22, 2019 @01:26PM (#21608381)
The use case is in a local datacenter, with a NAT-ed IP not exposed to the main web
Re:Personal and social information of 1.2B people discovered... by kchamplewski on Friday November 22, 2019 @01:41PM (#21608545)
A firewalled IP would be much more appropriate, and NAT is not a firewall or a security mechanism.
Re:Personal and social information of 1.2B people discovered... by tomc1985 on Friday November 22, 2019 @07:45PM (#21611608)
Same thing, more-or-less. And NAT is effectively a firewall for inbound traffic, even if a lot of people say it isn't.
Re:Personal and social information of 1.2B people discovered... by xfer on Friday November 22, 2019 @03:15PM (#21609583)
> Have an app where user logs in through said website, then scrape their friends using this user's token.

That's some extremely shady thing to do.

Re:Personal and social information of 1.2B people discovered... by edm0nd on Friday November 22, 2019 @03:30PM (#21609726)
Welcome to the internet!
Re:Personal and social information of 1.2B people discovered... by isoos on Friday November 22, 2019 @04:19PM (#21610189)
> Don't be too kind on the big websites.

I usually recommend latency-based dynamic load control for that. Once the website starts to reply 500-1000ms longer than the average one-thread latency, it is time to take a bit of it back. It is also a co-operative strategy between fellow scrapers, even if they don't know about the other ones pushing larger load on the servers.

Re:Personal and social information of 1.2B people discovered... by arcticfox on Friday November 22, 2019 @07:35PM (#21611570)
1000ms is a massive slowdown when revenue-noticeable impacts are far, far smaller. I don't know the legality, but hitting a site hard enough to cause 1000ms slowdowns seems like it's approaching DOS legality issues.
Re:Personal and social information of 1.2B people discovered... by nfoz on Friday November 22, 2019 @02:41PM (#21609245)
Don't you consider this unethical -- if not against the site itself, than against the other users of the site whose data you're scraping?
Re:Personal and social information of 1.2B people discovered... by Ayesh on Friday November 22, 2019 @05:08PM (#21610645)
Wow these are some hot tips!

YMMV, and cloud providers would hate you for this, but you can automate the IP rotation with a cloud providers that bills you by the hour. It's easier than ever nowadays to spin an instance in Frankfurt, use it for an hour, and then another in Singapore for the second hour.

Pretending to be Googlebot also helps.

Re:Personal and social information of 1.2B people discovered... by Havoc on Friday November 22, 2019 @04:40PM (#21610395)
>- Call their API through ipv6, because they may not yet have a proper, ipv6 subnet-based rate limiter.

Clever. VMs with IPV6 are cheap as a bonus :)

Same for non-js mobile. Thanks for the tips

Re:Personal and social information of 1.2B people discovered... by adatavizguy on Friday November 22, 2019 @02:47PM (#21609312)
- Call their API through ipv6, because they may not yet have a proper, ipv6 subnet-based rate limiter.

How would someone do that using node.js? Asking for a friend.

Re:Personal and social information of 1.2B people discovered... by sillysaurusx on Friday November 22, 2019 @11:49AM (#21607298)
So far, the answers have contained non-technical answers like "Distributed Scraping." Well, yes, obviously.

A more useful answer is: I did this once, many years ago. Back then it was a matter of hooking up PhantomJS and making sure your user string was set correctly. Since PhantomJS was – I think – essentially the same as what headless chrome is today, the server can't determine that you're running a headless browser.

Now, it's not so easy nowadays to do that. There are mechanisms to detect whether the client is in headless mode. But most websites don't implement advanced detection and countermeasures. And in the ideal case, you can't really detect that someone is doing automated scraping. Imagine a VM that's literally running chrome, and the script is set up to interact with the VM using nothing but mouse movements and keyboard presses. You could even throw in some AI to the mix: record some real mouse movements and keyboard presses over time, then hook up some AI to your script such that it generates movements and keyboard presses that are impossible to distinguish from real human inputs. Such a system would be almost impossible to differentiate vs your real users.

The other piece of the puzzle is user accounts. You often have to have "aged" user accounts. For example, if you tried to scrape LinkedIn using your own account, it wouldn't matter if you were using 500 IPs. They would probably notice.

It's hard to counter a determined scraper.

Re:Personal and social information of 1.2B people discovered... by onlyrealcuzzo on Friday November 22, 2019 @11:59AM (#21607423)
I wrote a chrome headless framework that types using semi-realistic key presses (timing, mistakes, corrections) and does semi-realistic scrolling / swiping and clicking / tapping.

It's not very hard to get something that would be too hard for almost every website beside Google and Facebook to bother with. If it's a 1 on a 0-9 scale in difficulty, most websites just don't have the resources to detect it

It took me like ~3 hours to write it, but I guarantee it would take months for someone to detect it, and even then, they'd have a lot of false positives and negatives.

Re:Personal and social information of 1.2B people discovered... by zer0tonin on Friday November 22, 2019 @12:10PM (#21607540)
I think there's also a lot of bot-detection-as-a-service around here that can be used by sites smaller than Google and Facebook, like WhiteOps or IAS anti-fraud.
Re:Personal and social information of 1.2B people discovered... by mschuster91 on Friday November 22, 2019 @01:44PM (#21608597)
These are highly questionable under GDPR, many of them rely on tracking users wherever they go (e.g. Recaptcha is known for this).
Re:Personal and social information of 1.2B people discovered... by 77pt77 on Friday November 22, 2019 @09:03PM (#21611931)
> These are highly questionable under GDPR

How many fines has GDPR resulted in?

Re:Personal and social information of 1.2B people discovered... by mschuster91 on Sunday November 24, 2019 @06:48PM (#21624356)
Not many yet, general consensus is to first warn and get companies to implement better compliance - only those who really openly shit on GDPR get the fines.
Re:Personal and social information of 1.2B people discovered... by 1996 on Friday November 22, 2019 @12:48PM (#21607972)
then release it!

Headless chrome cat and mouse game is a lot of fun. We need more players.

Re:Personal and social information of 1.2B people discovered... by hobofan on Friday November 22, 2019 @01:51PM (#21608669)
LinkedIn doesn't protection doesn't seem to be that sophisticated at the moment. Someone I know maintains ~weekly up-to-date profiles of a few million users via a headless scraper that uses ~10 different premium accounts and a very low number of different IPs.
Re:Personal and social information of 1.2B people discovered... by arpa on Friday November 22, 2019 @02:45PM (#21609287)
That is a violation of ToS (using registerd accounts for scrape) and could carry potential legal implications.
Re:Personal and social information of 1.2B people discovered... by gddvhy on Friday November 22, 2019 @03:35PM (#21609780)
So is leaking PII? ToS isn't a legal contract: it's not signed by anyone and it's changed every other week without consent of users. ToS is just a formal excuse why someone's account may be suspended.
Re:Personal and social information of 1.2B people discovered... by cookiecaper on Friday November 22, 2019 @02:40PM (#21609227)
As long as you are able to source more than one provider, this can work well enough. If you're dependent on a single data source, e.g., because that source is the only possible source of said data, you'll get nuked from orbit by legal rather than technical means.

I had a business that was generating more money than my full-time job for a while. We helped and greatly simplified matters for several thousand independent proprietors while having a positive effect on the load of the data source, since we were able to batch/coalesce requests, make better use of caches, and take notification responsibilities on ourselves.

Once in a while someone would get worried and grumpy at the data source and there were a couple of cat-and-mouse games, but we easily outwitted their scraping detection each time. When they got tired of losing the technical game, they sent out the lawyers, which was far more effective. We were acquiring facts about dates and times from the place that issued/decided those dates and times, so there wasn't really any reliable alternative data source, and we had to shut down.

The glimmer of hope on the horizon is LinkedIn v. HiQ, which seems poised to potentially finally overturn 4 decades of anti-scraping case law, but not holding my breath too hard there.

Re:Personal and social information of 1.2B people discovered... by scraping_legal on Friday November 22, 2019 @02:20PM (#21609008)
The US courts decided that scraping is legal, even if against EULA:

> In a long-awaited decision in hiQ Labs, Inc. v. LinkedIn Corp., the Ninth Circuit Court of Appeals ruled that automated scraping of publicly accessible data likely does not violate the Computer Fraud and Abuse Act (CFAA). This is an important clarification of the CFAA’s scope, which should provide some relief to the wide variety of researchers, journalists, and companies who have had reason to fear cease and desist letters threatening liability simply for accessing publicly available information in a way that publishers object to. It’s a major win for research and innovation, which will hopefully pave the way for courts and Congress to further curb abuse of the CFAA.

https://www.eff.org/deeplinks/2019/09/victory-ruling-hiq-v-l...

Re:Personal and social information of 1.2B people discovered... by shkkmo on Friday November 22, 2019 @03:03PM (#21609472)
That is a blatant misrepresentation of that decision. That decision was upholding a lower court's preliminary injunction that prevents LinkedIn from blocking hiQ while the main case between the two is litigated. It is not a final decision and it doesn't purport to say that scraping is legal (it even points out other laws besides the CFAA that might be used to prohibit scraping.)
Re:Personal and social information of 1.2B people discovered... by Matsta on Friday November 22, 2019 @11:58AM (#21607410)
LinkedIn Sales Navigator is a paid tool which allows you to search their whole database. Then depending on how much you pay you can get all their personal details (Email address, phone number, even their address sometimes.) https://business.linkedin.com/sales-solutions/sales-navigato...
Re:Personal and social information of 1.2B people discovered... by calibas on Friday November 22, 2019 @12:22PM (#21607659)
I've always been a little confused how this works. If I got all that info for free, it's a "data leak", but if I pay to get the same detailed personal information it's...

In either case my personal data is given away without my consent, but there's this implication that it's only an issue when someone doesn't pay for it.

Re:Personal and social information of 1.2B people discovered... by gdulli on Friday November 22, 2019 @01:17PM (#21608276)
You're right, my take on this is that a company scraped a bunch of publicly available information, that people left open (consciously or not.) That's why only a subset have phone numbers. The profile URLs, emails, most people don't even try to protect those.

Normally the company sells this data, but now they've given it away. It's not good this data got out because the curation has some value to spammers or whoever. But using the word "leak" here undermines the severity of a real leak where passwords and social security numbers are exposed. Data that was never meant by anyone to be open.

Everyone likely has (technically) provided consent for every piece of information here being shared with partners. Buried in fine print that it wasn't really expected they'd read, of course. It's the cost of being online, and that sucks, but it seems only a leak of what had already been given out.

Re:Personal and social information of 1.2B people discovered... by sbarre on Friday November 22, 2019 @12:28PM (#21607737)
> In either case my personal data is given away without my consent

You gave that consent when you put your info in Linkedin in the first place, according to their ToS.

Re:Personal and social information of 1.2B people discovered... by Matsta on Friday November 22, 2019 @12:39PM (#21607868)
I think everyone is confused. Everyone just wants their slice of the pie (aka $$$).
Re:Personal and social information of 1.2B people discovered... by gddvhy on Friday November 22, 2019 @03:40PM (#21609827)
If you get drivers info by hacking a DMV database, it's prison. If you got the same details by paying a few millions for FOIA requests, you're a good citizen and a model tax payer.
Re:Personal and social information of 1.2B people discovered... by erichurkman on Friday November 22, 2019 @04:49PM (#21610475)
Unless you're the state of Florida, and you make millions by selling the DMV database to private buyers... [0]

[0] https://www.abcactionnews.com/news/local-news/i-team-investi...

Re:Personal and social information of 1.2B people discovered... by filoleg on Friday November 22, 2019 @06:17PM (#21611141)
Jokes aside, can you really file FOIA requests to get personal driver details from DMV? I thought FOIA would only apply for stuff that is meant to be public, but isn't due to difficulties of hosting, putting it up, etc.

Mind you, I didn't research the topic of what can or cannot be requested with FOIA, so I might be totally wrong.

Re:Personal and social information of 1.2B people discovered... by Abishek_Muthian on Friday November 22, 2019 @12:31PM (#21607772)
LinkedIn gives away email id and phone number (even if you had given just for 2FA) to all your contacts. I checked PDL, it has all the information from LinkedIn except for phone number, which I promptly removed once I identified the 2FA issue (now TOTP is available).
Re:Personal and social information of 1.2B people discovered... by fredley on Friday November 22, 2019 @11:39AM (#21607193)
'Mobile Proxies' like https://oxylabs.io/mobile-proxies (no affiliation) allow you to use large pools of mobile or domestic IPs to scrape. It's expensive, but not prohibitively so. Once you've got a mobile IP you become incredible hard to throttle, since you're behind a mobile NAT gateway.
Re:Personal and social information of 1.2B people discovered... by Ididntdothis on Friday November 22, 2019 @11:17AM (#21606914)
You probably have to be highly distributed. At least that’s what I did when I tried to scrape a large site some years ago. I had around 100 machines in different countries and gave each of them random pages to scrape.
Re:Personal and social information of 1.2B people discovered... by tyri_kai_psomi on Friday November 22, 2019 @11:17AM (#21606928)
Distributed bot and scraper networks. Thousands of IPs geographically dispersed throughout the world. There is only so much you can do with rate limiting.
Re:Personal and social information of 1.2B people discovered... by gdulli on Friday November 22, 2019 @01:23PM (#21608351)
They asked about LinkedIn, where the content is gated behind a login. If it was a rate limiting problem, that would be trivial.

Needing to be logged in as the same user defeats the purpose of proxying to hide your physical origin.

Registering thousands of different users to use in a distributed way is hard now that they require a text message verification for new accounts.

Re:Personal and social information of 1.2B people discovered... by manigandham on Friday November 22, 2019 @03:37PM (#21609796)
Public LinkedIn profiles (which is many of them) are open to scrapers and they lost a court case about it.

https://www.eff.org/deeplinks/2019/09/victory-ruling-hiq-v-l...

Re:Personal and social information of 1.2B people discovered... by gdulli on Friday November 22, 2019 @04:15PM (#21610160)
I go to LinkedIn without being logged in and nearly always get a login gate instead of the profile.

They were ordered to unblock hiQ specifically, they were not ordered to open up content to scrapers generally.

They can still throttle high volume traffic and put up captchas. I think the only specific thing the court ordered was for them to unblock hiQ IP ranges.

Re:Personal and social information of 1.2B people discovered... by StuffedParrot on Friday November 22, 2019 @11:46AM (#21607272)
Proxies can also work well for cheaper than buying distributed compute.
Re:Personal and social information of 1.2B people discovered... by momokoko on Friday November 22, 2019 @11:27AM (#21607044)
Scraping LinkedIn is so common you can usually hire people with years of experience in it. It is not as complicated as you might think. There are at minimum hundreds of companies that sell LinkedIn data they have scraped.
Re:Personal and social information of 1.2B people discovered... by iamsb on Friday November 22, 2019 @12:04PM (#21607474)
You use a proxy botnet and route your scraping requests through that. Use something like hola proxy or crawlera for example.
Re:Personal and social information of 1.2B people discovered... by alasdair_ on Friday November 22, 2019 @01:12PM (#21608240)
I scraped 10 million records from linkedin a few years ago from a single ip by using their search function. I got a list of the top 1000 first names and top 1000 last names and wrote a script to query all combinations and scrape the results.

This may or may not still work.

Re:Personal and social information of 1.2B people discovered... by magashna on Friday November 22, 2019 @11:17AM (#21606917)
It looks like the purpose was data enrichment, so maybe it was pieced together over time from multiple sources. My linkedin from PDL only had 1 bit of wrong info. I wasn't able to find anything on my personal email addresses which is good.
Re:Personal and social information of 1.2B people discovered... by MrOxiMoron on Friday November 22, 2019 @01:22PM (#21608338)
once worked on a project that tried to do just that, but at the time the LinkedIn api was already limited to seeing the authenticated users connections connections, which was too limited for what we wanted to do, can only imagine it got worse. It's also the reason recruiters really want to connect to you on LinkedIn because even if you are not interested, your connections might be.
Re:Personal and social information of 1.2B people discovered... by sergiotapia on Friday November 22, 2019 @11:33AM (#21607127)
A very large distributed network of machines.
Re:Personal and social information of 1.2B people discovered... by memn0nis on Saturday November 23, 2019 @01:00PM (#21615435)
Hey - not related to your comment (apologies) but wanted to get in touch . You left a note on a previous post of mine about wanting to simplify FTP. I'd love to work on this project and wanted to see if you'd be willing to connect so I can understand the problem better. Feel free to email me at [email protected], and thanks in advance!