TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The JavaScript Misdirection Contest

77 pointsby SomeoneWeirdover 9 years ago

6 comments

im3w1lover 9 years ago
Just some analytics...<p><a href="http:&#x2F;&#x2F;jsfiddle.net&#x2F;278eznsr&#x2F;2" rel="nofollow">http:&#x2F;&#x2F;jsfiddle.net&#x2F;278eznsr&#x2F;2</a>
0x0over 9 years ago
Maybe somehow put the key in the url (via pushState) and then hotlink an offsite &lt;img&gt; logo, grabbing the key via the referer header at the offsite httpd?<p>Or somehow trigger a DNS lookup with the key as part of the domain, and grab it at the offsite DNS server?<p>Or maybe something with RTCPeerConnection, wasn&#x27;t there some drama about how that&#x27;s leaking IP adresses without showing up in the devtools?
ufmaceover 9 years ago
I like the idea of an underhanded JS content, but I&#x27;m not sure if this is a good way to do it. It&#x27;s hard to see how to build a short snippet of code that sends data off somewhere when it isn&#x27;t supposed to use any network access at all. Not to mention that you apparently need to write a &quot;good&quot; key generation algorithm for an undefined purpose.<p>To really do something like this, I think you&#x27;d want to pull in a big, complex JS library where the average developer isn&#x27;t as familiar with the normal usage patterns. Speaking of which, you could probably provide a modified version of some major library that does something sneaky - who ever really checks that the copy of JQuery loaded on a particular page is actually identical to the official one?<p>It&#x27;s going to be a lot harder to hide from the dev tools network tab too. You&#x27;d have to already be sending back and forth some pile of data that you can hide stuff in somehow.<p>Maybe something better would be that they provide a JS function that returns a public and private key, and the intention of the site is to send the username and public key to the server and let the user write down or copy out the private key. Then you have to write JS for the page that looks like it just sends the public key, but actually somehow sends the private key in a way that isn&#x27;t obvious from reading the code or watching the network traffic.
评论 #10144040 未加载
tyhoover 9 years ago
This contest does not make a lot of sense. Keys for cryptocurrencies are always asymmetric but it is implied that a symetric key is supposed to be produced, in addition to that there is pretty much no way to send data from a page without it being easily detectable via DevTools. A much better challenge would be to generate compromised asymmetric keys that could be easily cracked.
评论 #10143834 未加载
Kenjiover 9 years ago
What an awesome contest. After 5 minutes of reading, you can dive right into it! And it&#x27;s fun too. I&#x27;m still thinking about a good way to hide the malicious code though.
tariqali34over 9 years ago
Here&#x27;s my entry. Code doesn&#x27;t work because the offsite resource is not accepting connections from jsfiddle, but otherwise, I think it&#x27;s a good proof of concept.<p><a href="http:&#x2F;&#x2F;jsfiddle.net&#x2F;gedhry5o&#x2F;2&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jsfiddle.net&#x2F;gedhry5o&#x2F;2&#x2F;</a>