Live data from Hacker News

Pastejacking

github.com

111–120 of 246 posts

Re: Pastejacking

#111
post #84

For the record you don't actually need to depend on new APIs like "document.execCommand('copy')", simply shifting focus to an off-screen textbox area when ctrl is down will do the trick in 95% of the cases, with full cross browser compatibility.

.. Not sure this would work in OSX.

Just use event.metaKey as well as CTRL.

Re: Pastejacking

#113
post #100
post #89

Earlier quoted context omitted.

TextEdit is RTF by default - I wonder if you can include control characters to screw with that? I use Sublime/Atom since those are plaintext by default.

Yes, switching TextEdit to default to Plain Text is the first thing I do after installing OSX.

Cool - just pointing this out since giving the advice to use TextEdit doesn't actually say 'in plain-text mode.' :)

Re: Pastejacking

#114
How is that better than purely HTML/CSS attack (or even telling a person to use `curl blahblah | sh` command)?

This particular attack doesn't work when not using keyboard to copy (think select to copy (traditional X behavior) or using a context menu), it causes text to unselect after busy loop ends, causes fans in my laptop to start working (because of busy new Date loop), causes cursor to cease changing for a certain period of time, requires me to enable JavaScript, requires support for "copy" command (which isn't universal), and requires the user to press CTRL+C either way (otherwise the webpage won't be able to copy into a clipboard).

I guess you could paste an output after a certain time, but because of hijacking on Ctrl key, nothing can be copied before busy loop ends, and as a result, it doesn't prevent "pasting the command into Notepad" just to ensure it's safe - as either what previously was in pastebin or malicious command will be pasted.

https://xfix.github.io/mystery-zone/command.html (disclaimer: I made this page) doesn't have any of those problems (other than requiring the user to copy text in any way (CTRL+C, text selection, context menu, whatever odd interface do you have)), and it still can break vim (and for that matter, bash, zsh (including zsh with paste protection), fish, and emacs).

Re: Pastejacking

#115
post #42
post #36

Earlier quoted context omitted.

Note that clever timing could get the "evil text" in your clipboard between checking in a text editor and pasting into the terminal. Hard to time correctly, but not impossible.

To solve this, browsers should probably disallow modifying the clipboard after a certain time period from the event. Eg. 500ms.

They do. Browsers only let you intercept and tweak existing clipboard events.

Re: Pastejacking

#116
post #79

Earlier quoted context omitted.

Demand Media makes money by monitoring ad networks and then paying people to churn out worthless content that pollutes search results. They watch metrics very carefully.

Sounds like a pretty unethical way to make money.

I'm sure that those involved have very interesting rationalizations, but I don't think that it should be viewed from an ethics perspective. Expecting people to behave against their own self interest in the short term, for the good of strangers in the long term, will always end in disappointment. This is actually a pretty simple case of poorly stated objectives being cleverly met by people who are completely self interested. LOC metrics, rat tail bounties, click-through rates. I know this sounds kind of "well what did you expect wearing something like that", but if advertisers establish metrics that are more closely aligned with their objectives then we'd all be better off.

But yeah, Demand Media is terrible and their employees are not on my Christmas card list.

Re: Pastejacking

#117
post #63

I may be the one guy using it, but I can't repro this on Safari + iTerm nightlies...

Same here. Safari + iTerm nightly. Cmd+C/Cmd+V on other text works but for the demo the author provides, I get no content. The previous clipboard content isn't overwritten on copying "no evil".

Re: Pastejacking

#118
post #28
post #9

There are many news sites that make it extremely hard to share their content on sites like HN or reddit because of these tricks. I wonder if they are actually losing traffic from it, or if their tactics work? I'm referring when you copy the text in the title of an article to try to paste it into the Title box on HN or reddit. But what you 'paste' is actually a huge paragraph about how great the news website is and ho…

I had to implement this kinda code when I worked for Demand Media and it certainly worked. Whats funny is you don't need any fancy new apis to make it work. We were doing some pretty basic tactics actually. Only real way to prevent it is disable javascript.

Toggling dom.event.clipboardevents.enabled in Firefox has fixed this on every implementation I've seen apart from the PoC here.

Re: Pastejacking

#119
post #79

Earlier quoted context omitted.

Demand Media makes money by monitoring ad networks and then paying people to churn out worthless content that pollutes search results. They watch metrics very carefully.

Sounds like a pretty unethical way to make money.

Kind of odd to even bring ethics up when discussing how websites make money. It doesn't matter at all. Ethics is normally used to discuss other people getting harmed by actions, but when all that harm can be removed simply by closing the browser and doing something else it's barely worth talking about. Is it ethical for a shop to advertise its products in the shop windows when the people running the shop know that there are higher quality products available in a competitors store? Who gives a shit?

Re: Pastejacking

#120
I can't believe vim allows executing commands when pasting text. Who on earth thought it was a good idea?
Post reply on HN